AWS Native is in preview. AWS Classic is fully supported.
aws-native.ssm.Association
Explore with Pulumi AI
AWS Native is in preview. AWS Classic is fully supported.
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 System.Linq;
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[]
{
"/",
} },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "specificInstanceIdAssociation", &ssm.AssociationArgs{
Name: pulumi.String("AWS-RunShellScript"),
Targets: []ssm.AssociationTargetArgs{
{
Key: pulumi.String("InstanceIds"),
Values: pulumi.StringArray{
pulumi.String("i-1234567890abcdef0"),
},
},
},
Parameters: pulumi.Any{
Commands: []string{
"ls",
},
WorkingDirectory: []string{
"/",
},
},
})
if err != nil {
return err
}
return nil
})
}
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": ["/"],
})
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: ["/"],
},
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
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[]
{
"/",
} },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "specificInstanceIdAssociation", &ssm.AssociationArgs{
Name: pulumi.String("AWS-RunShellScript"),
Targets: []ssm.AssociationTargetArgs{
{
Key: pulumi.String("InstanceIds"),
Values: pulumi.StringArray{
pulumi.String("i-1234567890abcdef0"),
},
},
},
Parameters: pulumi.Any{
Commands: []string{
"ls",
},
WorkingDirectory: []string{
"/",
},
},
})
if err != nil {
return err
}
return nil
})
}
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": ["/"],
})
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: ["/"],
},
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
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[]
{
"*",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "allInstanceIdsAssociation", &ssm.AssociationArgs{
AssociationName: pulumi.String("UpdateSSMAgent"),
Name: pulumi.String("AWS-UpdateSSMAgent"),
ScheduleExpression: pulumi.String("cron(0 2 ? * SUN *)"),
Targets: []ssm.AssociationTargetArgs{
{
Key: pulumi.String("InstanceIds"),
Values: pulumi.StringArray{
pulumi.String("*"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
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=["*"],
)])
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: ["*"],
}],
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
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[]
{
"*",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "allInstanceIdsAssociation", &ssm.AssociationArgs{
AssociationName: pulumi.String("UpdateSSMAgent"),
Name: pulumi.String("AWS-UpdateSSMAgent"),
ScheduleExpression: pulumi.String("cron(0 2 ? * SUN *)"),
Targets: []ssm.AssociationTargetArgs{
{
Key: pulumi.String("InstanceIds"),
Values: pulumi.StringArray{
pulumi.String("*"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
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=["*"],
)])
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: ["*"],
}],
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
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",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "taggedInstancesAssociation", &ssm.AssociationArgs{
AssociationName: pulumi.String("UpdateSSMAgent"),
Name: pulumi.String("AWS-UpdateSSMAgent"),
ScheduleExpression: pulumi.String("rate(7 days)"),
Targets: []ssm.AssociationTargetArgs{
{
Key: pulumi.String("tag:Environment"),
Values: pulumi.StringArray{
pulumi.String("Production"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
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"],
)])
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"],
}],
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
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",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "taggedInstancesAssociation", &ssm.AssociationArgs{
AssociationName: pulumi.String("UpdateSSMAgent"),
Name: pulumi.String("AWS-UpdateSSMAgent"),
ScheduleExpression: pulumi.String("rate(7 days)"),
Targets: []ssm.AssociationTargetArgs{
{
Key: pulumi.String("tag:Environment"),
Values: pulumi.StringArray{
pulumi.String("Production"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
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"],
)])
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"],
}],
});
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:
- Apply
Only boolAt Cron Interval - Association
Name string The name of the association.
- Automation
Target stringParameter Name - Calendar
Names List<string> - Compliance
Severity Pulumi.Aws Native. Ssm. Association Compliance Severity - Document
Version string The version of the SSM document to associate with the target.
- Instance
Id string The ID of the instance that the SSM document is associated with.
- Max
Concurrency string - Max
Errors string - Name string
The name of the SSM document.
- Output
Location Pulumi.Aws Native. Ssm. Inputs. Association Instance Association Output Location - Parameters object
Parameter values that the SSM document uses at runtime.
- Schedule
Expression string A Cron or Rate expression that specifies when the association is applied to the target.
- Schedule
Offset int - Sync
Compliance Pulumi.Aws Native. Ssm. Association Sync Compliance - Targets
List<Pulumi.
Aws Native. Ssm. Inputs. Association Target> The targets that the SSM document sends commands to.
- Wait
For intSuccess Timeout Seconds
- Apply
Only boolAt Cron Interval - Association
Name string The name of the association.
- Automation
Target stringParameter Name - Calendar
Names []string - Compliance
Severity AssociationCompliance Severity - Document
Version string The version of the SSM document to associate with the target.
- Instance
Id string The ID of the instance that the SSM document is associated with.
- Max
Concurrency string - Max
Errors string - Name string
The name of the SSM document.
- Output
Location AssociationInstance Association Output Location Args - Parameters interface{}
Parameter values that the SSM document uses at runtime.
- Schedule
Expression string A Cron or Rate expression that specifies when the association is applied to the target.
- Schedule
Offset int - Sync
Compliance AssociationSync Compliance - Targets
[]Association
Target Args The targets that the SSM document sends commands to.
- Wait
For intSuccess Timeout Seconds
- apply
Only BooleanAt Cron Interval - association
Name String The name of the association.
- automation
Target StringParameter Name - calendar
Names List<String> - compliance
Severity AssociationCompliance Severity - document
Version String The version of the SSM document to associate with the target.
- instance
Id String The ID of the instance that the SSM document is associated with.
- max
Concurrency String - max
Errors String - name String
The name of the SSM document.
- output
Location AssociationInstance Association Output Location - parameters Object
Parameter values that the SSM document uses at runtime.
- schedule
Expression String A Cron or Rate expression that specifies when the association is applied to the target.
- schedule
Offset Integer - sync
Compliance AssociationSync Compliance - targets
List<Association
Target> The targets that the SSM document sends commands to.
- wait
For IntegerSuccess Timeout Seconds
- apply
Only booleanAt Cron Interval - association
Name string The name of the association.
- automation
Target stringParameter Name - calendar
Names string[] - compliance
Severity AssociationCompliance Severity - document
Version string The version of the SSM document to associate with the target.
- instance
Id string The ID of the instance that the SSM document is associated with.
- max
Concurrency string - max
Errors string - name string
The name of the SSM document.
- output
Location AssociationInstance Association Output Location - parameters any
Parameter values that the SSM document uses at runtime.
- schedule
Expression string A Cron or Rate expression that specifies when the association is applied to the target.
- schedule
Offset number - sync
Compliance AssociationSync Compliance - targets
Association
Target[] The targets that the SSM document sends commands to.
- wait
For numberSuccess Timeout Seconds
- apply_
only_ boolat_ cron_ interval - association_
name str The name of the association.
- automation_
target_ strparameter_ name - calendar_
names Sequence[str] - compliance_
severity AssociationCompliance Severity - 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 AssociationInstance Association Output Location Args - 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 AssociationSync Compliance - targets
Sequence[Association
Target Args] The targets that the SSM document sends commands to.
- wait_
for_ intsuccess_ timeout_ seconds
- apply
Only BooleanAt Cron Interval - association
Name String The name of the association.
- automation
Target StringParameter Name - calendar
Names List<String> - compliance
Severity "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "UNSPECIFIED" - document
Version String The version of the SSM document to associate with the target.
- instance
Id String The ID of the instance that the SSM document is associated with.
- max
Concurrency String - max
Errors String - name String
The name of the SSM document.
- output
Location Property Map - parameters Any
Parameter values that the SSM document uses at runtime.
- schedule
Expression String A Cron or Rate expression that specifies when the association is applied to the target.
- schedule
Offset Number - sync
Compliance "AUTO" | "MANUAL" - targets List<Property Map>
The targets that the SSM document sends commands to.
- wait
For NumberSuccess Timeout Seconds
Outputs
All input properties are implicitly available as output properties. Additionally, the Association resource produces the following output properties:
- Association
Id string Unique identifier of the association.
- Id string
The provider-assigned unique ID for this managed resource.
- Association
Id string Unique identifier of the association.
- Id string
The provider-assigned unique ID for this managed resource.
- association
Id String Unique identifier of the association.
- id String
The provider-assigned unique ID for this managed resource.
- association
Id 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.
- association
Id String Unique identifier of the association.
- id String
The provider-assigned unique ID for this managed resource.
Supporting Types
AssociationComplianceSeverity, AssociationComplianceSeverityArgs
- Critical
- CRITICAL
- High
- HIGH
- Medium
- MEDIUM
- Low
- LOW
- Unspecified
- UNSPECIFIED
- Association
Compliance Severity Critical - CRITICAL
- Association
Compliance Severity High - HIGH
- Association
Compliance Severity Medium - MEDIUM
- Association
Compliance Severity Low - LOW
- Association
Compliance Severity 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
- "CRITICAL"
- CRITICAL
- "HIGH"
- HIGH
- "MEDIUM"
- MEDIUM
- "LOW"
- LOW
- "UNSPECIFIED"
- UNSPECIFIED
AssociationInstanceAssociationOutputLocation, AssociationInstanceAssociationOutputLocationArgs
AssociationS3OutputLocation, AssociationS3OutputLocationArgs
- Output
S3Bucket stringName - Output
S3Key stringPrefix - Output
S3Region string
- Output
S3Bucket stringName - Output
S3Key stringPrefix - Output
S3Region string
- output
S3Bucket StringName - output
S3Key StringPrefix - output
S3Region String
- output
S3Bucket stringName - output
S3Key stringPrefix - output
S3Region string
- output
S3Bucket StringName - output
S3Key StringPrefix - output
S3Region String
AssociationSyncCompliance, AssociationSyncComplianceArgs
- Auto
- AUTO
- Manual
- MANUAL
- Association
Sync Compliance Auto - AUTO
- Association
Sync Compliance Manual - MANUAL
- Auto
- AUTO
- Manual
- MANUAL
- Auto
- AUTO
- Manual
- MANUAL
- AUTO
- AUTO
- MANUAL
- MANUAL
- "AUTO"
- AUTO
- "MANUAL"
- MANUAL
AssociationTarget, AssociationTargetArgs
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
AWS Native is in preview. AWS Classic is fully supported.