Skip to content

Commit

Permalink
Merge pull request #21120 from GlennChia/docs/ssm-association-target-…
Browse files Browse the repository at this point in the history
…all-instances

Docs/add note for ssm association to target all instances
  • Loading branch information
justinretzolk authored Oct 4, 2021
2 parents 3832715 + 49f3250 commit 488eca3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions website/docs/r/ssm_association.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Associates an SSM Document to an instance or EC2 tag.

## Example Usage

### Create an association for a specific instance

```terraform
resource "aws_ssm_association" "example" {
name = aws_ssm_document.example.name
Expand All @@ -23,6 +25,36 @@ resource "aws_ssm_association" "example" {
}
```

### Create an association for all managed instances in an AWS account

To target all managed instances in an AWS account, set the `key` as `"InstanceIds"` with `values` set as `["*"]`. This example also illustrates how to use an Amazon owned SSM document named `AmazonCloudWatch-ManageAgent`.

```terraform
resource "aws_ssm_association" "example" {
name = "AmazonCloudWatch-ManageAgent"
targets {
key = "InstanceIds"
values = ["*"]
}
}
```

### Create an association for a specific tag

This example shows how to target all managed instances that are assigned a tag key of `Environment` and value of `Development`.

```terraform
resource "aws_ssm_association" "example" {
name = "AmazonCloudWatch-ManageAgent"
targets {
key = "tag:Environment"
values = ["Development"]
}
}
```

## Argument Reference

The following arguments are supported:
Expand Down

0 comments on commit 488eca3

Please sign in to comment.