1. Packages
  2. AWS Classic
  3. API Docs
  4. ssm
  5. Association

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi

aws.ssm.Association

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi

    Associates an SSM Document to an instance or EC2 tag.

    Example Usage

    Create an association for a specific instance

    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()
        {
            Targets = new[]
            {
                new Aws.Ssm.Inputs.AssociationTargetArgs
                {
                    Key = "InstanceIds",
                    Values = new[]
                    {
                        aws_instance.Example.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{
    			Targets: ssm.AssociationTargetArray{
    				&ssm.AssociationTargetArgs{
    					Key: pulumi.String("InstanceIds"),
    					Values: pulumi.StringArray{
    						aws_instance.Example.Id,
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()        
                .targets(AssociationTargetArgs.builder()
                    .key("InstanceIds")
                    .values(aws_instance.example().id())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ssm.Association("example", targets=[aws.ssm.AssociationTargetArgs(
        key="InstanceIds",
        values=[aws_instance["example"]["id"]],
    )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ssm.Association("example", {targets: [{
        key: "InstanceIds",
        values: [aws_instance.example.id],
    }]});
    
    resources:
      example:
        type: aws:ssm:Association
        properties:
          targets:
            - key: InstanceIds
              values:
                - ${aws_instance.example.id}
    

    Create an association for all managed instances in an AWS account

    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()
        {
            Targets = new[]
            {
                new Aws.Ssm.Inputs.AssociationTargetArgs
                {
                    Key = "InstanceIds",
                    Values = new[]
                    {
                        "*",
                    },
                },
            },
        });
    
    });
    
    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{
    			Targets: ssm.AssociationTargetArray{
    				&ssm.AssociationTargetArgs{
    					Key: pulumi.String("InstanceIds"),
    					Values: pulumi.StringArray{
    						pulumi.String("*"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()        
                .targets(AssociationTargetArgs.builder()
                    .key("InstanceIds")
                    .values("*")
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ssm.Association("example", targets=[aws.ssm.AssociationTargetArgs(
        key="InstanceIds",
        values=["*"],
    )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ssm.Association("example", {targets: [{
        key: "InstanceIds",
        values: ["*"],
    }]});
    
    resources:
      example:
        type: aws:ssm:Association
        properties:
          targets:
            - key: InstanceIds
              values:
                - '*'
    

    Create an association for a specific tag

    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()
        {
            Targets = new[]
            {
                new Aws.Ssm.Inputs.AssociationTargetArgs
                {
                    Key = "tag:Environment",
                    Values = new[]
                    {
                        "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{
    			Targets: ssm.AssociationTargetArray{
    				&ssm.AssociationTargetArgs{
    					Key: pulumi.String("tag:Environment"),
    					Values: pulumi.StringArray{
    						pulumi.String("Development"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()        
                .targets(AssociationTargetArgs.builder()
                    .key("tag:Environment")
                    .values("Development")
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ssm.Association("example", targets=[aws.ssm.AssociationTargetArgs(
        key="tag:Environment",
        values=["Development"],
    )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ssm.Association("example", {targets: [{
        key: "tag:Environment",
        values: ["Development"],
    }]});
    
    resources:
      example:
        type: aws:ssm:Association
        properties:
          targets:
            - key: tag:Environment
              values:
                - Development
    

    Create an association with a specific schedule

    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()
        {
            ScheduleExpression = "cron(0 2 ? * SUN *)",
            Targets = new[]
            {
                new Aws.Ssm.Inputs.AssociationTargetArgs
                {
                    Key = "InstanceIds",
                    Values = new[]
                    {
                        aws_instance.Example.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{
    			ScheduleExpression: pulumi.String("cron(0 2 ? * SUN *)"),
    			Targets: ssm.AssociationTargetArray{
    				&ssm.AssociationTargetArgs{
    					Key: pulumi.String("InstanceIds"),
    					Values: pulumi.StringArray{
    						aws_instance.Example.Id,
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()        
                .scheduleExpression("cron(0 2 ? * SUN *)")
                .targets(AssociationTargetArgs.builder()
                    .key("InstanceIds")
                    .values(aws_instance.example().id())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ssm.Association("example",
        schedule_expression="cron(0 2 ? * SUN *)",
        targets=[aws.ssm.AssociationTargetArgs(
            key="InstanceIds",
            values=[aws_instance["example"]["id"]],
        )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ssm.Association("example", {
        scheduleExpression: "cron(0 2 ? * SUN *)",
        targets: [{
            key: "InstanceIds",
            values: [aws_instance.example.id],
        }],
    });
    
    resources:
      example:
        type: aws:ssm:Association
        properties:
          # Cron expression example
          scheduleExpression: cron(0 2 ? * SUN *) # Rate expression example
          #   # schedule_expression = "rate(7 days)"
          targets:
            - key: InstanceIds
              values:
                - ${aws_instance.example.id}
    

    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,
                    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)
    @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: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

    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.

    AssociationName string

    The descriptive name for the association.

    AutomationTargetParameterName string

    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 document parameter that will define how your automation will branch out.

    ComplianceSeverity string

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    DocumentVersion string

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    InstanceId string

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    MaxConcurrency 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%.

    MaxErrors 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.

    OutputLocation AssociationOutputLocation

    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.

    ScheduleExpression string

    A cron or rate expression that specifies when the association runs.

    SyncCompliance string

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    Targets List<AssociationTarget>

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    WaitForSuccessTimeoutSeconds int

    The number of seconds to wait for the association status to be Success. If Success 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:

    ApplyOnlyAtCronInterval bool

    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.

    AssociationName string

    The descriptive name for the association.

    AutomationTargetParameterName string

    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 document parameter that will define how your automation will branch out.

    ComplianceSeverity string

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    DocumentVersion string

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    InstanceId string

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    MaxConcurrency 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%.

    MaxErrors 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.

    OutputLocation AssociationOutputLocationArgs

    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.

    ScheduleExpression string

    A cron or rate expression that specifies when the association runs.

    SyncCompliance string

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    Targets []AssociationTargetArgs

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    WaitForSuccessTimeoutSeconds int

    The number of seconds to wait for the association status to be Success. If Success 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:

    applyOnlyAtCronInterval Boolean

    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.

    associationName String

    The descriptive name for the association.

    automationTargetParameterName String

    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 document parameter that will define how your automation will branch out.

    complianceSeverity String

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    documentVersion String

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    instanceId String

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    maxConcurrency 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%.

    maxErrors 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.

    outputLocation AssociationOutputLocation

    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.

    scheduleExpression String

    A cron or rate expression that specifies when the association runs.

    syncCompliance String

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    targets List<AssociationTarget>

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    waitForSuccessTimeoutSeconds Integer

    The number of seconds to wait for the association status to be Success. If Success 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:

    applyOnlyAtCronInterval boolean

    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.

    associationName string

    The descriptive name for the association.

    automationTargetParameterName string

    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 document parameter that will define how your automation will branch out.

    complianceSeverity string

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    documentVersion string

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    instanceId string

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    maxConcurrency 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%.

    maxErrors 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.

    outputLocation AssociationOutputLocation

    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.

    scheduleExpression string

    A cron or rate expression that specifies when the association runs.

    syncCompliance string

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    targets AssociationTarget[]

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    waitForSuccessTimeoutSeconds number

    The number of seconds to wait for the association status to be Success. If Success 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_at_cron_interval bool

    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_parameter_name str

    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 document parameter 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 or CRITICAL

    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 key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    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 AssociationOutputLocationArgs

    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 or MANUAL.

    targets Sequence[AssociationTargetArgs]

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    wait_for_success_timeout_seconds int

    The number of seconds to wait for the association status to be Success. If Success 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:

    applyOnlyAtCronInterval Boolean

    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.

    associationName String

    The descriptive name for the association.

    automationTargetParameterName String

    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 document parameter that will define how your automation will branch out.

    complianceSeverity String

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    documentVersion String

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    instanceId String

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    maxConcurrency 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%.

    maxErrors 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.

    outputLocation 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.

    scheduleExpression String

    A cron or rate expression that specifies when the association runs.

    syncCompliance String

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    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.

    waitForSuccessTimeoutSeconds Number

    The number of seconds to wait for the association status to be Success. If Success 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

    AssociationId 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

    AssociationId 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

    associationId 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

    associationId 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

    associationId 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.
    The following state arguments are supported:
    ApplyOnlyAtCronInterval bool

    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

    AssociationId string

    The ID of the SSM association.

    AssociationName string

    The descriptive name for the association.

    AutomationTargetParameterName string

    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 document parameter that will define how your automation will branch out.

    ComplianceSeverity string

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    DocumentVersion string

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    InstanceId string

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    MaxConcurrency 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%.

    MaxErrors 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.

    OutputLocation AssociationOutputLocation

    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.

    ScheduleExpression string

    A cron or rate expression that specifies when the association runs.

    SyncCompliance string

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    Targets List<AssociationTarget>

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    WaitForSuccessTimeoutSeconds int

    The number of seconds to wait for the association status to be Success. If Success 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:

    ApplyOnlyAtCronInterval bool

    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

    AssociationId string

    The ID of the SSM association.

    AssociationName string

    The descriptive name for the association.

    AutomationTargetParameterName string

    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 document parameter that will define how your automation will branch out.

    ComplianceSeverity string

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    DocumentVersion string

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    InstanceId string

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    MaxConcurrency 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%.

    MaxErrors 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.

    OutputLocation AssociationOutputLocationArgs

    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.

    ScheduleExpression string

    A cron or rate expression that specifies when the association runs.

    SyncCompliance string

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    Targets []AssociationTargetArgs

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    WaitForSuccessTimeoutSeconds int

    The number of seconds to wait for the association status to be Success. If Success 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:

    applyOnlyAtCronInterval Boolean

    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

    associationId String

    The ID of the SSM association.

    associationName String

    The descriptive name for the association.

    automationTargetParameterName String

    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 document parameter that will define how your automation will branch out.

    complianceSeverity String

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    documentVersion String

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    instanceId String

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    maxConcurrency 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%.

    maxErrors 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.

    outputLocation AssociationOutputLocation

    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.

    scheduleExpression String

    A cron or rate expression that specifies when the association runs.

    syncCompliance String

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    targets List<AssociationTarget>

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    waitForSuccessTimeoutSeconds Integer

    The number of seconds to wait for the association status to be Success. If Success 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:

    applyOnlyAtCronInterval boolean

    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

    associationId string

    The ID of the SSM association.

    associationName string

    The descriptive name for the association.

    automationTargetParameterName string

    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 document parameter that will define how your automation will branch out.

    complianceSeverity string

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    documentVersion string

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    instanceId string

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    maxConcurrency 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%.

    maxErrors 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.

    outputLocation AssociationOutputLocation

    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.

    scheduleExpression string

    A cron or rate expression that specifies when the association runs.

    syncCompliance string

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    targets AssociationTarget[]

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    waitForSuccessTimeoutSeconds number

    The number of seconds to wait for the association status to be Success. If Success 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_at_cron_interval bool

    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_parameter_name str

    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 document parameter 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 or CRITICAL

    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 key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    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 AssociationOutputLocationArgs

    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 or MANUAL.

    targets Sequence[AssociationTargetArgs]

    A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.

    wait_for_success_timeout_seconds int

    The number of seconds to wait for the association status to be Success. If Success 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:

    applyOnlyAtCronInterval Boolean

    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

    associationId String

    The ID of the SSM association.

    associationName String

    The descriptive name for the association.

    automationTargetParameterName String

    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 document parameter that will define how your automation will branch out.

    complianceSeverity String

    The compliance severity for the association. Can be one of the following: UNSPECIFIED, LOW, MEDIUM, HIGH or CRITICAL

    documentVersion String

    The document version you want to associate with the target(s). Can be a specific version or the default version.

    instanceId String

    The instance ID to apply an SSM document to. Use targets with key InstanceIds for document schema versions 2.0 and above. Use the targets attribute instead.

    Deprecated:

    use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId

    maxConcurrency 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%.

    maxErrors 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.

    outputLocation 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.

    scheduleExpression String

    A cron or rate expression that specifies when the association runs.

    syncCompliance String

    The mode for generating association compliance. You can specify AUTO or MANUAL.

    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.

    waitForSuccessTimeoutSeconds Number

    The number of seconds to wait for the association status to be Success. If Success 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

    S3BucketName string

    The S3 bucket name.

    S3KeyPrefix 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:

    S3BucketName string

    The S3 bucket name.

    S3KeyPrefix 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:

    s3BucketName String

    The S3 bucket name.

    s3KeyPrefix 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:

    s3BucketName string

    The S3 bucket name.

    s3KeyPrefix 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_name str

    The S3 bucket name.

    s3_key_prefix str

    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:

    s3BucketName String

    The S3 bucket name.

    s3KeyPrefix 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

    Key string

    Either InstanceIds or tag:Tag Name to specify an EC2 tag.

    Values List<string>

    A list of instance IDs or tag values. AWS currently limits this list size to one value.

    Key string

    Either InstanceIds or tag:Tag Name to specify an EC2 tag.

    Values []string

    A list of instance IDs or tag values. AWS currently limits this list size to one value.

    key String

    Either InstanceIds or tag:Tag Name to specify an EC2 tag.

    values List<String>

    A list of instance IDs or tag values. AWS currently limits this list size to one value.

    key string

    Either InstanceIds or tag:Tag Name to specify an EC2 tag.

    values string[]

    A list of instance IDs or tag values. AWS currently limits this list size to one value.

    key str

    Either InstanceIds or tag:Tag Name to specify an EC2 tag.

    values Sequence[str]

    A list of instance IDs or tag values. AWS currently limits this list size to one value.

    key String

    Either InstanceIds or tag:Tag Name to specify an EC2 tag.

    values List<String>

    A list of instance IDs or tag values. AWS currently limits this list size to one value.

    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
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi