Class CfnProtection

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:35.778Z") @Stability(Stable) public class CfnProtection extends CfnResource implements IInspectable
A CloudFormation AWS::Shield::Protection.

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.

Use this to add protection to a single resource at a time. 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 .

To configure this resource through AWS CloudFormation , you must be subscribed to AWS 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 .

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();
 
  • 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 Construct scope, @NotNull String id, @NotNull CfnProtectionProps props)
      Create a new AWS::Shield::Protection.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Key:value pairs associated with an AWS resource.

      The key:value pair can be anything you define. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each AWS resource.

      To modify tags on existing resources, use the AWS Shield Advanced APIs or command line interface. With AWS CloudFormation , you can only add tags to resources during resource creation.

    • 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.

      This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.

    • setApplicationLayerAutomaticResponseConfiguration

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

      This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.

    • setApplicationLayerAutomaticResponseConfiguration

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

      This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.

    • getHealthCheckArns

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

      Health-based detection provides improved responsiveness and accuracy in attack detection and mitigation.

      You can use this option with any resource type except for Route 53 hosted zones.

      For more information, see Configuring health-based detection using health checks in the AWS Shield Advanced Developer Guide .

    • setHealthCheckArns

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

      Health-based detection provides improved responsiveness and accuracy in attack detection and mitigation.

      You can use this option with any resource type except for Route 53 hosted zones.

      For more information, see Configuring health-based detection using health checks in the AWS Shield Advanced Developer Guide .