Association

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

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var specificInstanceIdAssociation = new AwsNative.SSM.Association("specificInstanceIdAssociation", new()
    {
        Name = "AWS-RunShellScript",
        Targets = new[]
        {
            new AwsNative.SSM.Inputs.AssociationTargetArgs
            {
                Key = "InstanceIds",
                Values = new[]
                {
                    "i-1234567890abcdef0",
                },
            },
        },
        Parameters = 
        {
            { "commands", new[]
            {
                "ls",
            } },
            { "workingDirectory", new[]
            {
                "/",
            } },
        },
        WaitForSuccessTimeoutSeconds = 300,
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

specific_instance_id_association = aws_native.ssm.Association("specificInstanceIdAssociation",
    name="AWS-RunShellScript",
    targets=[aws_native.ssm.AssociationTargetArgs(
        key="InstanceIds",
        values=["i-1234567890abcdef0"],
    )],
    parameters={
        "commands": ["ls"],
        "workingDirectory": ["/"],
    },
    wait_for_success_timeout_seconds=300)
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: ["/"],
    },
    waitForSuccessTimeoutSeconds: 300,
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var specificInstanceIdAssociation = new AwsNative.SSM.Association("specificInstanceIdAssociation", new()
    {
        Name = "AWS-RunShellScript",
        Targets = new[]
        {
            new AwsNative.SSM.Inputs.AssociationTargetArgs
            {
                Key = "InstanceIds",
                Values = new[]
                {
                    "i-1234567890abcdef0",
                },
            },
        },
        Parameters = 
        {
            { "commands", new[]
            {
                "ls",
            } },
            { "workingDirectory", new[]
            {
                "/",
            } },
        },
        WaitForSuccessTimeoutSeconds = 300,
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

specific_instance_id_association = aws_native.ssm.Association("specificInstanceIdAssociation",
    name="AWS-RunShellScript",
    targets=[aws_native.ssm.AssociationTargetArgs(
        key="InstanceIds",
        values=["i-1234567890abcdef0"],
    )],
    parameters={
        "commands": ["ls"],
        "workingDirectory": ["/"],
    },
    wait_for_success_timeout_seconds=300)
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: ["/"],
    },
    waitForSuccessTimeoutSeconds: 300,
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var allInstanceIdsAssociation = new AwsNative.SSM.Association("allInstanceIdsAssociation", new()
    {
        AssociationName = "UpdateSSMAgent",
        Name = "AWS-UpdateSSMAgent",
        ScheduleExpression = "cron(0 2 ? * SUN *)",
        Targets = new[]
        {
            new AwsNative.SSM.Inputs.AssociationTargetArgs
            {
                Key = "InstanceIds",
                Values = new[]
                {
                    "*",
                },
            },
        },
        WaitForSuccessTimeoutSeconds = 300,
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

all_instance_ids_association = aws_native.ssm.Association("allInstanceIdsAssociation",
    association_name="UpdateSSMAgent",
    name="AWS-UpdateSSMAgent",
    schedule_expression="cron(0 2 ? * SUN *)",
    targets=[aws_native.ssm.AssociationTargetArgs(
        key="InstanceIds",
        values=["*"],
    )],
    wait_for_success_timeout_seconds=300)
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: ["*"],
    }],
    waitForSuccessTimeoutSeconds: 300,
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var allInstanceIdsAssociation = new AwsNative.SSM.Association("allInstanceIdsAssociation", new()
    {
        AssociationName = "UpdateSSMAgent",
        Name = "AWS-UpdateSSMAgent",
        ScheduleExpression = "cron(0 2 ? * SUN *)",
        Targets = new[]
        {
            new AwsNative.SSM.Inputs.AssociationTargetArgs
            {
                Key = "InstanceIds",
                Values = new[]
                {
                    "*",
                },
            },
        },
        WaitForSuccessTimeoutSeconds = 300,
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

all_instance_ids_association = aws_native.ssm.Association("allInstanceIdsAssociation",
    association_name="UpdateSSMAgent",
    name="AWS-UpdateSSMAgent",
    schedule_expression="cron(0 2 ? * SUN *)",
    targets=[aws_native.ssm.AssociationTargetArgs(
        key="InstanceIds",
        values=["*"],
    )],
    wait_for_success_timeout_seconds=300)
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: ["*"],
    }],
    waitForSuccessTimeoutSeconds: 300,
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var taggedInstancesAssociation = new AwsNative.SSM.Association("taggedInstancesAssociation", new()
    {
        AssociationName = "UpdateSSMAgent",
        Name = "AWS-UpdateSSMAgent",
        ScheduleExpression = "rate(7 days)",
        Targets = new[]
        {
            new AwsNative.SSM.Inputs.AssociationTargetArgs
            {
                Key = "tag:Environment",
                Values = new[]
                {
                    "Production",
                },
            },
        },
        WaitForSuccessTimeoutSeconds = 300,
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

tagged_instances_association = aws_native.ssm.Association("taggedInstancesAssociation",
    association_name="UpdateSSMAgent",
    name="AWS-UpdateSSMAgent",
    schedule_expression="rate(7 days)",
    targets=[aws_native.ssm.AssociationTargetArgs(
        key="tag:Environment",
        values=["Production"],
    )],
    wait_for_success_timeout_seconds=300)
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"],
    }],
    waitForSuccessTimeoutSeconds: 300,
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var taggedInstancesAssociation = new AwsNative.SSM.Association("taggedInstancesAssociation", new()
    {
        AssociationName = "UpdateSSMAgent",
        Name = "AWS-UpdateSSMAgent",
        ScheduleExpression = "rate(7 days)",
        Targets = new[]
        {
            new AwsNative.SSM.Inputs.AssociationTargetArgs
            {
                Key = "tag:Environment",
                Values = new[]
                {
                    "Production",
                },
            },
        },
        WaitForSuccessTimeoutSeconds = 300,
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

tagged_instances_association = aws_native.ssm.Association("taggedInstancesAssociation",
    association_name="UpdateSSMAgent",
    name="AWS-UpdateSSMAgent",
    schedule_expression="rate(7 days)",
    targets=[aws_native.ssm.AssociationTargetArgs(
        key="tag:Environment",
        values=["Production"],
    )],
    wait_for_success_timeout_seconds=300)
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"],
    }],
    waitForSuccessTimeoutSeconds: 300,
});

Coming soon!

Create Association Resource

new Association(name: string, args?: AssociationArgs, opts?: CustomResourceOptions);
@overload
def Association(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                apply_only_at_cron_interval: Optional[bool] = None,
                association_name: Optional[str] = None,
                automation_target_parameter_name: Optional[str] = None,
                calendar_names: Optional[Sequence[str]] = None,
                compliance_severity: Optional[AssociationComplianceSeverity] = None,
                document_version: Optional[str] = None,
                instance_id: Optional[str] = None,
                max_concurrency: Optional[str] = None,
                max_errors: Optional[str] = None,
                name: Optional[str] = None,
                output_location: Optional[AssociationInstanceAssociationOutputLocationArgs] = None,
                parameters: Optional[Any] = None,
                schedule_expression: Optional[str] = None,
                schedule_offset: Optional[int] = None,
                sync_compliance: Optional[AssociationSyncCompliance] = None,
                targets: Optional[Sequence[AssociationTargetArgs]] = None,
                wait_for_success_timeout_seconds: Optional[int] = None)
@overload
def Association(resource_name: str,
                args: Optional[AssociationArgs] = None,
                opts: Optional[ResourceOptions] = None)
func NewAssociation(ctx *Context, name string, args *AssociationArgs, opts ...ResourceOption) (*Association, error)
public Association(string name, AssociationArgs? args = null, CustomResourceOptions? opts = null)
public Association(String name, AssociationArgs args)
public Association(String name, AssociationArgs args, CustomResourceOptions options)
type: aws-native:ssm:Association
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Association Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Association resource accepts the following input properties:

ApplyOnlyAtCronInterval bool
AssociationName string

The name of the association.

AutomationTargetParameterName string
CalendarNames List<string>
ComplianceSeverity Pulumi.AwsNative.SSM.AssociationComplianceSeverity
DocumentVersion string

The version of the SSM document to associate with the target.

InstanceId string

The ID of the instance that the SSM document is associated with.

MaxConcurrency string
MaxErrors string
Name string

The name of the SSM document.

OutputLocation Pulumi.AwsNative.SSM.Inputs.AssociationInstanceAssociationOutputLocationArgs
Parameters object

Parameter values that the SSM document uses at runtime.

ScheduleExpression string

A Cron or Rate expression that specifies when the association is applied to the target.

ScheduleOffset int
SyncCompliance Pulumi.AwsNative.SSM.AssociationSyncCompliance
Targets List<Pulumi.AwsNative.SSM.Inputs.AssociationTargetArgs>

The targets that the SSM document sends commands to.

WaitForSuccessTimeoutSeconds int
ApplyOnlyAtCronInterval bool
AssociationName string

The name of the association.

AutomationTargetParameterName string
CalendarNames []string
ComplianceSeverity AssociationComplianceSeverity
DocumentVersion string

The version of the SSM document to associate with the target.

InstanceId string

The ID of the instance that the SSM document is associated with.

MaxConcurrency string
MaxErrors string
Name string

The name of the SSM document.

OutputLocation AssociationInstanceAssociationOutputLocationArgs
Parameters interface{}

Parameter values that the SSM document uses at runtime.

ScheduleExpression string

A Cron or Rate expression that specifies when the association is applied to the target.

ScheduleOffset int
SyncCompliance AssociationSyncCompliance
Targets []AssociationTargetArgs

The targets that the SSM document sends commands to.

WaitForSuccessTimeoutSeconds int
applyOnlyAtCronInterval Boolean
associationName String

The name of the association.

automationTargetParameterName String
calendarNames List<String>
complianceSeverity AssociationComplianceSeverity
documentVersion String

The version of the SSM document to associate with the target.

instanceId String

The ID of the instance that the SSM document is associated with.

maxConcurrency String
maxErrors String
name String

The name of the SSM document.

outputLocation AssociationInstanceAssociationOutputLocationArgs
parameters Object

Parameter values that the SSM document uses at runtime.

scheduleExpression String

A Cron or Rate expression that specifies when the association is applied to the target.

scheduleOffset Integer
syncCompliance AssociationSyncCompliance
targets List<AssociationTargetArgs>

The targets that the SSM document sends commands to.

waitForSuccessTimeoutSeconds Integer
applyOnlyAtCronInterval boolean
associationName string

The name of the association.

automationTargetParameterName string
calendarNames string[]
complianceSeverity AssociationComplianceSeverity
documentVersion string

The version of the SSM document to associate with the target.

instanceId string

The ID of the instance that the SSM document is associated with.

maxConcurrency string
maxErrors string
name string

The name of the SSM document.

outputLocation AssociationInstanceAssociationOutputLocationArgs
parameters any

Parameter values that the SSM document uses at runtime.

scheduleExpression string

A Cron or Rate expression that specifies when the association is applied to the target.

scheduleOffset number
syncCompliance AssociationSyncCompliance
targets AssociationTargetArgs[]

The targets that the SSM document sends commands to.

waitForSuccessTimeoutSeconds number
apply_only_at_cron_interval bool
association_name str

The name of the association.

automation_target_parameter_name str
calendar_names Sequence[str]
compliance_severity AssociationComplianceSeverity
document_version str

The version of the SSM document to associate with the target.

instance_id str

The ID of the instance that the SSM document is associated with.

max_concurrency str
max_errors str
name str

The name of the SSM document.

output_location AssociationInstanceAssociationOutputLocationArgs
parameters Any

Parameter values that the SSM document uses at runtime.

schedule_expression str

A Cron or Rate expression that specifies when the association is applied to the target.

schedule_offset int
sync_compliance AssociationSyncCompliance
targets Sequence[AssociationTargetArgs]

The targets that the SSM document sends commands to.

wait_for_success_timeout_seconds int
applyOnlyAtCronInterval Boolean
associationName String

The name of the association.

automationTargetParameterName String
calendarNames List<String>
complianceSeverity "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "UNSPECIFIED"
documentVersion String

The version of the SSM document to associate with the target.

instanceId String

The ID of the instance that the SSM document is associated with.

maxConcurrency String
maxErrors String
name String

The name of the SSM document.

outputLocation Property Map
parameters Any

Parameter values that the SSM document uses at runtime.

scheduleExpression String

A Cron or Rate expression that specifies when the association is applied to the target.

scheduleOffset Number
syncCompliance "AUTO" | "MANUAL"
targets List<Property Map>

The targets that the SSM document sends commands to.

waitForSuccessTimeoutSeconds Number

Outputs

All input properties are implicitly available as output properties. Additionally, the Association resource produces the following output properties:

AssociationId string

Unique identifier of the association.

Id string

The provider-assigned unique ID for this managed resource.

AssociationId string

Unique identifier of the association.

Id string

The provider-assigned unique ID for this managed resource.

associationId String

Unique identifier of the association.

id String

The provider-assigned unique ID for this managed resource.

associationId string

Unique identifier of the association.

id string

The provider-assigned unique ID for this managed resource.

association_id str

Unique identifier of the association.

id str

The provider-assigned unique ID for this managed resource.

associationId String

Unique identifier of the association.

id String

The provider-assigned unique ID for this managed resource.

Supporting Types

AssociationComplianceSeverity

Critical
CRITICAL
High
HIGH
Medium
MEDIUM
Low
LOW
Unspecified
UNSPECIFIED
AssociationComplianceSeverityCritical
CRITICAL
AssociationComplianceSeverityHigh
HIGH
AssociationComplianceSeverityMedium
MEDIUM
AssociationComplianceSeverityLow
LOW
AssociationComplianceSeverityUnspecified
UNSPECIFIED
Critical
CRITICAL
High
HIGH
Medium
MEDIUM
Low
LOW
Unspecified
UNSPECIFIED
Critical
CRITICAL
High
HIGH
Medium
MEDIUM
Low
LOW
Unspecified
UNSPECIFIED
CRITICAL
CRITICAL
HIGH
HIGH
MEDIUM
MEDIUM
LOW
LOW
UNSPECIFIED
UNSPECIFIED
"CRITICAL"
CRITICAL
"HIGH"
HIGH
"MEDIUM"
MEDIUM
"LOW"
LOW
"UNSPECIFIED"
UNSPECIFIED

AssociationInstanceAssociationOutputLocation

AssociationS3OutputLocation

AssociationSyncCompliance

Auto
AUTO
Manual
MANUAL
AssociationSyncComplianceAuto
AUTO
AssociationSyncComplianceManual
MANUAL
Auto
AUTO
Manual
MANUAL
Auto
AUTO
Manual
MANUAL
AUTO
AUTO
MANUAL
MANUAL
"AUTO"
AUTO
"MANUAL"
MANUAL

AssociationTarget

Key string
Values List<string>
Key string
Values []string
key String
values List<String>
key string
values string[]
key str
values Sequence[str]
key String
values List<String>

Package Details

Repository
https://github.com/pulumi/pulumi-aws-native
License
Apache-2.0