@pulumi/fastly
Version:
A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4
210 lines (209 loc) • 7.59 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Uploads a TLS certificate to the Fastly Platform TLS service.
*
* > Each TLS certificate **must** have its corresponding private key uploaded _prior_ to uploading the certificate. This
* can be achieved in Pulumi using `dependsOn`
*
* ## Example Usage
*
* Basic usage with self-signed CA:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fastly from "@pulumi/fastly";
* import * as tls from "@pulumi/tls";
*
* const caKey = new tls.index.PrivateKey("ca_key", {algorithm: "RSA"});
* const key = new tls.index.PrivateKey("key", {algorithm: "RSA"});
* const ca = new tls.index.SelfSignedCert("ca", {
* keyAlgorithm: caKey.algorithm,
* privateKeyPem: caKey.privateKeyPem,
* subject: [{
* commonName: "Example CA",
* }],
* isCaCertificate: true,
* validityPeriodHours: 360,
* allowedUses: [
* "cert_signing",
* "server_auth",
* ],
* });
* const example = new tls.index.CertRequest("example", {
* keyAlgorithm: key.algorithm,
* privateKeyPem: key.privateKeyPem,
* subject: [{
* commonName: "example.com",
* }],
* dnsNames: [
* "example.com",
* "www.example.com",
* ],
* });
* const cert = new tls.index.LocallySignedCert("cert", {
* certRequestPem: example.certRequestPem,
* caKeyAlgorithm: caKey.algorithm,
* caPrivateKeyPem: caKey.privateKeyPem,
* caCertPem: ca.certPem,
* validityPeriodHours: 360,
* allowedUses: [
* "cert_signing",
* "server_auth",
* ],
* });
* const config = fastly.getTlsConfiguration({
* tlsService: "PLATFORM",
* });
* const keyTlsPrivateKey = new fastly.TlsPrivateKey("key", {
* keyPem: key.privateKeyPem,
* name: "tf-demo",
* });
* const certTlsPlatformCertificate = new fastly.TlsPlatformCertificate("cert", {
* certificateBody: cert.certPem,
* intermediatesBlob: ca.certPem,
* configurationId: config.then(config => config.id),
* allowUntrustedRoot: true,
* }, {
* dependsOn: [keyTlsPrivateKey],
* });
* ```
*
* ## Import
*
* A certificate can be imported using its Fastly certificate ID, e.g.
*
* ```sh
* $ pulumi import fastly:index/tlsPlatformCertificate:TlsPlatformCertificate demo xxxxxxxxxxx
* ```
*/
export declare class TlsPlatformCertificate extends pulumi.CustomResource {
/**
* Get an existing TlsPlatformCertificate resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TlsPlatformCertificateState, opts?: pulumi.CustomResourceOptions): TlsPlatformCertificate;
/**
* Returns true if the given object is an instance of TlsPlatformCertificate. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is TlsPlatformCertificate;
/**
* Disable checking whether the root of the certificate chain is trusted. Useful for development purposes to allow use of self-signed CAs. Defaults to false. Write-only on create.
*/
readonly allowUntrustedRoot: pulumi.Output<boolean | undefined>;
/**
* PEM-formatted certificate.
*/
readonly certificateBody: pulumi.Output<string>;
/**
* ID of TLS configuration to be used to terminate TLS traffic.
*/
readonly configurationId: pulumi.Output<string>;
/**
* Timestamp (GMT) when the certificate was created.
*/
readonly createdAt: pulumi.Output<string>;
/**
* All the domains (including wildcard domains) that are listed in any certificate's Subject Alternative Names (SAN) list.
*/
readonly domains: pulumi.Output<string[]>;
/**
* PEM-formatted certificate chain from the `certificateBody` to its root.
*/
readonly intermediatesBlob: pulumi.Output<string>;
/**
* Timestamp (GMT) when the certificate will expire.
*/
readonly notAfter: pulumi.Output<string>;
/**
* Timestamp (GMT) when the certificate will become valid.
*/
readonly notBefore: pulumi.Output<string>;
/**
* A recommendation from Fastly indicating the key associated with this certificate is in need of rotation.
*/
readonly replace: pulumi.Output<boolean>;
/**
* Timestamp (GMT) when the certificate was last updated.
*/
readonly updatedAt: pulumi.Output<string>;
/**
* Create a TlsPlatformCertificate resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: TlsPlatformCertificateArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering TlsPlatformCertificate resources.
*/
export interface TlsPlatformCertificateState {
/**
* Disable checking whether the root of the certificate chain is trusted. Useful for development purposes to allow use of self-signed CAs. Defaults to false. Write-only on create.
*/
allowUntrustedRoot?: pulumi.Input<boolean>;
/**
* PEM-formatted certificate.
*/
certificateBody?: pulumi.Input<string>;
/**
* ID of TLS configuration to be used to terminate TLS traffic.
*/
configurationId?: pulumi.Input<string>;
/**
* Timestamp (GMT) when the certificate was created.
*/
createdAt?: pulumi.Input<string>;
/**
* All the domains (including wildcard domains) that are listed in any certificate's Subject Alternative Names (SAN) list.
*/
domains?: pulumi.Input<pulumi.Input<string>[]>;
/**
* PEM-formatted certificate chain from the `certificateBody` to its root.
*/
intermediatesBlob?: pulumi.Input<string>;
/**
* Timestamp (GMT) when the certificate will expire.
*/
notAfter?: pulumi.Input<string>;
/**
* Timestamp (GMT) when the certificate will become valid.
*/
notBefore?: pulumi.Input<string>;
/**
* A recommendation from Fastly indicating the key associated with this certificate is in need of rotation.
*/
replace?: pulumi.Input<boolean>;
/**
* Timestamp (GMT) when the certificate was last updated.
*/
updatedAt?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a TlsPlatformCertificate resource.
*/
export interface TlsPlatformCertificateArgs {
/**
* Disable checking whether the root of the certificate chain is trusted. Useful for development purposes to allow use of self-signed CAs. Defaults to false. Write-only on create.
*/
allowUntrustedRoot?: pulumi.Input<boolean>;
/**
* PEM-formatted certificate.
*/
certificateBody: pulumi.Input<string>;
/**
* ID of TLS configuration to be used to terminate TLS traffic.
*/
configurationId: pulumi.Input<string>;
/**
* PEM-formatted certificate chain from the `certificateBody` to its root.
*/
intermediatesBlob: pulumi.Input<string>;
}