CfnAssociationPropsMixin

class aws_cdk.mixins_preview.aws_ssm.mixins.CfnAssociationPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::SSM::Association resource creates a State Manager association for your managed instances.

A State Manager association defines the state that you want to maintain on your instances. For example, an association can specify that anti-virus software must be installed and running on your instances, or that certain ports must be closed. For static targets, the association specifies a schedule for when the configuration is reapplied. For dynamic targets, such as an AWS Resource Groups or an AWS Auto Scaling Group, State Manager applies the configuration when new instances are added to the group. The association also specifies actions to take when applying the configuration. For example, an association for anti-virus software might run once a day. If the software is not installed, then State Manager installs it. If the software is installed, but the service is not running, then the association might instruct State Manager to start the service.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-association.html

CloudformationResource:

AWS::SSM::Association

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_ssm import mixins as ssm_mixins

# parameters: Any

cfn_association_props_mixin = ssm_mixins.CfnAssociationPropsMixin(ssm_mixins.CfnAssociationMixinProps(
    apply_only_at_cron_interval=False,
    association_name="associationName",
    automation_target_parameter_name="automationTargetParameterName",
    calendar_names=["calendarNames"],
    compliance_severity="complianceSeverity",
    document_version="documentVersion",
    instance_id="instanceId",
    max_concurrency="maxConcurrency",
    max_errors="maxErrors",
    name="name",
    output_location=ssm_mixins.CfnAssociationPropsMixin.InstanceAssociationOutputLocationProperty(
        s3_location=ssm_mixins.CfnAssociationPropsMixin.S3OutputLocationProperty(
            output_s3_bucket_name="outputS3BucketName",
            output_s3_key_prefix="outputS3KeyPrefix",
            output_s3_region="outputS3Region"
        )
    ),
    parameters=parameters,
    schedule_expression="scheduleExpression",
    schedule_offset=123,
    sync_compliance="syncCompliance",
    targets=[ssm_mixins.CfnAssociationPropsMixin.TargetProperty(
        key="key",
        values=["values"]
    )],
    wait_for_success_timeout_seconds=123
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::SSM::Association.

Parameters:
  • props (Union[CfnAssociationMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['applyOnlyAtCronInterval', 'associationName', 'automationTargetParameterName', 'calendarNames', 'complianceSeverity', 'documentVersion', 'instanceId', 'maxConcurrency', 'maxErrors', 'name', 'outputLocation', 'parameters', 'scheduleExpression', 'scheduleOffset', 'syncCompliance', 'targets', 'waitForSuccessTimeoutSeconds']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

InstanceAssociationOutputLocationProperty

class CfnAssociationPropsMixin.InstanceAssociationOutputLocationProperty(*, s3_location=None)

Bases: object

InstanceAssociationOutputLocation is a property of the AWS::SSM::Association resource that specifies an Amazon S3 bucket where you want to store the results of this association request.

For the minimal permissions required to enable Amazon S3 output for an association, see Creating associations in the Systems Manager User Guide .

Parameters:

s3_location (Union[IResolvable, S3OutputLocationProperty, Dict[str, Any], None]) – S3OutputLocation is a property of the InstanceAssociationOutputLocation property that specifies an Amazon S3 bucket where you want to store the results of this request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-instanceassociationoutputlocation.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_ssm import mixins as ssm_mixins

instance_association_output_location_property = ssm_mixins.CfnAssociationPropsMixin.InstanceAssociationOutputLocationProperty(
    s3_location=ssm_mixins.CfnAssociationPropsMixin.S3OutputLocationProperty(
        output_s3_bucket_name="outputS3BucketName",
        output_s3_key_prefix="outputS3KeyPrefix",
        output_s3_region="outputS3Region"
    )
)

Attributes

s3_location

S3OutputLocation is a property of the InstanceAssociationOutputLocation property that specifies an Amazon S3 bucket where you want to store the results of this request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-instanceassociationoutputlocation.html#cfn-ssm-association-instanceassociationoutputlocation-s3location

S3OutputLocationProperty

class CfnAssociationPropsMixin.S3OutputLocationProperty(*, output_s3_bucket_name=None, output_s3_key_prefix=None, output_s3_region=None)

Bases: object

S3OutputLocation is a property of the AWS::SSM::Association resource that specifies an Amazon S3 bucket where you want to store the results of this association request.

Parameters:
  • output_s3_bucket_name (Optional[str]) – The name of the S3 bucket.

  • output_s3_key_prefix (Optional[str]) – The S3 bucket subfolder.

  • output_s3_region (Optional[str]) – The AWS Region of the S3 bucket.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-s3outputlocation.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_ssm import mixins as ssm_mixins

s3_output_location_property = ssm_mixins.CfnAssociationPropsMixin.S3OutputLocationProperty(
    output_s3_bucket_name="outputS3BucketName",
    output_s3_key_prefix="outputS3KeyPrefix",
    output_s3_region="outputS3Region"
)

Attributes

output_s3_bucket_name

The name of the S3 bucket.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-s3outputlocation.html#cfn-ssm-association-s3outputlocation-outputs3bucketname

output_s3_key_prefix

The S3 bucket subfolder.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-s3outputlocation.html#cfn-ssm-association-s3outputlocation-outputs3keyprefix

output_s3_region

The AWS Region of the S3 bucket.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-s3outputlocation.html#cfn-ssm-association-s3outputlocation-outputs3region

TargetProperty

class CfnAssociationPropsMixin.TargetProperty(*, key=None, values=None)

Bases: object

Target is a property of the AWS::SSM::Association resource that specifies the targets for an SSM document in Systems Manager . You can target all instances in an AWS account by specifying the InstanceIds key with a value of * . To view a JSON and a YAML example that targets all instances, see the example “Create an association for all managed instances in an AWS account “ later in this page.

Parameters:
  • key (Optional[str]) – User-defined criteria for sending commands that target managed nodes that meet the criteria.

  • values (Optional[Sequence[str]]) – User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer . Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-target.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_ssm import mixins as ssm_mixins

target_property = ssm_mixins.CfnAssociationPropsMixin.TargetProperty(
    key="key",
    values=["values"]
)

Attributes

key

User-defined criteria for sending commands that target managed nodes that meet the criteria.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-target.html#cfn-ssm-association-target-key

values

User-defined criteria that maps to Key .

For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-target.html#cfn-ssm-association-target-values