Skip to main content

protections

Creates, updates, deletes, gets or lists a protections resource.

Overview

Nameprotections
TypeResource
Idaws.shield.protections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
application_layer_automatic_response_configurationobjectThe 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.
health_check_idsarrayThe unique identifier (ID) for the Route 53 health check that's associated with the protection.
idstringThe unique identifier (ID) of the protection. (pattern: <code>[a-zA-Z0-9\-]*</code>)
namestringThe name of the protection. For example, My CloudFront distributions. (pattern: <code>[ a-zA-Z0-9_\.\-]*</code>)
protection_arnstringThe ARN (Amazon Resource Name) of the protection. (pattern: <code>^arn:aws.*</code>)
resource_arnstringThe ARN (Amazon Resource Name) of the Amazon Web Services resource that is protected. (pattern: <code>^arn:aws.*</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_protectionselectregionLists the details of a Protection object.
list_protectionsselectregionRetrieves Protection objects for the account. You can retrieve all protections or you can provide filtering criteria and retrieve just the subset of protections that match the criteria.
create_protectioninsertregion, ResourceArnEnables Shield Advanced for a specific Amazon Web Services resource. The resource can be an Amazon CloudFront distribution, Amazon Route 53 hosted zone, 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. You can add protection to only a single resource with each CreateProtection request. You can add protection to multiple resources at once through the Shield Advanced console at https:​//console.aws.amazon.com/wafv2/shieldv2#/. For more information see Getting Started with Shield Advanced and Adding Shield Advanced protection to Amazon Web Services resources.
associate_health_checkupdateregion, ProtectionId, HealthCheckArnAdds health-based detection to the Shield Advanced protection for a resource. Shield Advanced health-based detection uses the health of your Amazon Web Services resource to improve responsiveness and accuracy in attack detection and response. You define the health check in Route 53 and then associate it with your Shield Advanced protection. For more information, see Shield Advanced Health-Based Detection in the WAF Developer Guide.
delete_protectiondeleteregionDeletes an Shield Advanced Protection.
disassociate_health_checkexecregion, ProtectionId, HealthCheckArnRemoves health-based detection from the Shield Advanced protection for a resource. Shield Advanced health-based detection uses the health of your Amazon Web Services resource to improve responsiveness and accuracy in attack detection and response. You define the health check in Route 53 and then associate or disassociate it with your Shield Advanced protection. For more information, see Shield Advanced Health-Based Detection in the WAF Developer Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Lists the details of a Protection object.

SELECT
application_layer_automatic_response_configuration,
health_check_ids,
id,
name,
protection_arn,
resource_arn
FROM aws.shield.protections
WHERE region = '{{ region }}' -- required
;

INSERT examples

Enables Shield Advanced for a specific Amazon Web Services resource. The resource can be an Amazon CloudFront distribution, Amazon Route 53 hosted zone, 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. You can add protection to only a single resource with each CreateProtection request. You can add protection to multiple resources at once through the Shield Advanced console at https://console.aws.amazon.com/wafv2/shieldv2#/. For more information see Getting Started with Shield Advanced and Adding Shield Advanced protection to Amazon Web Services resources.

INSERT INTO aws.shield.protections (
Name,
ResourceArn,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ ResourceArn }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
protection_id
;

UPDATE examples

Adds health-based detection to the Shield Advanced protection for a resource. Shield Advanced health-based detection uses the health of your Amazon Web Services resource to improve responsiveness and accuracy in attack detection and response. You define the health check in Route 53 and then associate it with your Shield Advanced protection. For more information, see Shield Advanced Health-Based Detection in the WAF Developer Guide.

UPDATE aws.shield.protections
SET
ProtectionId = '{{ ProtectionId }}',
HealthCheckArn = '{{ HealthCheckArn }}'
WHERE
region = '{{ region }}' --required
AND ProtectionId = '{{ ProtectionId }}' --required
AND HealthCheckArn = '{{ HealthCheckArn }}' --required;

DELETE examples

Deletes an Shield Advanced Protection.

DELETE FROM aws.shield.protections
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Removes health-based detection from the Shield Advanced protection for a resource. Shield Advanced health-based detection uses the health of your Amazon Web Services resource to improve responsiveness and accuracy in attack detection and response. You define the health check in Route 53 and then associate or disassociate it with your Shield Advanced protection. For more information, see Shield Advanced Health-Based Detection in the WAF Developer Guide.

EXEC aws.shield.protections.disassociate_health_check
@region='{{ region }}' --required
@@json=
'{
"ProtectionId": "{{ ProtectionId }}",
"HealthCheckArn": "{{ HealthCheckArn }}"
}'
;