UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

189 lines • 8.49 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.CertificateAuthority = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage AWS Certificate Manager Private Certificate Authorities (ACM PCA Certificate Authorities). * * > **NOTE:** Creating this resource will leave the certificate authority in a `PENDING_CERTIFICATE` status, which means it cannot yet issue certificates. To complete this setup, you must fully sign the certificate authority CSR available in the `certificateSigningRequest` attribute. The `aws.acmpca.CertificateAuthorityCertificate` resource can be used for this purpose. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.acmpca.CertificateAuthority("example", { * certificateAuthorityConfiguration: { * keyAlgorithm: "RSA_4096", * signingAlgorithm: "SHA512WITHRSA", * subject: { * commonName: "example.com", * }, * }, * permanentDeletionTimeInDays: 7, * }); * ``` * * ### Short-lived certificate * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.acmpca.CertificateAuthority("example", { * usageMode: "SHORT_LIVED_CERTIFICATE", * certificateAuthorityConfiguration: { * keyAlgorithm: "RSA_4096", * signingAlgorithm: "SHA512WITHRSA", * subject: { * commonName: "example.com", * }, * }, * }); * ``` * * ### Enable Certificate Revocation List * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.Bucket("example", { * bucket: "example", * forceDestroy: true, * }); * const acmpcaBucketAccess = aws.iam.getPolicyDocumentOutput({ * statements: [{ * actions: [ * "s3:GetBucketAcl", * "s3:GetBucketLocation", * "s3:PutObject", * "s3:PutObjectAcl", * ], * resources: [ * example.arn, * pulumi.interpolate`${example.arn}/*`, * ], * principals: [{ * identifiers: ["acm-pca.amazonaws.com"], * type: "Service", * }], * }], * }); * const exampleBucketPolicy = new aws.s3.BucketPolicy("example", { * bucket: example.id, * policy: acmpcaBucketAccess.apply(acmpcaBucketAccess => acmpcaBucketAccess.json), * }); * const exampleCertificateAuthority = new aws.acmpca.CertificateAuthority("example", { * certificateAuthorityConfiguration: { * keyAlgorithm: "RSA_4096", * signingAlgorithm: "SHA512WITHRSA", * subject: { * commonName: "example.com", * }, * }, * revocationConfiguration: { * crlConfiguration: { * customCname: "crl.example.com", * enabled: true, * expirationInDays: 7, * s3BucketName: example.id, * s3ObjectAcl: "BUCKET_OWNER_FULL_CONTROL", * }, * }, * }, { * dependsOn: [exampleBucketPolicy], * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_acmpca_certificate_authority` using the certificate authority ARN. For example: * * ```sh * $ pulumi import aws:acmpca/certificateAuthority:CertificateAuthority example arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 * ``` */ class CertificateAuthority extends pulumi.CustomResource { /** * Get an existing CertificateAuthority 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, id, state, opts) { return new CertificateAuthority(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CertificateAuthority. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === CertificateAuthority.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["certificate"] = state ? state.certificate : undefined; resourceInputs["certificateAuthorityConfiguration"] = state ? state.certificateAuthorityConfiguration : undefined; resourceInputs["certificateChain"] = state ? state.certificateChain : undefined; resourceInputs["certificateSigningRequest"] = state ? state.certificateSigningRequest : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["keyStorageSecurityStandard"] = state ? state.keyStorageSecurityStandard : undefined; resourceInputs["notAfter"] = state ? state.notAfter : undefined; resourceInputs["notBefore"] = state ? state.notBefore : undefined; resourceInputs["permanentDeletionTimeInDays"] = state ? state.permanentDeletionTimeInDays : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["revocationConfiguration"] = state ? state.revocationConfiguration : undefined; resourceInputs["serial"] = state ? state.serial : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["usageMode"] = state ? state.usageMode : undefined; } else { const args = argsOrState; if ((!args || args.certificateAuthorityConfiguration === undefined) && !opts.urn) { throw new Error("Missing required property 'certificateAuthorityConfiguration'"); } resourceInputs["certificateAuthorityConfiguration"] = args ? args.certificateAuthorityConfiguration : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["keyStorageSecurityStandard"] = args ? args.keyStorageSecurityStandard : undefined; resourceInputs["permanentDeletionTimeInDays"] = args ? args.permanentDeletionTimeInDays : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["revocationConfiguration"] = args ? args.revocationConfiguration : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["usageMode"] = args ? args.usageMode : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["certificate"] = undefined /*out*/; resourceInputs["certificateChain"] = undefined /*out*/; resourceInputs["certificateSigningRequest"] = undefined /*out*/; resourceInputs["notAfter"] = undefined /*out*/; resourceInputs["notBefore"] = undefined /*out*/; resourceInputs["serial"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CertificateAuthority.__pulumiType, name, resourceInputs, opts); } } exports.CertificateAuthority = CertificateAuthority; /** @internal */ CertificateAuthority.__pulumiType = 'aws:acmpca/certificateAuthority:CertificateAuthority'; //# sourceMappingURL=certificateAuthority.js.map