@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
157 lines • 6.09 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.Parameter = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an SSM Parameter resource.
*
* > **Note:** The `overwrite` argument makes it possible to overwrite an existing SSM Parameter created outside of IAC.
*
* ## Example Usage
*
* ### Basic example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const foo = new aws.ssm.Parameter("foo", {
* name: "foo",
* type: aws.ssm.ParameterType.String,
* value: "bar",
* });
* ```
*
* ### Encrypted string using default SSM KMS key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const _default = new aws.rds.Instance("default", {
* allocatedStorage: 10,
* storageType: aws.rds.StorageType.GP2,
* engine: "mysql",
* engineVersion: "5.7.16",
* instanceClass: aws.rds.InstanceType.T2_Micro,
* dbName: "mydb",
* username: "foo",
* password: databaseMasterPassword,
* dbSubnetGroupName: "my_database_subnet_group",
* parameterGroupName: "default.mysql5.7",
* });
* const secret = new aws.ssm.Parameter("secret", {
* name: "/production/database/password/master",
* description: "The parameter description",
* type: aws.ssm.ParameterType.SecureString,
* value: databaseMasterPassword,
* tags: {
* environment: "production",
* },
* });
* ```
*
* ## Import
*
* ### Identity Schema
*
* #### Required
*
* * `name` - (String) Name of the parameter.
*
* #### Optional
*
* * `account_id` (String) AWS Account where this resource is managed.
*
* * `region` (String) Region where this resource is managed.
*
* Using `pulumi import`, import SSM Parameters using the parameter store `name`. For example:
*
* console
*
* % pulumi import aws_ssm_parameter.example /my_path/my_paramname
*/
class Parameter extends pulumi.CustomResource {
/**
* Get an existing Parameter 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 Parameter(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Parameter. 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'] === Parameter.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedPattern"] = state?.allowedPattern;
resourceInputs["arn"] = state?.arn;
resourceInputs["dataType"] = state?.dataType;
resourceInputs["description"] = state?.description;
resourceInputs["hasValueWo"] = state?.hasValueWo;
resourceInputs["insecureValue"] = state?.insecureValue;
resourceInputs["keyId"] = state?.keyId;
resourceInputs["name"] = state?.name;
resourceInputs["overwrite"] = state?.overwrite;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["tier"] = state?.tier;
resourceInputs["type"] = state?.type;
resourceInputs["value"] = state?.value;
resourceInputs["valueWo"] = state?.valueWo;
resourceInputs["valueWoVersion"] = state?.valueWoVersion;
resourceInputs["version"] = state?.version;
}
else {
const args = argsOrState;
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["allowedPattern"] = args?.allowedPattern;
resourceInputs["arn"] = args?.arn;
resourceInputs["dataType"] = args?.dataType;
resourceInputs["description"] = args?.description;
resourceInputs["insecureValue"] = args?.insecureValue;
resourceInputs["keyId"] = args?.keyId;
resourceInputs["name"] = args?.name;
resourceInputs["overwrite"] = args?.overwrite;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["tier"] = args?.tier;
resourceInputs["type"] = args?.type;
resourceInputs["value"] = args?.value ? pulumi.secret(args.value) : undefined;
resourceInputs["valueWo"] = args?.valueWo ? pulumi.secret(args.valueWo) : undefined;
resourceInputs["valueWoVersion"] = args?.valueWoVersion;
resourceInputs["hasValueWo"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["value", "valueWo"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Parameter.__pulumiType, name, resourceInputs, opts);
}
}
exports.Parameter = Parameter;
/** @internal */
Parameter.__pulumiType = 'aws:ssm/parameter:Parameter';
//# sourceMappingURL=parameter.js.map