Try AWS Native preview for resources not in the classic version.
aws.ssm.Association
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Associates an SSM Document to an instance or EC2 tag.
Example Usage
Create an association for a specific instance
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ssm.Association("example", {
name: exampleAwsSsmDocument.name,
targets: [{
key: "InstanceIds",
values: [exampleAwsInstance.id],
}],
});
import pulumi
import pulumi_aws as aws
example = aws.ssm.Association("example",
name=example_aws_ssm_document["name"],
targets=[{
"key": "InstanceIds",
"values": [example_aws_instance["id"]],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
Name: pulumi.Any(exampleAwsSsmDocument.Name),
Targets: ssm.AssociationTargetArray{
&ssm.AssociationTargetArgs{
Key: pulumi.String("InstanceIds"),
Values: pulumi.StringArray{
exampleAwsInstance.Id,
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ssm.Association("example", new()
{
Name = exampleAwsSsmDocument.Name,
Targets = new[]
{
new Aws.Ssm.Inputs.AssociationTargetArgs
{
Key = "InstanceIds",
Values = new[]
{
exampleAwsInstance.Id,
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ssm.Association;
import com.pulumi.aws.ssm.AssociationArgs;
import com.pulumi.aws.ssm.inputs.AssociationTargetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Association("example", AssociationArgs.builder()
.name(exampleAwsSsmDocument.name())
.targets(AssociationTargetArgs.builder()
.key("InstanceIds")
.values(exampleAwsInstance.id())
.build())
.build());
}
}
resources:
example:
type: aws:ssm:Association
properties:
name: ${exampleAwsSsmDocument.name}
targets:
- key: InstanceIds
values:
- ${exampleAwsInstance.id}
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
.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ssm.Association("example", {
name: "AmazonCloudWatch-ManageAgent",
targets: [{
key: "InstanceIds",
values: ["*"],
}],
});
import pulumi
import pulumi_aws as aws
example = aws.ssm.Association("example",
name="AmazonCloudWatch-ManageAgent",
targets=[{
"key": "InstanceIds",
"values": ["*"],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
Name: pulumi.String("AmazonCloudWatch-ManageAgent"),
Targets: ssm.AssociationTargetArray{
&ssm.AssociationTargetArgs{
Key: pulumi.String("InstanceIds"),
Values: pulumi.StringArray{
pulumi.String("*"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ssm.Association("example", new()
{
Name = "AmazonCloudWatch-ManageAgent",
Targets = new[]
{
new Aws.Ssm.Inputs.AssociationTargetArgs
{
Key = "InstanceIds",
Values = new[]
{
"*",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ssm.Association;
import com.pulumi.aws.ssm.AssociationArgs;
import com.pulumi.aws.ssm.inputs.AssociationTargetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Association("example", AssociationArgs.builder()
.name("AmazonCloudWatch-ManageAgent")
.targets(AssociationTargetArgs.builder()
.key("InstanceIds")
.values("*")
.build())
.build());
}
}
resources:
example:
type: aws:ssm:Association
properties:
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
.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ssm.Association("example", {
name: "AmazonCloudWatch-ManageAgent",
targets: [{
key: "tag:Environment",
values: ["Development"],
}],
});
import pulumi
import pulumi_aws as aws
example = aws.ssm.Association("example",
name="AmazonCloudWatch-ManageAgent",
targets=[{
"key": "tag:Environment",
"values": ["Development"],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
Name: pulumi.String("AmazonCloudWatch-ManageAgent"),
Targets: ssm.AssociationTargetArray{
&ssm.AssociationTargetArgs{
Key: pulumi.String("tag:Environment"),
Values: pulumi.StringArray{
pulumi.String("Development"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ssm.Association("example", new()
{
Name = "AmazonCloudWatch-ManageAgent",
Targets = new[]
{
new Aws.Ssm.Inputs.AssociationTargetArgs
{
Key = "tag:Environment",
Values = new[]
{
"Development",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ssm.Association;
import com.pulumi.aws.ssm.AssociationArgs;
import com.pulumi.aws.ssm.inputs.AssociationTargetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Association("example", AssociationArgs.builder()
.name("AmazonCloudWatch-ManageAgent")
.targets(AssociationTargetArgs.builder()
.key("tag:Environment")
.values("Development")
.build())
.build());
}
}
resources:
example:
type: aws:ssm:Association
properties:
name: AmazonCloudWatch-ManageAgent
targets:
- key: tag:Environment
values:
- Development
Create an association with a specific schedule
This example shows how to schedule an association in various ways.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ssm.Association("example", {
name: exampleAwsSsmDocument.name,
scheduleExpression: "cron(0 2 ? * SUN *)",
targets: [{
key: "InstanceIds",
values: [exampleAwsInstance.id],
}],
});
import pulumi
import pulumi_aws as aws
example = aws.ssm.Association("example",
name=example_aws_ssm_document["name"],
schedule_expression="cron(0 2 ? * SUN *)",
targets=[{
"key": "InstanceIds",
"values": [example_aws_instance["id"]],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
Name: pulumi.Any(exampleAwsSsmDocument.Name),
ScheduleExpression: pulumi.String("cron(0 2 ? * SUN *)"),
Targets: ssm.AssociationTargetArray{
&ssm.AssociationTargetArgs{
Key: pulumi.String("InstanceIds"),
Values: pulumi.StringArray{
exampleAwsInstance.Id,
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ssm.Association("example", new()
{
Name = exampleAwsSsmDocument.Name,
ScheduleExpression = "cron(0 2 ? * SUN *)",
Targets = new[]
{
new Aws.Ssm.Inputs.AssociationTargetArgs
{
Key = "InstanceIds",
Values = new[]
{
exampleAwsInstance.Id,
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ssm.Association;
import com.pulumi.aws.ssm.AssociationArgs;
import com.pulumi.aws.ssm.inputs.AssociationTargetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Association("example", AssociationArgs.builder()
.name(exampleAwsSsmDocument.name())
.scheduleExpression("cron(0 2 ? * SUN *)")
.targets(AssociationTargetArgs.builder()
.key("InstanceIds")
.values(exampleAwsInstance.id())
.build())
.build());
}
}
resources:
example:
type: aws:ssm:Association
properties:
name: ${exampleAwsSsmDocument.name}
scheduleExpression: cron(0 2 ? * SUN *)
targets:
- key: InstanceIds
values:
- ${exampleAwsInstance.id}
Create Association Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Association(name: string, args?: AssociationArgs, opts?: CustomResourceOptions);
@overload
def Association(resource_name: str,
args: Optional[AssociationArgs] = None,
opts: Optional[ResourceOptions] = None)
@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,
compliance_severity: Optional[str] = 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[AssociationOutputLocationArgs] = None,
parameters: Optional[Mapping[str, str]] = None,
schedule_expression: Optional[str] = None,
sync_compliance: Optional[str] = None,
targets: Optional[Sequence[AssociationTargetArgs]] = None,
wait_for_success_timeout_seconds: Optional[int] = 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:ssm:Association
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var awsAssociationResource = new Aws.Ssm.Association("awsAssociationResource", new()
{
ApplyOnlyAtCronInterval = false,
AssociationName = "string",
AutomationTargetParameterName = "string",
ComplianceSeverity = "string",
DocumentVersion = "string",
MaxConcurrency = "string",
MaxErrors = "string",
Name = "string",
OutputLocation = new Aws.Ssm.Inputs.AssociationOutputLocationArgs
{
S3BucketName = "string",
S3KeyPrefix = "string",
S3Region = "string",
},
Parameters =
{
{ "string", "string" },
},
ScheduleExpression = "string",
SyncCompliance = "string",
Targets = new[]
{
new Aws.Ssm.Inputs.AssociationTargetArgs
{
Key = "string",
Values = new[]
{
"string",
},
},
},
WaitForSuccessTimeoutSeconds = 0,
});
example, err := ssm.NewAssociation(ctx, "awsAssociationResource", &ssm.AssociationArgs{
ApplyOnlyAtCronInterval: pulumi.Bool(false),
AssociationName: pulumi.String("string"),
AutomationTargetParameterName: pulumi.String("string"),
ComplianceSeverity: pulumi.String("string"),
DocumentVersion: pulumi.String("string"),
MaxConcurrency: pulumi.String("string"),
MaxErrors: pulumi.String("string"),
Name: pulumi.String("string"),
OutputLocation: &ssm.AssociationOutputLocationArgs{
S3BucketName: pulumi.String("string"),
S3KeyPrefix: pulumi.String("string"),
S3Region: pulumi.String("string"),
},
Parameters: pulumi.StringMap{
"string": pulumi.String("string"),
},
ScheduleExpression: pulumi.String("string"),
SyncCompliance: pulumi.String("string"),
Targets: ssm.AssociationTargetArray{
&ssm.AssociationTargetArgs{
Key: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
WaitForSuccessTimeoutSeconds: pulumi.Int(0),
})
var awsAssociationResource = new Association("awsAssociationResource", AssociationArgs.builder()
.applyOnlyAtCronInterval(false)
.associationName("string")
.automationTargetParameterName("string")
.complianceSeverity("string")
.documentVersion("string")
.maxConcurrency("string")
.maxErrors("string")
.name("string")
.outputLocation(AssociationOutputLocationArgs.builder()
.s3BucketName("string")
.s3KeyPrefix("string")
.s3Region("string")
.build())
.parameters(Map.of("string", "string"))
.scheduleExpression("string")
.syncCompliance("string")
.targets(AssociationTargetArgs.builder()
.key("string")
.values("string")
.build())
.waitForSuccessTimeoutSeconds(0)
.build());
aws_association_resource = aws.ssm.Association("awsAssociationResource",
apply_only_at_cron_interval=False,
association_name="string",
automation_target_parameter_name="string",
compliance_severity="string",
document_version="string",
max_concurrency="string",
max_errors="string",
name="string",
output_location={
"s3BucketName": "string",
"s3KeyPrefix": "string",
"s3Region": "string",
},
parameters={
"string": "string",
},
schedule_expression="string",
sync_compliance="string",
targets=[{
"key": "string",
"values": ["string"],
}],
wait_for_success_timeout_seconds=0)
const awsAssociationResource = new aws.ssm.Association("awsAssociationResource", {
applyOnlyAtCronInterval: false,
associationName: "string",
automationTargetParameterName: "string",
complianceSeverity: "string",
documentVersion: "string",
maxConcurrency: "string",
maxErrors: "string",
name: "string",
outputLocation: {
s3BucketName: "string",
s3KeyPrefix: "string",
s3Region: "string",
},
parameters: {
string: "string",
},
scheduleExpression: "string",
syncCompliance: "string",
targets: [{
key: "string",
values: ["string"],
}],
waitForSuccessTimeoutSeconds: 0,
});
type: aws:ssm:Association
properties:
applyOnlyAtCronInterval: false
associationName: string
automationTargetParameterName: string
complianceSeverity: string
documentVersion: string
maxConcurrency: string
maxErrors: string
name: string
outputLocation:
s3BucketName: string
s3KeyPrefix: string
s3Region: string
parameters:
string: string
scheduleExpression: string
syncCompliance: string
targets:
- key: string
values:
- string
waitForSuccessTimeoutSeconds: 0
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 - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - Association
Name string - The descriptive name for the association.
- Automation
Target stringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - Compliance
Severity string - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- Document
Version string - The document version you want to associate with the target(s). Can be a specific version or the default version.
- Instance
Id string - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - Max
Concurrency string - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- Max
Errors string - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- Name string
- The name of the SSM document to apply.
- Output
Location AssociationOutput Location - An output location block. Output Location is documented below.
- Parameters Dictionary<string, string>
- A block of arbitrary string parameters to pass to the SSM document.
- Schedule
Expression string - A cron or rate expression that specifies when the association runs.
- Sync
Compliance string - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - Targets
List<Association
Target> - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- Wait
For intSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- Apply
Only boolAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - Association
Name string - The descriptive name for the association.
- Automation
Target stringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - Compliance
Severity string - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- Document
Version string - The document version you want to associate with the target(s). Can be a specific version or the default version.
- Instance
Id string - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - Max
Concurrency string - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- Max
Errors string - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- Name string
- The name of the SSM document to apply.
- Output
Location AssociationOutput Location Args - An output location block. Output Location is documented below.
- Parameters map[string]string
- A block of arbitrary string parameters to pass to the SSM document.
- Schedule
Expression string - A cron or rate expression that specifies when the association runs.
- Sync
Compliance string - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - Targets
[]Association
Target Args - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- Wait
For intSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply
Only BooleanAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - association
Name String - The descriptive name for the association.
- automation
Target StringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance
Severity String - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document
Version String - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance
Id String - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max
Concurrency String - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max
Errors String - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name String
- The name of the SSM document to apply.
- output
Location AssociationOutput Location - An output location block. Output Location is documented below.
- parameters Map<String,String>
- A block of arbitrary string parameters to pass to the SSM document.
- schedule
Expression String - A cron or rate expression that specifies when the association runs.
- sync
Compliance String - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets
List<Association
Target> - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait
For IntegerSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply
Only booleanAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - association
Name string - The descriptive name for the association.
- automation
Target stringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance
Severity string - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document
Version string - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance
Id string - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max
Concurrency string - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max
Errors string - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name string
- The name of the SSM document to apply.
- output
Location AssociationOutput Location - An output location block. Output Location is documented below.
- parameters {[key: string]: string}
- A block of arbitrary string parameters to pass to the SSM document.
- schedule
Expression string - A cron or rate expression that specifies when the association runs.
- sync
Compliance string - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets
Association
Target[] - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait
For numberSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply_
only_ boolat_ cron_ interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - association_
name str - The descriptive name for the association.
- automation_
target_ strparameter_ name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance_
severity str - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document_
version str - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance_
id str - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max_
concurrency str - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max_
errors str - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name str
- The name of the SSM document to apply.
- output_
location AssociationOutput Location Args - An output location block. Output Location is documented below.
- parameters Mapping[str, str]
- A block of arbitrary string parameters to pass to the SSM document.
- schedule_
expression str - A cron or rate expression that specifies when the association runs.
- sync_
compliance str - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets
Sequence[Association
Target Args] - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait_
for_ intsuccess_ timeout_ seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply
Only BooleanAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - association
Name String - The descriptive name for the association.
- automation
Target StringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance
Severity String - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document
Version String - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance
Id String - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max
Concurrency String - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max
Errors String - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name String
- The name of the SSM document to apply.
- output
Location Property Map - An output location block. Output Location is documented below.
- parameters Map<String>
- A block of arbitrary string parameters to pass to the SSM document.
- schedule
Expression String - A cron or rate expression that specifies when the association runs.
- sync
Compliance String - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets List<Property Map>
- A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait
For NumberSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
Outputs
All input properties are implicitly available as output properties. Additionally, the Association resource produces the following output properties:
- Arn string
- The ARN of the SSM association
- Association
Id string - The ID of the SSM association.
- Id string
- The provider-assigned unique ID for this managed resource.
- Arn string
- The ARN of the SSM association
- Association
Id string - The ID of the SSM association.
- Id string
- The provider-assigned unique ID for this managed resource.
- arn String
- The ARN of the SSM association
- association
Id String - The ID of the SSM association.
- id String
- The provider-assigned unique ID for this managed resource.
- arn string
- The ARN of the SSM association
- association
Id string - The ID of the SSM association.
- id string
- The provider-assigned unique ID for this managed resource.
- arn str
- The ARN of the SSM association
- association_
id str - The ID of the SSM association.
- id str
- The provider-assigned unique ID for this managed resource.
- arn String
- The ARN of the SSM association
- association
Id String - The ID of the SSM association.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Association Resource
Get an existing Association resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AssociationState, opts?: CustomResourceOptions): Association
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
apply_only_at_cron_interval: Optional[bool] = None,
arn: Optional[str] = None,
association_id: Optional[str] = None,
association_name: Optional[str] = None,
automation_target_parameter_name: Optional[str] = None,
compliance_severity: Optional[str] = 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[AssociationOutputLocationArgs] = None,
parameters: Optional[Mapping[str, str]] = None,
schedule_expression: Optional[str] = None,
sync_compliance: Optional[str] = None,
targets: Optional[Sequence[AssociationTargetArgs]] = None,
wait_for_success_timeout_seconds: Optional[int] = None) -> Association
func GetAssociation(ctx *Context, name string, id IDInput, state *AssociationState, opts ...ResourceOption) (*Association, error)
public static Association Get(string name, Input<string> id, AssociationState? state, CustomResourceOptions? opts = null)
public static Association get(String name, Output<String> id, AssociationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Apply
Only boolAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - Arn string
- The ARN of the SSM association
- Association
Id string - The ID of the SSM association.
- Association
Name string - The descriptive name for the association.
- Automation
Target stringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - Compliance
Severity string - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- Document
Version string - The document version you want to associate with the target(s). Can be a specific version or the default version.
- Instance
Id string - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - Max
Concurrency string - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- Max
Errors string - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- Name string
- The name of the SSM document to apply.
- Output
Location AssociationOutput Location - An output location block. Output Location is documented below.
- Parameters Dictionary<string, string>
- A block of arbitrary string parameters to pass to the SSM document.
- Schedule
Expression string - A cron or rate expression that specifies when the association runs.
- Sync
Compliance string - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - Targets
List<Association
Target> - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- Wait
For intSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- Apply
Only boolAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - Arn string
- The ARN of the SSM association
- Association
Id string - The ID of the SSM association.
- Association
Name string - The descriptive name for the association.
- Automation
Target stringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - Compliance
Severity string - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- Document
Version string - The document version you want to associate with the target(s). Can be a specific version or the default version.
- Instance
Id string - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - Max
Concurrency string - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- Max
Errors string - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- Name string
- The name of the SSM document to apply.
- Output
Location AssociationOutput Location Args - An output location block. Output Location is documented below.
- Parameters map[string]string
- A block of arbitrary string parameters to pass to the SSM document.
- Schedule
Expression string - A cron or rate expression that specifies when the association runs.
- Sync
Compliance string - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - Targets
[]Association
Target Args - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- Wait
For intSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply
Only BooleanAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - arn String
- The ARN of the SSM association
- association
Id String - The ID of the SSM association.
- association
Name String - The descriptive name for the association.
- automation
Target StringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance
Severity String - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document
Version String - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance
Id String - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max
Concurrency String - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max
Errors String - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name String
- The name of the SSM document to apply.
- output
Location AssociationOutput Location - An output location block. Output Location is documented below.
- parameters Map<String,String>
- A block of arbitrary string parameters to pass to the SSM document.
- schedule
Expression String - A cron or rate expression that specifies when the association runs.
- sync
Compliance String - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets
List<Association
Target> - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait
For IntegerSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply
Only booleanAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - arn string
- The ARN of the SSM association
- association
Id string - The ID of the SSM association.
- association
Name string - The descriptive name for the association.
- automation
Target stringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance
Severity string - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document
Version string - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance
Id string - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max
Concurrency string - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max
Errors string - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name string
- The name of the SSM document to apply.
- output
Location AssociationOutput Location - An output location block. Output Location is documented below.
- parameters {[key: string]: string}
- A block of arbitrary string parameters to pass to the SSM document.
- schedule
Expression string - A cron or rate expression that specifies when the association runs.
- sync
Compliance string - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets
Association
Target[] - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait
For numberSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply_
only_ boolat_ cron_ interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - arn str
- The ARN of the SSM association
- association_
id str - The ID of the SSM association.
- association_
name str - The descriptive name for the association.
- automation_
target_ strparameter_ name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance_
severity str - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document_
version str - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance_
id str - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max_
concurrency str - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max_
errors str - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name str
- The name of the SSM document to apply.
- output_
location AssociationOutput Location Args - An output location block. Output Location is documented below.
- parameters Mapping[str, str]
- A block of arbitrary string parameters to pass to the SSM document.
- schedule_
expression str - A cron or rate expression that specifies when the association runs.
- sync_
compliance str - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets
Sequence[Association
Target Args] - A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait_
for_ intsuccess_ timeout_ seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
- apply
Only BooleanAt Cron Interval - By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default:
false
. - arn String
- The ARN of the SSM association
- association
Id String - The ID of the SSM association.
- association
Name String - The descriptive name for the association.
- automation
Target StringParameter Name - Specify the target for the association. This target is required for associations that use an
Automation
document and target resources by using rate controls. This should be set to the SSM documentparameter
that will define how your automation will branch out. - compliance
Severity String - The compliance severity for the association. Can be one of the following:
UNSPECIFIED
,LOW
,MEDIUM
,HIGH
orCRITICAL
- document
Version String - The document version you want to associate with the target(s). Can be a specific version or the default version.
- instance
Id String - The instance ID to apply an SSM document to. Use
targets
with keyInstanceIds
for document schema versions 2.0 and above. Use thetargets
attribute instead. - max
Concurrency String - The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
- max
Errors String - The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned.
- name String
- The name of the SSM document to apply.
- output
Location Property Map - An output location block. Output Location is documented below.
- parameters Map<String>
- A block of arbitrary string parameters to pass to the SSM document.
- schedule
Expression String - A cron or rate expression that specifies when the association runs.
- sync
Compliance String - The mode for generating association compliance. You can specify
AUTO
orMANUAL
. - targets List<Property Map>
- A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
- wait
For NumberSuccess Timeout Seconds The number of seconds to wait for the association status to be
Success
. IfSuccess
status is not reached within the given time, create opration will fail.Output Location (
output_location
) is an S3 bucket where you want to store the results of this association:
Supporting Types
AssociationOutputLocation, AssociationOutputLocationArgs
- S3Bucket
Name string - The S3 bucket name.
- S3Key
Prefix string - The S3 bucket prefix. Results stored in the root if not configured.
- S3Region string
The S3 bucket region.
Targets specify what instance IDs or tags to apply the document to and has these keys:
- S3Bucket
Name string - The S3 bucket name.
- S3Key
Prefix string - The S3 bucket prefix. Results stored in the root if not configured.
- S3Region string
The S3 bucket region.
Targets specify what instance IDs or tags to apply the document to and has these keys:
- s3Bucket
Name String - The S3 bucket name.
- s3Key
Prefix String - The S3 bucket prefix. Results stored in the root if not configured.
- s3Region String
The S3 bucket region.
Targets specify what instance IDs or tags to apply the document to and has these keys:
- s3Bucket
Name string - The S3 bucket name.
- s3Key
Prefix string - The S3 bucket prefix. Results stored in the root if not configured.
- s3Region string
The S3 bucket region.
Targets specify what instance IDs or tags to apply the document to and has these keys:
- s3_
bucket_ strname - The S3 bucket name.
- s3_
key_ strprefix - The S3 bucket prefix. Results stored in the root if not configured.
- s3_
region str The S3 bucket region.
Targets specify what instance IDs or tags to apply the document to and has these keys:
- s3Bucket
Name String - The S3 bucket name.
- s3Key
Prefix String - The S3 bucket prefix. Results stored in the root if not configured.
- s3Region String
The S3 bucket region.
Targets specify what instance IDs or tags to apply the document to and has these keys:
AssociationTarget, AssociationTargetArgs
Import
Using pulumi import
, import SSM associations using the association_id
. For example:
$ pulumi import aws:ssm/association:Association test-association 10abcdef-0abc-1234-5678-90abcdef123456
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.