UNPKG

@pulumi/aws-native

Version:

The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)

198 lines • 7.93 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.Association = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The AWS::SSM::Association resource associates an SSM document in AWS Systems Manager with EC2 instances that contain a configuration agent to process the document. * * ## Example Usage * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const specificInstanceIdAssociation = new aws_native.ssm.Association("specificInstanceIdAssociation", { * name: "AWS-RunShellScript", * targets: [{ * key: "InstanceIds", * values: ["i-1234567890abcdef0"], * }], * parameters: { * commands: ["ls"], * workingDirectory: ["/"], * }, * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const specificInstanceIdAssociation = new aws_native.ssm.Association("specificInstanceIdAssociation", { * name: "AWS-RunShellScript", * targets: [{ * key: "InstanceIds", * values: ["i-1234567890abcdef0"], * }], * parameters: { * commands: ["ls"], * workingDirectory: ["/"], * }, * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const allInstanceIdsAssociation = new aws_native.ssm.Association("allInstanceIdsAssociation", { * associationName: "UpdateSSMAgent", * name: "AWS-UpdateSSMAgent", * scheduleExpression: "cron(0 2 ? * SUN *)", * targets: [{ * key: "InstanceIds", * values: ["*"], * }], * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const allInstanceIdsAssociation = new aws_native.ssm.Association("allInstanceIdsAssociation", { * associationName: "UpdateSSMAgent", * name: "AWS-UpdateSSMAgent", * scheduleExpression: "cron(0 2 ? * SUN *)", * targets: [{ * key: "InstanceIds", * values: ["*"], * }], * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const taggedInstancesAssociation = new aws_native.ssm.Association("taggedInstancesAssociation", { * associationName: "UpdateSSMAgent", * name: "AWS-UpdateSSMAgent", * scheduleExpression: "rate(7 days)", * targets: [{ * key: "tag:Environment", * values: ["Production"], * }], * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const taggedInstancesAssociation = new aws_native.ssm.Association("taggedInstancesAssociation", { * associationName: "UpdateSSMAgent", * name: "AWS-UpdateSSMAgent", * scheduleExpression: "rate(7 days)", * targets: [{ * key: "tag:Environment", * values: ["Production"], * }], * }); * * ``` */ class Association extends pulumi.CustomResource { /** * Get an existing Association 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 opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, opts) { return new Association(name, undefined, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Association. 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'] === Association.__pulumiType; } /** * Create a Association resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name, args, opts) { let resourceInputs = {}; opts = opts || {}; if (!opts.id) { resourceInputs["applyOnlyAtCronInterval"] = args ? args.applyOnlyAtCronInterval : undefined; resourceInputs["associationName"] = args ? args.associationName : undefined; resourceInputs["automationTargetParameterName"] = args ? args.automationTargetParameterName : undefined; resourceInputs["calendarNames"] = args ? args.calendarNames : undefined; resourceInputs["complianceSeverity"] = args ? args.complianceSeverity : undefined; resourceInputs["documentVersion"] = args ? args.documentVersion : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["maxConcurrency"] = args ? args.maxConcurrency : undefined; resourceInputs["maxErrors"] = args ? args.maxErrors : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["outputLocation"] = args ? args.outputLocation : undefined; resourceInputs["parameters"] = args ? args.parameters : undefined; resourceInputs["scheduleExpression"] = args ? args.scheduleExpression : undefined; resourceInputs["scheduleOffset"] = args ? args.scheduleOffset : undefined; resourceInputs["syncCompliance"] = args ? args.syncCompliance : undefined; resourceInputs["targets"] = args ? args.targets : undefined; resourceInputs["waitForSuccessTimeoutSeconds"] = args ? args.waitForSuccessTimeoutSeconds : undefined; resourceInputs["associationId"] = undefined /*out*/; } else { resourceInputs["applyOnlyAtCronInterval"] = undefined /*out*/; resourceInputs["associationId"] = undefined /*out*/; resourceInputs["associationName"] = undefined /*out*/; resourceInputs["automationTargetParameterName"] = undefined /*out*/; resourceInputs["calendarNames"] = undefined /*out*/; resourceInputs["complianceSeverity"] = undefined /*out*/; resourceInputs["documentVersion"] = undefined /*out*/; resourceInputs["instanceId"] = undefined /*out*/; resourceInputs["maxConcurrency"] = undefined /*out*/; resourceInputs["maxErrors"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["outputLocation"] = undefined /*out*/; resourceInputs["parameters"] = undefined /*out*/; resourceInputs["scheduleExpression"] = undefined /*out*/; resourceInputs["scheduleOffset"] = undefined /*out*/; resourceInputs["syncCompliance"] = undefined /*out*/; resourceInputs["targets"] = undefined /*out*/; resourceInputs["waitForSuccessTimeoutSeconds"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Association.__pulumiType, name, resourceInputs, opts); } } exports.Association = Association; /** @internal */ Association.__pulumiType = 'aws-native:ssm:Association'; //# sourceMappingURL=association.js.map