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

Methods

NameAccessible byRequired Params
create_resourceINSERTName, ResourceArn, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all protections in a region.

SELECT
region,
protection_id,
protection_arn,
name,
resource_arn,
health_check_arns,
application_layer_automatic_response_configuration,
tags
FROM aws.shield.protections
;

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 aws.shield.protections
WHERE data__Identifier = '<ProtectionArn>';

INSERT example

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

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

DELETE example

/*+ delete */
DELETE FROM aws.shield.protections
WHERE data__Identifier = '<ProtectionArn>'
AND region = 'us-east-1';

Permissions

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

Create

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

Delete

shield:DeleteProtection,
shield:UntagResource

Read

shield:DescribeProtection,
shield:ListTagsForResource

Update

shield:DescribeProtection,
shield:AssociateHealthCheck,
shield:DisassociateHealthCheck,
shield:EnableApplicationLayerAutomaticResponse,
shield:UpdateApplicationLayerAutomaticResponse,
shield:DisableApplicationLayerAutomaticResponse,
shield:ListTagsForResource,
shield:TagResource,
shield:UntagResource,
route53:GetHealthCheck,
iam:GetRole,
iam:CreateServiceLinkedRole,
wafv2:GetWebACLForResource,
wafv2:GetWebACL

List

shield:ListProtections