Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::SSM::Association

The AWS::SSM::Association resource associates an Amazon EC2 Systems Manager (SSM) document with EC2 instances that contain a configuration agent to process the document.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

Copy
{ "Type" : "AWS::SSM::Association", "Properties" : { "DocumentVersion" : String, "InstanceId" : String, "Name" : String, "Parameters" : { String: [String, ...] }, "ScheduleExpression" : String, "Targets" : [ Targets ] } }

YAML

Copy
Type: "AWS::SSM::Association" Properties: DocumentVersion: String InstanceId: String Name: String Parameters: String: - String ScheduleExpression: String Targets: - Targets

Properties

DocumentVersion

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

Required: No

Type: String

Update requires: No interruption

InstanceId

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

Required: Conditional. You must specify the InstanceId or Targets property.

Type: String

Update requires: Replacement

Name

The name of the SSM document.

Required: Yes

Type: String

Update requires: Replacement

Parameters

Parameter values that the SSM document uses at runtime.

Required: No

Type: String to list-of-strings map

Update requires: No interruption

ScheduleExpression

A Cron expression that specifies when the association is applied to the target. For supported expressions, see the ScheduleExpression parameter for the CreateAssociation action in the Amazon EC2 Systems Manager API Reference.

Required: No

Type: String

Update requires: No interruption

Targets

The targets that the SSM document sends commands to.

Required: Conditional. You must specify the InstanceId or Targets property.

Type: List of Amazon EC2 Systems Manager Association Targets

Update requires: Replacement

Example

The following example associates an SSM document with a specific instance. The ID of the instance is specified by the myInstanceId parameter.

JSON

Copy
"association": { "Type": "AWS::SSM::Association", "Properties": { "Name": { "Ref": "document" }, "Parameters": { "Directory": ["myWorkSpace"] }, "Targets": [{ "Key": "InstanceIds", "Values": [{ "Ref": "myInstanceId" }] }] } }

YAML

Copy
association: Type: AWS::SSM::Association Properties: Name: !Ref 'document' Parameters: Directory: [FakeDirectory] Targets: - Key: InstanceIds Values: [!Ref 'myInstanceId']

On this page: