UNPKG

@pulumi/aws

Version:

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

132 lines 6.1 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.Certificate = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to issue a certificate using AWS Certificate Manager Private Certificate Authority (ACM PCA). * * Certificates created using `aws.acmpca.Certificate` are not eligible for automatic renewal, * and must be replaced instead. * To issue a renewable certificate using an ACM PCA, create a `aws.acm.Certificate` * with the parameter `certificateAuthorityArn`. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as tls from "@pulumi/tls"; * * const exampleCertificateAuthority = new aws.acmpca.CertificateAuthority("example", { * certificateAuthorityConfiguration: { * keyAlgorithm: "RSA_4096", * signingAlgorithm: "SHA512WITHRSA", * subject: { * commonName: "example.com", * }, * }, * permanentDeletionTimeInDays: 7, * }); * const key = new tls.index.PrivateKey("key", {algorithm: "RSA"}); * const csr = new tls.index.CertRequest("csr", { * privateKeyPem: key.privateKeyPem, * subject: [{ * commonName: "example", * }], * }); * const example = new aws.acmpca.Certificate("example", { * certificateAuthorityArn: exampleCertificateAuthority.arn, * certificateSigningRequest: csr.certRequestPem, * signingAlgorithm: "SHA256WITHRSA", * validity: { * type: "YEARS", * value: "1", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import ACM PCA Certificates using their ARN. For example: * * ```sh * $ pulumi import aws:acmpca/certificate:Certificate cert arn:aws:acm-pca:eu-west-1:675225743824:certificate-authority/08319ede-83g9-1400-8f21-c7d12b2b6edb/certificate/a4e9c2aa4bcfab625g1b9136464cd3a * ``` */ class Certificate extends pulumi.CustomResource { /** * Get an existing Certificate 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 Certificate(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Certificate. 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'] === Certificate.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiPassthrough"] = state ? state.apiPassthrough : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["certificate"] = state ? state.certificate : undefined; resourceInputs["certificateAuthorityArn"] = state ? state.certificateAuthorityArn : undefined; resourceInputs["certificateChain"] = state ? state.certificateChain : undefined; resourceInputs["certificateSigningRequest"] = state ? state.certificateSigningRequest : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["signingAlgorithm"] = state ? state.signingAlgorithm : undefined; resourceInputs["templateArn"] = state ? state.templateArn : undefined; resourceInputs["validity"] = state ? state.validity : undefined; } else { const args = argsOrState; if ((!args || args.certificateAuthorityArn === undefined) && !opts.urn) { throw new Error("Missing required property 'certificateAuthorityArn'"); } if ((!args || args.certificateSigningRequest === undefined) && !opts.urn) { throw new Error("Missing required property 'certificateSigningRequest'"); } if ((!args || args.signingAlgorithm === undefined) && !opts.urn) { throw new Error("Missing required property 'signingAlgorithm'"); } if ((!args || args.validity === undefined) && !opts.urn) { throw new Error("Missing required property 'validity'"); } resourceInputs["apiPassthrough"] = args ? args.apiPassthrough : undefined; resourceInputs["certificateAuthorityArn"] = args ? args.certificateAuthorityArn : undefined; resourceInputs["certificateSigningRequest"] = args ? args.certificateSigningRequest : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["signingAlgorithm"] = args ? args.signingAlgorithm : undefined; resourceInputs["templateArn"] = args ? args.templateArn : undefined; resourceInputs["validity"] = args ? args.validity : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["certificate"] = undefined /*out*/; resourceInputs["certificateChain"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Certificate.__pulumiType, name, resourceInputs, opts); } } exports.Certificate = Certificate; /** @internal */ Certificate.__pulumiType = 'aws:acmpca/certificate:Certificate'; //# sourceMappingURL=certificate.js.map