Skip to main content

protections

Creates, updates, deletes or gets a protection resource or lists protections in a region

Overview

Nameprotections
TypeResource
DescriptionEnables 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.
Idawscc.shield.protections

Fields

NameDatatypeDescription
protection_idstringThe unique identifier (ID) of the protection.
protection_arnstringThe ARN (Amazon Resource Name) of the protection.
namestringFriendly name for the Protection.
resource_arnstringThe ARN (Amazon Resource Name) of the resource to be protected.
health_check_arnsarrayThe Amazon Resource Names (ARNs) of the health check to associate with the protection.
application_layer_automatic_response_configurationobjectThe automatic application layer DDoS mitigation settings for a 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.
tagsarrayOne or more tag key-value pairs for the Protection object.
regionstringAWS region.

For more information, see AWS::Shield::Protection.

Methods

NameResourceAccessible byRequired Params
create_resourceprotectionsINSERTName, ResourceArn, region
delete_resourceprotectionsDELETEIdentifier, region
update_resourceprotectionsUPDATEIdentifier, PatchDocument, region
list_resourcesprotections_list_onlySELECTregion
get_resourceprotectionsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual protection.

SELECT
region,
protection_id,
protection_arn,
name,
resource_arn,
health_check_arns,
application_layer_automatic_response_configuration,
tags
FROM awscc.shield.protections
WHERE
region = 'us-east-1' AND
Identifier = '{{ protection_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new protection resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.shield.protections (
Name,
ResourceArn,
region
)
SELECT
'{{ name }}',
'{{ resource_arn }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a protection resource, using stack-deploy.

/*+ update */
UPDATE awscc.shield.protections
SET PatchDocument = string('{{ {
"HealthCheckArns": health_check_arns,
"ApplicationLayerAutomaticResponseConfiguration": application_layer_automatic_response_configuration,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ protection_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.shield.protections
WHERE
Identifier = '{{ protection_arn }}' AND
region = 'us-east-1';

Permissions

To operate on the protections resource, the following permissions are required:

shield:CreateProtection,
shield:DeleteProtection,
shield:DescribeProtection,
shield:ListProtections,
shield:EnableApplicationLayerAutomaticResponse,
shield:AssociateHealthCheck,
shield:TagResource,
ec2:DescribeAddresses,
elasticloadbalancing:DescribeLoadBalancers,
route53:GetHealthCheck,
iam:GetRole,
iam:CreateServiceLinkedRole,
wafv2:GetWebACLForResource,
wafv2:GetWebACL