UNPKG

@pulumi/aws

Version:

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

195 lines • 8.08 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 * * ### Identity Schema * * #### Required * * - `arn` (String) Amazon Resource Name (ARN) of the ACM PCA certificate authority. * * Using `pulumi import`, import `aws_acmpca_certificate_authority` using the certificate authority ARN. For example: * * console * * % pulumi import aws_acmpca_certificate_authority.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, { ...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?.arn; resourceInputs["certificate"] = state?.certificate; resourceInputs["certificateAuthorityConfiguration"] = state?.certificateAuthorityConfiguration; resourceInputs["certificateChain"] = state?.certificateChain; resourceInputs["certificateSigningRequest"] = state?.certificateSigningRequest; resourceInputs["enabled"] = state?.enabled; resourceInputs["keyStorageSecurityStandard"] = state?.keyStorageSecurityStandard; resourceInputs["notAfter"] = state?.notAfter; resourceInputs["notBefore"] = state?.notBefore; resourceInputs["permanentDeletionTimeInDays"] = state?.permanentDeletionTimeInDays; resourceInputs["region"] = state?.region; resourceInputs["revocationConfiguration"] = state?.revocationConfiguration; resourceInputs["serial"] = state?.serial; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["type"] = state?.type; resourceInputs["usageMode"] = state?.usageMode; } else { const args = argsOrState; if (args?.certificateAuthorityConfiguration === undefined && !opts.urn) { throw new Error("Missing required property 'certificateAuthorityConfiguration'"); } resourceInputs["certificateAuthorityConfiguration"] = args?.certificateAuthorityConfiguration; resourceInputs["enabled"] = args?.enabled; resourceInputs["keyStorageSecurityStandard"] = args?.keyStorageSecurityStandard; resourceInputs["permanentDeletionTimeInDays"] = args?.permanentDeletionTimeInDays; resourceInputs["region"] = args?.region; resourceInputs["revocationConfiguration"] = args?.revocationConfiguration; resourceInputs["tags"] = args?.tags; resourceInputs["type"] = args?.type; resourceInputs["usageMode"] = args?.usageMode; 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