UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

118 lines 4.74 kB
"use strict"; // *** 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, { ...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?.activationCode; resourceInputs["description"] = state?.description; resourceInputs["expirationDate"] = state?.expirationDate; resourceInputs["expired"] = state?.expired; resourceInputs["iamRole"] = state?.iamRole; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["registrationCount"] = state?.registrationCount; resourceInputs["registrationLimit"] = state?.registrationLimit; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.iamRole === undefined && !opts.urn) { throw new Error("Missing required property 'iamRole'"); } resourceInputs["description"] = args?.description; resourceInputs["expirationDate"] = args?.expirationDate; resourceInputs["iamRole"] = args?.iamRole; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["registrationLimit"] = args?.registrationLimit; resourceInputs["tags"] = args?.tags; 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