Class CfnAssociation

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:25.115Z") @Stability(Stable) public class CfnAssociation extends CfnResource implements IInspectable
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.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ssm.*;
 Object parameters;
 CfnAssociation cfnAssociation = CfnAssociation.Builder.create(this, "MyCfnAssociation")
         .name("name")
         // the properties below are optional
         .applyOnlyAtCronInterval(false)
         .associationName("associationName")
         .automationTargetParameterName("automationTargetParameterName")
         .calendarNames(List.of("calendarNames"))
         .complianceSeverity("complianceSeverity")
         .documentVersion("documentVersion")
         .instanceId("instanceId")
         .maxConcurrency("maxConcurrency")
         .maxErrors("maxErrors")
         .outputLocation(InstanceAssociationOutputLocationProperty.builder()
                 .s3Location(S3OutputLocationProperty.builder()
                         .outputS3BucketName("outputS3BucketName")
                         .outputS3KeyPrefix("outputS3KeyPrefix")
                         .outputS3Region("outputS3Region")
                         .build())
                 .build())
         .parameters(parameters)
         .scheduleExpression("scheduleExpression")
         .scheduleOffset(123)
         .syncCompliance("syncCompliance")
         .targets(List.of(TargetProperty.builder()
                 .key("key")
                 .values(List.of("values"))
                 .build()))
         .waitForSuccessTimeoutSeconds(123)
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAssociation

      protected CfnAssociation(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAssociation

      protected CfnAssociation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAssociation

      @Stability(Stable) public CfnAssociation(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAssociationProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAssociationId

      @Stability(Stable) @NotNull public String getAttrAssociationId()
      The association ID.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the SSM document that contains the configuration information for the instance.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the SSM document that contains the configuration information for the instance.
    • getApplyOnlyAtCronInterval

      @Stability(Stable) @Nullable public Object getApplyOnlyAtCronInterval()
      By default, when you create a new association, the system runs it immediately after it is created and then according to the schedule you specified.
    • setApplyOnlyAtCronInterval

      @Stability(Stable) public void setApplyOnlyAtCronInterval(@Nullable Boolean value)
      By default, when you create a new association, the system runs it immediately after it is created and then according to the schedule you specified.
    • setApplyOnlyAtCronInterval

      @Stability(Stable) public void setApplyOnlyAtCronInterval(@Nullable IResolvable value)
      By default, when you create a new association, the system runs it immediately after it is created and then according to the schedule you specified.
    • getAssociationName

      @Stability(Stable) @Nullable public String getAssociationName()
      Specify a descriptive name for the association.
    • setAssociationName

      @Stability(Stable) public void setAssociationName(@Nullable String value)
      Specify a descriptive name for the association.
    • getAutomationTargetParameterName

      @Stability(Stable) @Nullable public String getAutomationTargetParameterName()
      Choose the parameter that will define how your automation will branch out.
    • setAutomationTargetParameterName

      @Stability(Stable) public void setAutomationTargetParameterName(@Nullable String value)
      Choose the parameter that will define how your automation will branch out.
    • getCalendarNames

      @Stability(Stable) @Nullable public List<String> getCalendarNames()
      The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under.
    • setCalendarNames

      @Stability(Stable) public void setCalendarNames(@Nullable List<String> value)
      The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under.
    • getComplianceSeverity

      @Stability(Stable) @Nullable public String getComplianceSeverity()
      The severity level that is assigned to the association.
    • setComplianceSeverity

      @Stability(Stable) public void setComplianceSeverity(@Nullable String value)
      The severity level that is assigned to the association.
    • getDocumentVersion

      @Stability(Stable) @Nullable public String getDocumentVersion()
      The version of the SSM document to associate with the target.
    • setDocumentVersion

      @Stability(Stable) public void setDocumentVersion(@Nullable String value)
      The version of the SSM document to associate with the target.
    • getInstanceId

      @Stability(Stable) @Nullable public String getInstanceId()
      The ID of the instance that the SSM document is associated with.
    • setInstanceId

      @Stability(Stable) public void setInstanceId(@Nullable String value)
      The ID of the instance that the SSM document is associated with.
    • getMaxConcurrency

      @Stability(Stable) @Nullable public String getMaxConcurrency()
      The maximum number of targets allowed to run the association at the same time.
    • setMaxConcurrency

      @Stability(Stable) public void setMaxConcurrency(@Nullable String value)
      The maximum number of targets allowed to run the association at the same time.
    • getMaxErrors

      @Stability(Stable) @Nullable public String getMaxErrors()
      The number of errors that are allowed before the system stops sending requests to run the association on additional targets.
    • setMaxErrors

      @Stability(Stable) public void setMaxErrors(@Nullable String value)
      The number of errors that are allowed before the system stops sending requests to run the association on additional targets.
    • getOutputLocation

      @Stability(Stable) @Nullable public Object getOutputLocation()
      An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.
    • setOutputLocation

      @Stability(Stable) public void setOutputLocation(@Nullable IResolvable value)
      An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.
    • setOutputLocation

      @Stability(Stable) public void setOutputLocation(@Nullable CfnAssociation.InstanceAssociationOutputLocationProperty value)
      An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.
    • getParameters

      @Stability(Stable) @Nullable public Object getParameters()
      The parameters for the runtime configuration of the document.
    • setParameters

      @Stability(Stable) public void setParameters(@Nullable Object value)
      The parameters for the runtime configuration of the document.
    • getScheduleExpression

      @Stability(Stable) @Nullable public String getScheduleExpression()
      A cron expression that specifies a schedule when the association runs.
    • setScheduleExpression

      @Stability(Stable) public void setScheduleExpression(@Nullable String value)
      A cron expression that specifies a schedule when the association runs.
    • getScheduleOffset

      @Stability(Stable) @Nullable public Number getScheduleOffset()
      Number of days to wait after the scheduled day to run an association.
    • setScheduleOffset

      @Stability(Stable) public void setScheduleOffset(@Nullable Number value)
      Number of days to wait after the scheduled day to run an association.
    • getSyncCompliance

      @Stability(Stable) @Nullable public String getSyncCompliance()
      The mode for generating association compliance.
    • setSyncCompliance

      @Stability(Stable) public void setSyncCompliance(@Nullable String value)
      The mode for generating association compliance.
    • getTargets

      @Stability(Stable) @Nullable public Object getTargets()
      The targets for the association.
    • setTargets

      @Stability(Stable) public void setTargets(@Nullable IResolvable value)
      The targets for the association.
    • setTargets

      @Stability(Stable) public void setTargets(@Nullable List<Object> value)
      The targets for the association.
    • getWaitForSuccessTimeoutSeconds

      @Stability(Stable) @Nullable public Number getWaitForSuccessTimeoutSeconds()
      The number of seconds the service should wait for the association status to show "Success" before proceeding with the stack execution.
    • setWaitForSuccessTimeoutSeconds

      @Stability(Stable) public void setWaitForSuccessTimeoutSeconds(@Nullable Number value)
      The number of seconds the service should wait for the association status to show "Success" before proceeding with the stack execution.