Class CfnPolicyAssociation

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

@Generated(value="jsii-pacmak/1.125.0 (build fdbe357)", date="2026-01-23T11:19:54.799Z") @Stability(Stable) public class CfnPolicyAssociation extends CfnResource implements IInspectable, IPolicyAssociationRef
The AWS::SecurityHub::PolicyAssociation resource specifies associations for a configuration policy or a self-managed configuration.

You can associate a AWS Security Hub CSPM configuration policy or self-managed configuration with the organization root, organizational units (OUs), or AWS accounts . After a successful association, the configuration policy takes effect in the specified targets. For more information, see Creating and associating Security Hub CSPM configuration policies in the AWS Security Hub CSPM User Guide .

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.securityhub.*;
 CfnPolicyAssociation cfnPolicyAssociation = CfnPolicyAssociation.Builder.create(this, "MyCfnPolicyAssociation")
         .configurationPolicyId("configurationPolicyId")
         .targetId("targetId")
         .targetType("targetType")
         .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

    • CfnPolicyAssociation

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

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

      @Stability(Stable) public CfnPolicyAssociation(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnPolicyAssociationProps props)
      Create a new AWS::SecurityHub::PolicyAssociation.

      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

    • isCfnPolicyAssociation

      @Stability(Stable) @NotNull public static Boolean isCfnPolicyAssociation(@NotNull Object x)
      Checks whether the given object is a CfnPolicyAssociation.

      Parameters:
      x - This parameter is required.
    • 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.
    • getAttrAssociationIdentifier

      @Stability(Stable) @NotNull public String getAttrAssociationIdentifier()
      The association identifier, formatted as TargetType/TargetId .

      For example, ACCOUNT/123456789012 .

    • getAttrAssociationStatus

      @Stability(Stable) @NotNull public String getAttrAssociationStatus()
      The current status of the association between the specified target and the configuration.
    • getAttrAssociationStatusMessage

      @Stability(Stable) @NotNull public String getAttrAssociationStatusMessage()
      The explanation for a FAILED value for AssociationStatus .
    • getAttrAssociationType

      @Stability(Stable) @NotNull public String getAttrAssociationType()
      Indicates whether the association between the specified target and the configuration was directly applied by the AWS Security Hub CSPM delegated administrator or inherited from a parent.
    • getAttrUpdatedAt

      @Stability(Stable) @NotNull public String getAttrUpdatedAt()
      The date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public PolicyAssociationReference getPolicyAssociationRef()
      A reference to a PolicyAssociation resource.
      Specified by:
      getPolicyAssociationRef in interface IPolicyAssociationRef
    • getConfigurationPolicyId

      @Stability(Stable) @NotNull public String getConfigurationPolicyId()
      The universally unique identifier (UUID) of the configuration policy.
    • setConfigurationPolicyId

      @Stability(Stable) public void setConfigurationPolicyId(@NotNull String value)
      The universally unique identifier (UUID) of the configuration policy.
    • getTargetId

      @Stability(Stable) @NotNull public String getTargetId()
      The identifier of the target account, organizational unit, or the root.
    • setTargetId

      @Stability(Stable) public void setTargetId(@NotNull String value)
      The identifier of the target account, organizational unit, or the root.
    • getTargetType

      @Stability(Stable) @NotNull public String getTargetType()
      Specifies whether the target is an AWS account , organizational unit, or the root.
    • setTargetType

      @Stability(Stable) public void setTargetType(@NotNull String value)
      Specifies whether the target is an AWS account , organizational unit, or the root.