@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
114 lines • 4.69 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, 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["active"] = state ? state.active : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["caCertificateId"] = state ? state.caCertificateId : undefined;
resourceInputs["caPem"] = state ? state.caPem : undefined;
resourceInputs["certificatePem"] = state ? state.certificatePem : undefined;
resourceInputs["csr"] = state ? state.csr : undefined;
resourceInputs["privateKey"] = state ? state.privateKey : undefined;
resourceInputs["publicKey"] = state ? state.publicKey : undefined;
resourceInputs["region"] = state ? state.region : undefined;
}
else {
const args = argsOrState;
if ((!args || args.active === undefined) && !opts.urn) {
throw new Error("Missing required property 'active'");
}
resourceInputs["active"] = args ? args.active : undefined;
resourceInputs["caPem"] = (args === null || args === void 0 ? void 0 : args.caPem) ? pulumi.secret(args.caPem) : undefined;
resourceInputs["certificatePem"] = (args === null || args === void 0 ? void 0 : args.certificatePem) ? pulumi.secret(args.certificatePem) : undefined;
resourceInputs["csr"] = args ? args.csr : undefined;
resourceInputs["region"] = args ? args.region : undefined;
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