@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
105 lines • 4.2 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.SigningCertificate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an IAM Signing Certificate resource to upload Signing Certificates.
*
* > **Note:** All arguments including the certificate body will be stored in the raw state as plain-text.
* ## Example Usage
*
* **Using certs on file:**
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* const testCert = new aws.iam.SigningCertificate("test_cert", {
* username: "some_test_cert",
* certificateBody: std.file({
* input: "self-ca-cert.pem",
* }).then(invoke => invoke.result),
* });
* ```
*
* **Example with cert in-line:**
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const testCertAlt = new aws.iam.SigningCertificate("test_cert_alt", {
* username: "some_test_cert",
* certificateBody: `-----BEGIN CERTIFICATE-----
* [......] # cert contents
* -----END CERTIFICATE-----
* `,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import IAM Signing Certificates using the `id`. For example:
*
* ```sh
* $ pulumi import aws:iam/signingCertificate:SigningCertificate certificate IDIDIDIDID:user-name
* ```
*/
class SigningCertificate extends pulumi.CustomResource {
/**
* Get an existing SigningCertificate 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 SigningCertificate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SigningCertificate. 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'] === SigningCertificate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["certificateBody"] = state ? state.certificateBody : undefined;
resourceInputs["certificateId"] = state ? state.certificateId : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["userName"] = state ? state.userName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.certificateBody === undefined) && !opts.urn) {
throw new Error("Missing required property 'certificateBody'");
}
if ((!args || args.userName === undefined) && !opts.urn) {
throw new Error("Missing required property 'userName'");
}
resourceInputs["certificateBody"] = args ? args.certificateBody : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["userName"] = args ? args.userName : undefined;
resourceInputs["certificateId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SigningCertificate.__pulumiType, name, resourceInputs, opts);
}
}
exports.SigningCertificate = SigningCertificate;
/** @internal */
SigningCertificate.__pulumiType = 'aws:iam/signingCertificate:SigningCertificate';
//# sourceMappingURL=signingCertificate.js.map