@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
114 lines • 4.34 kB
JavaScript
// *** 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");
/**
* Creates and manages an AWS IoT certificate.
*
* ## Example Usage
*
* ### With CSR
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* const cert = new aws.iot.Certificate("cert", {
* csr: std.file({
* input: "/my/csr.pem",
* }).then(invoke => invoke.result),
* active: true,
* });
* ```
*
* ### Without CSR
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const cert = new aws.iot.Certificate("cert", {active: true});
* ```
*
* ### From existing certificate without a CA
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* const cert = new aws.iot.Certificate("cert", {
* certificatePem: std.file({
* input: "/my/cert.pem",
* }).then(invoke => invoke.result),
* active: true,
* });
* ```
*/
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["active"] = state?.active;
resourceInputs["arn"] = state?.arn;
resourceInputs["caCertificateId"] = state?.caCertificateId;
resourceInputs["caPem"] = state?.caPem;
resourceInputs["certificatePem"] = state?.certificatePem;
resourceInputs["csr"] = state?.csr;
resourceInputs["privateKey"] = state?.privateKey;
resourceInputs["publicKey"] = state?.publicKey;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.active === undefined && !opts.urn) {
throw new Error("Missing required property 'active'");
}
resourceInputs["active"] = args?.active;
resourceInputs["caPem"] = args?.caPem ? pulumi.secret(args.caPem) : undefined;
resourceInputs["certificatePem"] = args?.certificatePem ? pulumi.secret(args.certificatePem) : undefined;
resourceInputs["csr"] = args?.csr;
resourceInputs["region"] = args?.region;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["caCertificateId"] = undefined /*out*/;
resourceInputs["privateKey"] = undefined /*out*/;
resourceInputs["publicKey"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["caPem", "certificatePem", "privateKey", "publicKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Certificate.__pulumiType, name, resourceInputs, opts);
}
}
exports.Certificate = Certificate;
/** @internal */
Certificate.__pulumiType = 'aws:iot/certificate:Certificate';
//# sourceMappingURL=certificate.js.map
;