Class CfnProtectionPropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.shield.CfnProtectionPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:20:05.606Z") @Stability(Stable) public class CfnProtectionPropsMixin extends Mixin implements software.constructs.IMixin
Enables AWS Shield Advanced for a specific AWS resource.

The resource can be an Amazon CloudFront distribution, Amazon RouteĀ 53 hosted zone, AWS Global Accelerator standard accelerator, Elastic IP Address, Application Load Balancer, or a Classic Load Balancer. You can protect Amazon EC2 instances and Network Load Balancers by association with protected Amazon EC2 Elastic IP addresses.

Configure a single AWS::Shield::Protection

Use this protection to protect a single resource at a time.

To configure this Shield Advanced protection through CloudFormation , you must be subscribed to Shield Advanced . You can subscribe through the Shield Advanced console and through the APIs. For more information, see Subscribe to AWS Shield Advanced .

See example templates for Shield Advanced in CloudFormation at aws-samples/aws-shield-advanced-examples .

Configure Shield Advanced using AWS CloudFormation and AWS Firewall Manager

You might be able to use Firewall Manager with AWS CloudFormation to configure Shield Advanced across multiple accounts and protected resources. To do this, your accounts must be part of an organization in AWS Organizations . You can use Firewall Manager to configure Shield Advanced protections for any resource types except for Amazon RouteĀ 53 or AWS Global Accelerator .

For an example of this, see the one-click configuration guidance published by the AWS technical community at One-click deployment of Shield Advanced .

Configure multiple protections through the Shield Advanced console

You can add protection to multiple resources at once through the Shield Advanced console . For more information see Getting Started with AWS Shield Advanced and Managing resource protections in AWS Shield Advanced .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.shield.*;
 import software.amazon.awscdk.*;
 Object block;
 Object count;
 IMergeStrategy mergeStrategy;
 CfnProtectionPropsMixin cfnProtectionPropsMixin = CfnProtectionPropsMixin.Builder.create(CfnProtectionMixinProps.builder()
         .applicationLayerAutomaticResponseConfiguration(ApplicationLayerAutomaticResponseConfigurationProperty.builder()
                 .action(ActionProperty.builder()
                         .block(block)
                         .count(count)
                         .build())
                 .status("status")
                 .build())
         .healthCheckArns(List.of("healthCheckArns"))
         .name("name")
         .resourceArn("resourceArn")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnProtectionPropsMixin

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

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

      @Stability(Stable) public CfnProtectionPropsMixin(@NotNull CfnProtectionMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::Shield::Protection.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnProtectionPropsMixin

      @Stability(Stable) public CfnProtectionPropsMixin(@NotNull CfnProtectionMixinProps props)
      Create a mixin to apply properties to AWS::Shield::Protection.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnProtectionMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()