Class CfnProtection

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-21T06:34:16.399Z") @Stability(Stable) public class CfnProtection extends CfnResource implements IInspectable, ITaggableV2
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 AWS 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 AWS 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.services.shield.*;
 Object block;
 Object count;
 CfnProtection cfnProtection = CfnProtection.Builder.create(this, "MyCfnProtection")
         .name("name")
         .resourceArn("resourceArn")
         // the properties below are optional
         .applicationLayerAutomaticResponseConfiguration(ApplicationLayerAutomaticResponseConfigurationProperty.builder()
                 .action(ActionProperty.builder()
                         .block(block)
                         .count(count)
                         .build())
                 .status("status")
                 .build())
         .healthCheckArns(List.of("healthCheckArns"))
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .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

    • CfnProtection

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

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

      @Stability(Stable) public CfnProtection(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnProtectionProps 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.
    • getAttrProtectionArn

      @Stability(Stable) @NotNull public String getAttrProtectionArn()
      The ARN (Amazon Resource Name) of the new protection.
    • getAttrProtectionId

      @Stability(Stable) @NotNull public String getAttrProtectionId()
      The ID of the new protection.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • 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 protection.

      For example, My CloudFront distributions .

    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the protection.

      For example, My CloudFront distributions .

    • getResourceArn

      @Stability(Stable) @NotNull public String getResourceArn()
      The ARN (Amazon Resource Name) of the AWS resource that is protected.
    • setResourceArn

      @Stability(Stable) public void setResourceArn(@NotNull String value)
      The ARN (Amazon Resource Name) of the AWS resource that is protected.
    • getApplicationLayerAutomaticResponseConfiguration

      @Stability(Stable) @Nullable public Object getApplicationLayerAutomaticResponseConfiguration()
      The automatic application layer DDoS mitigation settings for the protection.
    • setApplicationLayerAutomaticResponseConfiguration

      @Stability(Stable) public void setApplicationLayerAutomaticResponseConfiguration(@Nullable IResolvable value)
      The automatic application layer DDoS mitigation settings for the protection.
    • setApplicationLayerAutomaticResponseConfiguration

      @Stability(Stable) public void setApplicationLayerAutomaticResponseConfiguration(@Nullable CfnProtection.ApplicationLayerAutomaticResponseConfigurationProperty value)
      The automatic application layer DDoS mitigation settings for the protection.
    • getHealthCheckArns

      @Stability(Stable) @Nullable public List<String> getHealthCheckArns()
      The ARN (Amazon Resource Name) of the health check to associate with the protection.
    • setHealthCheckArns

      @Stability(Stable) public void setHealthCheckArns(@Nullable List<String> value)
      The ARN (Amazon Resource Name) of the health check to associate with the protection.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      Key:value pairs associated with an AWS resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      Key:value pairs associated with an AWS resource.