UNPKG

@pulumi/aws

Version:

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

132 lines 5.71 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, { ...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?.apiPassthrough; resourceInputs["arn"] = state?.arn; resourceInputs["certificate"] = state?.certificate; resourceInputs["certificateAuthorityArn"] = state?.certificateAuthorityArn; resourceInputs["certificateChain"] = state?.certificateChain; resourceInputs["certificateSigningRequest"] = state?.certificateSigningRequest; resourceInputs["region"] = state?.region; resourceInputs["signingAlgorithm"] = state?.signingAlgorithm; resourceInputs["templateArn"] = state?.templateArn; resourceInputs["validity"] = state?.validity; } else { const args = argsOrState; if (args?.certificateAuthorityArn === undefined && !opts.urn) { throw new Error("Missing required property 'certificateAuthorityArn'"); } if (args?.certificateSigningRequest === undefined && !opts.urn) { throw new Error("Missing required property 'certificateSigningRequest'"); } if (args?.signingAlgorithm === undefined && !opts.urn) { throw new Error("Missing required property 'signingAlgorithm'"); } if (args?.validity === undefined && !opts.urn) { throw new Error("Missing required property 'validity'"); } resourceInputs["apiPassthrough"] = args?.apiPassthrough; resourceInputs["certificateAuthorityArn"] = args?.certificateAuthorityArn; resourceInputs["certificateSigningRequest"] = args?.certificateSigningRequest; resourceInputs["region"] = args?.region; resourceInputs["signingAlgorithm"] = args?.signingAlgorithm; resourceInputs["templateArn"] = args?.templateArn; resourceInputs["validity"] = args?.validity; 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