@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
118 lines • 5.12 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.Activation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Registers an on-premises server or virtual machine with Amazon EC2 so that it can be managed using Run Command.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const assumeRole = aws.iam.getPolicyDocument({
* statements: [{
* effect: "Allow",
* principals: [{
* type: "Service",
* identifiers: ["ssm.amazonaws.com"],
* }],
* actions: ["sts:AssumeRole"],
* }],
* });
* const testRole = new aws.iam.Role("test_role", {
* name: "test_role",
* assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json),
* });
* const testAttach = new aws.iam.RolePolicyAttachment("test_attach", {
* role: testRole.name,
* policyArn: "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
* });
* const foo = new aws.ssm.Activation("foo", {
* name: "test_ssm_activation",
* description: "Test",
* iamRole: testRole.id,
* registrationLimit: 5,
* }, {
* dependsOn: [testAttach],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import AWS SSM Activation using the `id`. For example:
*
* ```sh
* $ pulumi import aws:ssm/activation:Activation example e488f2f6-e686-4afb-8a04-ef6dfEXAMPLE
* ```
* -> __Note:__ The `activation_code` attribute cannot be imported.
*/
class Activation extends pulumi.CustomResource {
/**
* Get an existing Activation 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 Activation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Activation. 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'] === Activation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activationCode"] = state ? state.activationCode : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["expirationDate"] = state ? state.expirationDate : undefined;
resourceInputs["expired"] = state ? state.expired : undefined;
resourceInputs["iamRole"] = state ? state.iamRole : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["registrationCount"] = state ? state.registrationCount : undefined;
resourceInputs["registrationLimit"] = state ? state.registrationLimit : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
if ((!args || args.iamRole === undefined) && !opts.urn) {
throw new Error("Missing required property 'iamRole'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["expirationDate"] = args ? args.expirationDate : undefined;
resourceInputs["iamRole"] = args ? args.iamRole : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["registrationLimit"] = args ? args.registrationLimit : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["activationCode"] = undefined /*out*/;
resourceInputs["expired"] = undefined /*out*/;
resourceInputs["registrationCount"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Activation.__pulumiType, name, resourceInputs, opts);
}
}
exports.Activation = Activation;
/** @internal */
Activation.__pulumiType = 'aws:ssm/activation:Activation';
//# sourceMappingURL=activation.js.map