Table of Contents
Shield.
Client
¶A low-level client representing AWS Shield
This is the AWS Shield Advanced API Reference . This guide is for developers who need detailed information about the AWS Shield Advanced API actions, data types, and errors. For detailed information about AWS WAF and AWS Shield Advanced features and an overview of how to use the AWS WAF and AWS Shield Advanced APIs, see the AWS WAF and AWS Shield Developer Guide .
client = session.create_client('shield')
These are the available methods:
associate_drt_log_bucket
(**kwargs)¶Authorizes the DDoS Response Team (DRT) to access the specified Amazon S3 bucket containing your AWS WAF logs. You can associate up to 10 Amazon S3 buckets with your subscription.
To use the services of the DRT and make an AssociateDRTLogBucket
request, you must be subscribed to the Business Support plan or the Enterprise Support plan .
See also: AWS API Documentation
Request Syntax
response = client.associate_drt_log_bucket(
LogBucket='string'
)
LogBucket (string) –
[REQUIRED]
The Amazon S3 bucket that contains your AWS WAF logs.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
associate_drt_role
(**kwargs)¶Authorizes the DDoS Response Team (DRT), using the specified role, to access your AWS account to assist with DDoS attack mitigation during potential attacks. This enables the DRT to inspect your AWS WAF configuration and create or update AWS WAF rules and web ACLs.
You can associate only one RoleArn
with your subscription. If you submit an AssociateDRTRole
request for an account that already has an associated role, the new RoleArn
will replace the existing RoleArn
.
Prior to making the AssociateDRTRole
request, you must attach the AWSShieldDRTAccessPolicy managed policy to the role you will specify in the request. For more information see `Attaching and Detaching IAM Policies < https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html>`__ . The role must also trust the service principal drt.shield.amazonaws.com
. For more information, see IAM JSON Policy Elements: Principal .
The DRT will have access only to your AWS WAF and Shield resources. By submitting this request, you authorize the DRT to inspect your AWS WAF and Shield configuration and create and update AWS WAF rules and web ACLs on your behalf. The DRT takes these actions only if explicitly authorized by you.
You must have the iam:PassRole
permission to make an AssociateDRTRole
request. For more information, see Granting a User Permissions to Pass a Role to an AWS Service .
To use the services of the DRT and make an AssociateDRTRole
request, you must be subscribed to the Business Support plan or the Enterprise Support plan .
See also: AWS API Documentation
Request Syntax
response = client.associate_drt_role(
RoleArn='string'
)
RoleArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the role the DRT will use to access your AWS account.
Prior to making the AssociateDRTRole
request, you must attach the AWSShieldDRTAccessPolicy managed policy to this role. For more information see `Attaching and Detaching IAM Policies < https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html>`__ .
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
associate_health_check
(**kwargs)¶Adds health-based detection to the Shield Advanced protection for a resource. Shield Advanced health-based detection uses the health of your AWS resource to improve responsiveness and accuracy in attack detection and mitigation.
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 AWS WAF and AWS Shield Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.associate_health_check(
ProtectionId='string',
HealthCheckArn='string'
)
ProtectionId (string) –
[REQUIRED]
The unique identifier (ID) for the Protection object to add the health check association to.
HealthCheckArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the health check to associate with the protection.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
associate_proactive_engagement_details
(**kwargs)¶Initializes proactive engagement and sets the list of contacts for the DDoS Response Team (DRT) to use. You must provide at least one phone number in the emergency contact list.
After you have initialized proactive engagement using this call, to disable or enable proactive engagement, use the calls DisableProactiveEngagement
and EnableProactiveEngagement
.
Note
This call defines the list of email addresses and phone numbers that the DDoS Response Team (DRT) can use to contact you for escalations to the DRT and to initiate proactive customer support.
The contacts that you provide in the request replace any contacts that were already defined. If you already have contacts defined and want to use them, retrieve the list using DescribeEmergencyContactSettings
and then provide it to this call.
See also: AWS API Documentation
Request Syntax
response = client.associate_proactive_engagement_details(
EmergencyContactList=[
{
'EmailAddress': 'string',
'PhoneNumber': 'string',
'ContactNotes': 'string'
},
]
)
EmergencyContactList (list) –
[REQUIRED]
A list of email addresses and phone numbers that the DDoS Response Team (DRT) can use to contact you for escalations to the DRT and to initiate proactive customer support.
To enable proactive engagement, the contact list must include at least one phone number.
Note
The contacts that you provide here replace any contacts that were already defined. If you already have contacts defined and want to use them, retrieve the list using DescribeEmergencyContactSettings
and then provide it here.
(dict) –
Contact information that the DRT can use to contact you if you have proactive engagement enabled, for escalations to the DRT and to initiate proactive customer support.
EmailAddress (string) – [REQUIRED]
The email address for the contact.
PhoneNumber (string) –
The phone number for the contact.
ContactNotes (string) –
Additional notes regarding the contact.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
can_paginate
(operation_name)¶Check if an operation can be paginated.
operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo
, and you’d normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.
True
if the operation can be paginated,
False
otherwise.
create_protection
(**kwargs)¶Enables AWS Shield Advanced for a specific AWS resource. The resource can be an Amazon CloudFront distribution, Elastic Load Balancing load balancer, AWS Global Accelerator accelerator, Elastic IP Address, or an Amazon Route 53 hosted zone.
You can add protection to only a single resource with each CreateProtection request. If you want to add protection to multiple resources at once, use the AWS WAF console . For more information see Getting Started with AWS Shield Advanced and Add AWS Shield Advanced Protection to more AWS Resources .
See also: AWS API Documentation
Request Syntax
response = client.create_protection(
Name='string',
ResourceArn='string'
)
Name (string) –
[REQUIRED]
Friendly name for the Protection
you are creating.
ResourceArn (string) –
[REQUIRED]
The ARN (Amazon Resource Name) of the resource to be protected.
The ARN should be in one of the following formats:
For an Application Load Balancer: ``arn:aws:elasticloadbalancing:region :account-id :loadbalancer/app/load-balancer-name /load-balancer-id ``
For an Elastic Load Balancer (Classic Load Balancer): ``arn:aws:elasticloadbalancing:region :account-id :loadbalancer/load-balancer-name ``
For an AWS CloudFront distribution: ``arn:aws:cloudfront::account-id :distribution/distribution-id ``
For an AWS Global Accelerator accelerator: ``arn:aws:globalaccelerator::account-id :accelerator/accelerator-id ``
For Amazon Route 53: ``arn:aws:route53:::hostedzone/hosted-zone-id ``
For an Elastic IP address: ``arn:aws:ec2:region :account-id :eip-allocation/allocation-id ``
dict
Response Syntax
{
'ProtectionId': 'string'
}
Response Structure
(dict) –
ProtectionId (string) –
The unique identifier (ID) for the Protection object that is created.
Exceptions
create_protection_group
(**kwargs)¶Creates a grouping of protected resources so they can be handled as a collective. This resource grouping improves the accuracy of detection and reduces false positives.
See also: AWS API Documentation
Request Syntax
response = client.create_protection_group(
ProtectionGroupId='string',
Aggregation='SUM'|'MEAN'|'MAX',
Pattern='ALL'|'ARBITRARY'|'BY_RESOURCE_TYPE',
ResourceType='CLOUDFRONT_DISTRIBUTION'|'ROUTE_53_HOSTED_ZONE'|'ELASTIC_IP_ALLOCATION'|'CLASSIC_LOAD_BALANCER'|'APPLICATION_LOAD_BALANCER'|'GLOBAL_ACCELERATOR',
Members=[
'string',
]
)
ProtectionGroupId (string) –
[REQUIRED]
The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
Aggregation (string) –
[REQUIRED]
Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.
Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.
Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.
Max - Use the highest traffic from each resource. This is useful for resources that don’t share traffic and for resources that share that traffic in a non-uniform way. Examples include CloudFront distributions and origin resources for CloudFront distributions.
Pattern (string) –
[REQUIRED]
The criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.
ResourceType (string) – The resource type to include in the protection group. All protected resources of this type are included in the protection group. Newly protected resources of this type are automatically added to the group. You must set this when you set Pattern
to BY_RESOURCE_TYPE
and you must not set it for any other Pattern
setting.
Members (list) –
The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set Pattern
to ARBITRARY
and you must not set it for any other Pattern
setting.
(string) –
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
create_subscription
()¶Activates AWS Shield Advanced for an account.
When you initally create a subscription, your subscription is set to be automatically renewed at the end of the existing subscription period. You can change this by submitting an UpdateSubscription
request.
See also: AWS API Documentation
Request Syntax
response = client.create_subscription()
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
delete_protection
(**kwargs)¶Deletes an AWS Shield Advanced Protection .
See also: AWS API Documentation
Request Syntax
response = client.delete_protection(
ProtectionId='string'
)
ProtectionId (string) –
[REQUIRED]
The unique identifier (ID) for the Protection object to be deleted.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
delete_protection_group
(**kwargs)¶Removes the specified protection group.
See also: AWS API Documentation
Request Syntax
response = client.delete_protection_group(
ProtectionGroupId='string'
)
ProtectionGroupId (string) –
[REQUIRED]
The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
delete_subscription
()¶Removes AWS Shield Advanced from an account. AWS Shield Advanced requires a 1-year subscription commitment. You cannot delete a subscription prior to the completion of that commitment.
Danger
This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.
See also: AWS API Documentation
Request Syntax
response = client.delete_subscription()
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
describe_attack
(**kwargs)¶Describes the details of a DDoS attack.
See also: AWS API Documentation
Request Syntax
response = client.describe_attack(
AttackId='string'
)
AttackId (string) –
[REQUIRED]
The unique identifier (ID) for the attack that to be described.
dict
Response Syntax
{
'Attack': {
'AttackId': 'string',
'ResourceArn': 'string',
'SubResources': [
{
'Type': 'IP'|'URL',
'Id': 'string',
'AttackVectors': [
{
'VectorType': 'string',
'VectorCounters': [
{
'Name': 'string',
'Max': 123.0,
'Average': 123.0,
'Sum': 123.0,
'N': 123,
'Unit': 'string'
},
]
},
],
'Counters': [
{
'Name': 'string',
'Max': 123.0,
'Average': 123.0,
'Sum': 123.0,
'N': 123,
'Unit': 'string'
},
]
},
],
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'AttackCounters': [
{
'Name': 'string',
'Max': 123.0,
'Average': 123.0,
'Sum': 123.0,
'N': 123,
'Unit': 'string'
},
],
'AttackProperties': [
{
'AttackLayer': 'NETWORK'|'APPLICATION',
'AttackPropertyIdentifier': 'DESTINATION_URL'|'REFERRER'|'SOURCE_ASN'|'SOURCE_COUNTRY'|'SOURCE_IP_ADDRESS'|'SOURCE_USER_AGENT'|'WORDPRESS_PINGBACK_REFLECTOR'|'WORDPRESS_PINGBACK_SOURCE',
'TopContributors': [
{
'Name': 'string',
'Value': 123
},
],
'Unit': 'BITS'|'BYTES'|'PACKETS'|'REQUESTS',
'Total': 123
},
],
'Mitigations': [
{
'MitigationName': 'string'
},
]
}
}
Response Structure
(dict) –
Attack (dict) –
The attack that is described.
AttackId (string) –
The unique identifier (ID) of the attack.
ResourceArn (string) –
The ARN (Amazon Resource Name) of the resource that was attacked.
SubResources (list) –
If applicable, additional detail about the resource being attacked, for example, IP address or URL.
(dict) –
The attack information for the specified SubResource.
Type (string) –
The SubResource
type.
Id (string) –
The unique identifier (ID) of the SubResource
.
AttackVectors (list) –
The list of attack types and associated counters.
(dict) –
A summary of information about the attack.
VectorType (string) –
The attack type, for example, SNMP reflection or SYN flood.
VectorCounters (list) –
The list of counters that describe the details of the attack.
(dict) –
The counter that describes a DDoS attack.
Name (string) –
The counter name.
Max (float) –
The maximum value of the counter for a specified time period.
Average (float) –
The average value of the counter for a specified time period.
Sum (float) –
The total of counter values for a specified time period.
N (integer) –
The number of counters for a specified time period.
Unit (string) –
The unit of the counters.
Counters (list) –
The counters that describe the details of the attack.
(dict) –
The counter that describes a DDoS attack.
Name (string) –
The counter name.
Max (float) –
The maximum value of the counter for a specified time period.
Average (float) –
The average value of the counter for a specified time period.
Sum (float) –
The total of counter values for a specified time period.
N (integer) –
The number of counters for a specified time period.
Unit (string) –
The unit of the counters.
StartTime (datetime) –
The time the attack started, in Unix time in seconds. For more information see timestamp .
EndTime (datetime) –
The time the attack ended, in Unix time in seconds. For more information see timestamp .
AttackCounters (list) –
List of counters that describe the attack for the specified time period.
(dict) –
The counter that describes a DDoS attack.
Name (string) –
The counter name.
Max (float) –
The maximum value of the counter for a specified time period.
Average (float) –
The average value of the counter for a specified time period.
Sum (float) –
The total of counter values for a specified time period.
N (integer) –
The number of counters for a specified time period.
Unit (string) –
The unit of the counters.
AttackProperties (list) –
The array of AttackProperty objects.
(dict) –
Details of the described attack.
AttackLayer (string) –
The type of distributed denial of service (DDoS) event that was observed. NETWORK
indicates layer 3 and layer 4 events and APPLICATION
indicates layer 7 events.
AttackPropertyIdentifier (string) –
Defines the DDoS attack property information that is provided. The WORDPRESS_PINGBACK_REFLECTOR
and WORDPRESS_PINGBACK_SOURCE
values are valid only for WordPress reflective pingback DDoS attacks.
TopContributors (list) –
The array of contributor objects that includes the top five contributors to an attack.
(dict) –
A contributor to the attack and their contribution.
Name (string) –
The name of the contributor. This is dependent on the AttackPropertyIdentifier
. For example, if the AttackPropertyIdentifier
is SOURCE_COUNTRY
, the Name
could be United States
.
Value (integer) –
The contribution of this contributor expressed in Protection units. For example 10,000
.
Unit (string) –
The unit of the Value
of the contributions.
Total (integer) –
The total contributions made to this attack by all contributors, not just the five listed in the TopContributors
list.
Mitigations (list) –
List of mitigation actions taken for the attack.
(dict) –
The mitigation applied to a DDoS attack.
MitigationName (string) –
The name of the mitigation taken for this attack.
Exceptions
describe_attack_statistics
()¶Provides information about the number and type of attacks AWS Shield has detected in the last year for all resources that belong to your account, regardless of whether you’ve defined Shield protections for them. This operation is available to Shield customers as well as to Shield Advanced customers.
The operation returns data for the time range of midnight UTC, one year ago, to midnight UTC, today. For example, if the current time is 2020-10-26 15:39:32 PDT
, equal to 2020-10-26 22:39:32 UTC
, then the time range for the attack data returned is from 2019-10-26 00:00:00 UTC
to 2020-10-26 00:00:00 UTC
.
The time range indicates the period covered by the attack statistics data items.
See also: AWS API Documentation
Request Syntax
response = client.describe_attack_statistics()
dict
Response Syntax
{
'TimeRange': {
'FromInclusive': datetime(2015, 1, 1),
'ToExclusive': datetime(2015, 1, 1)
},
'DataItems': [
{
'AttackVolume': {
'BitsPerSecond': {
'Max': 123.0
},
'PacketsPerSecond': {
'Max': 123.0
},
'RequestsPerSecond': {
'Max': 123.0
}
},
'AttackCount': 123
},
]
}
Response Structure
(dict) –
TimeRange (dict) –
The time range.
DataItems (list) –
The data that describes the attacks detected during the time period.
(dict) –
A single attack statistics data record. This is returned by DescribeAttackStatistics along with a time range indicating the time period that the attack statistics apply to.
AttackVolume (dict) –
Information about the volume of attacks during the time period. If the accompanying AttackCount
is zero, this setting might be empty.
BitsPerSecond (dict) –
A statistics object that uses bits per second as the unit. This is included for network level attacks.
Max (float) –
The maximum attack volume observed for the given unit.
PacketsPerSecond (dict) –
A statistics object that uses packets per second as the unit. This is included for network level attacks.
Max (float) –
The maximum attack volume observed for the given unit.
RequestsPerSecond (dict) –
A statistics object that uses requests per second as the unit. This is included for application level attacks, and is only available for accounts that are subscribed to Shield Advanced.
Max (float) –
The maximum attack volume observed for the given unit.
AttackCount (integer) –
The number of attacks detected during the time period. This is always present, but might be zero.
Exceptions
describe_drt_access
()¶Returns the current role and list of Amazon S3 log buckets used by the DDoS Response Team (DRT) to access your AWS account while assisting with attack mitigation.
See also: AWS API Documentation
Request Syntax
response = client.describe_drt_access()
dict
Response Syntax
{
'RoleArn': 'string',
'LogBucketList': [
'string',
]
}
Response Structure
(dict) –
RoleArn (string) –
The Amazon Resource Name (ARN) of the role the DRT used to access your AWS account.
LogBucketList (list) –
The list of Amazon S3 buckets accessed by the DRT.
(string) –
Exceptions
describe_emergency_contact_settings
()¶A list of email addresses and phone numbers that the DDoS Response Team (DRT) can use to contact you if you have proactive engagement enabled, for escalations to the DRT and to initiate proactive customer support.
See also: AWS API Documentation
Request Syntax
response = client.describe_emergency_contact_settings()
dict
Response Syntax
{
'EmergencyContactList': [
{
'EmailAddress': 'string',
'PhoneNumber': 'string',
'ContactNotes': 'string'
},
]
}
Response Structure
(dict) –
EmergencyContactList (list) –
A list of email addresses and phone numbers that the DDoS Response Team (DRT) can use to contact you if you have proactive engagement enabled, for escalations to the DRT and to initiate proactive customer support.
(dict) –
Contact information that the DRT can use to contact you if you have proactive engagement enabled, for escalations to the DRT and to initiate proactive customer support.
EmailAddress (string) –
The email address for the contact.
PhoneNumber (string) –
The phone number for the contact.
ContactNotes (string) –
Additional notes regarding the contact.
Exceptions
describe_protection
(**kwargs)¶Lists the details of a Protection object.
See also: AWS API Documentation
Request Syntax
response = client.describe_protection(
ProtectionId='string',
ResourceArn='string'
)
ProtectionId (string) – The unique identifier (ID) for the Protection object that is described. When submitting the DescribeProtection
request you must provide either the ResourceArn
or the ProtectionID
, but not both.
ResourceArn (string) – The ARN (Amazon Resource Name) of the AWS resource for the Protection object that is described. When submitting the DescribeProtection
request you must provide either the ResourceArn
or the ProtectionID
, but not both.
dict
Response Syntax
{
'Protection': {
'Id': 'string',
'Name': 'string',
'ResourceArn': 'string',
'HealthCheckIds': [
'string',
]
}
}
Response Structure
(dict) –
Protection (dict) –
The Protection object that is described.
Id (string) –
The unique identifier (ID) of the protection.
Name (string) –
The name of the protection. For example, My CloudFront distributions
.
ResourceArn (string) –
The ARN (Amazon Resource Name) of the AWS resource that is protected.
HealthCheckIds (list) –
The unique identifier (ID) for the Route 53 health check that’s associated with the protection.
(string) –
Exceptions
describe_protection_group
(**kwargs)¶Returns the specification for the specified protection group.
See also: AWS API Documentation
Request Syntax
response = client.describe_protection_group(
ProtectionGroupId='string'
)
ProtectionGroupId (string) –
[REQUIRED]
The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
dict
Response Syntax
{
'ProtectionGroup': {
'ProtectionGroupId': 'string',
'Aggregation': 'SUM'|'MEAN'|'MAX',
'Pattern': 'ALL'|'ARBITRARY'|'BY_RESOURCE_TYPE',
'ResourceType': 'CLOUDFRONT_DISTRIBUTION'|'ROUTE_53_HOSTED_ZONE'|'ELASTIC_IP_ALLOCATION'|'CLASSIC_LOAD_BALANCER'|'APPLICATION_LOAD_BALANCER'|'GLOBAL_ACCELERATOR',
'Members': [
'string',
]
}
}
Response Structure
(dict) –
ProtectionGroup (dict) –
A grouping of protected resources that you and AWS Shield Advanced can monitor as a collective. This resource grouping improves the accuracy of detection and reduces false positives.
ProtectionGroupId (string) –
The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
Aggregation (string) –
Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.
Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.
Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.
Max - Use the highest traffic from each resource. This is useful for resources that don’t share traffic and for resources that share that traffic in a non-uniform way. Examples include CloudFront distributions and origin resources for CloudFront distributions.
Pattern (string) –
The criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.
ResourceType (string) –
The resource type to include in the protection group. All protected resources of this type are included in the protection group. You must set this when you set Pattern
to BY_RESOURCE_TYPE
and you must not set it for any other Pattern
setting.
Members (list) –
The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set Pattern
to ARBITRARY
and you must not set it for any other Pattern
setting.
(string) –
Exceptions
describe_subscription
()¶Provides details about the AWS Shield Advanced subscription for an account.
See also: AWS API Documentation
Request Syntax
response = client.describe_subscription()
dict
Response Syntax
{
'Subscription': {
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'TimeCommitmentInSeconds': 123,
'AutoRenew': 'ENABLED'|'DISABLED',
'Limits': [
{
'Type': 'string',
'Max': 123
},
],
'ProactiveEngagementStatus': 'ENABLED'|'DISABLED'|'PENDING',
'SubscriptionLimits': {
'ProtectionLimits': {
'ProtectedResourceTypeLimits': [
{
'Type': 'string',
'Max': 123
},
]
},
'ProtectionGroupLimits': {
'MaxProtectionGroups': 123,
'PatternTypeLimits': {
'ArbitraryPatternLimits': {
'MaxMembers': 123
}
}
}
}
}
}
Response Structure
(dict) –
Subscription (dict) –
The AWS Shield Advanced subscription details for an account.
StartTime (datetime) –
The start time of the subscription, in Unix time in seconds. For more information see timestamp .
EndTime (datetime) –
The date and time your subscription will end.
TimeCommitmentInSeconds (integer) –
The length, in seconds, of the AWS Shield Advanced subscription for the account.
AutoRenew (string) –
If ENABLED
, the subscription will be automatically renewed at the end of the existing subscription period.
When you initally create a subscription, AutoRenew
is set to ENABLED
. You can change this by submitting an UpdateSubscription
request. If the UpdateSubscription
request does not included a value for AutoRenew
, the existing value for AutoRenew
remains unchanged.
Limits (list) –
Specifies how many protections of a given type you can create.
(dict) –
Specifies how many protections of a given type you can create.
Type (string) –
The type of protection.
Max (integer) –
The maximum number of protections that can be created for the specified Type
.
ProactiveEngagementStatus (string) –
If ENABLED
, the DDoS Response Team (DRT) will use email and phone to notify contacts about escalations to the DRT and to initiate proactive customer support.
If PENDING
, you have requested proactive engagement and the request is pending. The status changes to ENABLED
when your request is fully processed.
If DISABLED
, the DRT will not proactively notify contacts about escalations or to initiate proactive customer support.
SubscriptionLimits (dict) –
Limits settings for your subscription.
ProtectionLimits (dict) –
Limits settings on protections for your subscription.
ProtectedResourceTypeLimits (list) –
The maximum number of resource types that you can specify in a protection.
(dict) –
Specifies how many protections of a given type you can create.
Type (string) –
The type of protection.
Max (integer) –
The maximum number of protections that can be created for the specified Type
.
ProtectionGroupLimits (dict) –
Limits settings on protection groups for your subscription.
MaxProtectionGroups (integer) –
The maximum number of protection groups that you can have at one time.
PatternTypeLimits (dict) –
Limits settings by pattern type in the protection groups for your subscription.
ArbitraryPatternLimits (dict) –
Limits settings on protection groups with arbitrary pattern type.
MaxMembers (integer) –
The maximum number of resources you can specify for a single arbitrary pattern in a protection group.
Exceptions
disable_proactive_engagement
()¶Removes authorization from the DDoS Response Team (DRT) to notify contacts about escalations to the DRT and to initiate proactive customer support.
See also: AWS API Documentation
Request Syntax
response = client.disable_proactive_engagement()
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
disassociate_drt_log_bucket
(**kwargs)¶Removes the DDoS Response Team’s (DRT) access to the specified Amazon S3 bucket containing your AWS WAF logs.
To make a DisassociateDRTLogBucket
request, you must be subscribed to the Business Support plan or the Enterprise Support plan . However, if you are not subscribed to one of these support plans, but had been previously and had granted the DRT access to your account, you can submit a DisassociateDRTLogBucket
request to remove this access.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_drt_log_bucket(
LogBucket='string'
)
LogBucket (string) –
[REQUIRED]
The Amazon S3 bucket that contains your AWS WAF logs.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
disassociate_drt_role
()¶Removes the DDoS Response Team’s (DRT) access to your AWS account.
To make a DisassociateDRTRole
request, you must be subscribed to the Business Support plan or the Enterprise Support plan . However, if you are not subscribed to one of these support plans, but had been previously and had granted the DRT access to your account, you can submit a DisassociateDRTRole
request to remove this access.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_drt_role()
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
disassociate_health_check
(**kwargs)¶Removes health-based detection from the Shield Advanced protection for a resource. Shield Advanced health-based detection uses the health of your AWS resource to improve responsiveness and accuracy in attack detection and mitigation.
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 AWS WAF and AWS Shield Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.disassociate_health_check(
ProtectionId='string',
HealthCheckArn='string'
)
ProtectionId (string) –
[REQUIRED]
The unique identifier (ID) for the Protection object to remove the health check association from.
HealthCheckArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the health check that is associated with the protection.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
enable_proactive_engagement
()¶Authorizes the DDoS Response Team (DRT) to use email and phone to notify contacts about escalations to the DRT and to initiate proactive customer support.
See also: AWS API Documentation
Request Syntax
response = client.enable_proactive_engagement()
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
generate_presigned_url
(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
ClientMethod (string) – The client method to presign for
Params (dict) – The parameters normally passed to
ClientMethod
.
ExpiresIn (int) – The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
HttpMethod (string) – The http method to use on the generated url. By default, the http method is whatever is used in the method’s model.
The presigned url
get_paginator
(operation_name)¶Create a paginator for an operation.
operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo
, and you’d normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.
OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate
method to
check if an operation is pageable.
L{botocore.paginate.Paginator}
A paginator object.
get_subscription_state
()¶Returns the SubscriptionState
, either Active
or Inactive
.
See also: AWS API Documentation
Request Syntax
response = client.get_subscription_state()
dict
Response Syntax
{
'SubscriptionState': 'ACTIVE'|'INACTIVE'
}
Response Structure
(dict) –
SubscriptionState (string) –
The status of the subscription.
Exceptions
get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
waiter_name (str) – The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
The specified waiter object.
botocore.waiter.Waiter
list_attacks
(**kwargs)¶Returns all ongoing DDoS attacks or all DDoS attacks during a specified time period.
See also: AWS API Documentation
Request Syntax
response = client.list_attacks(
ResourceArns=[
'string',
],
StartTime={
'FromInclusive': datetime(2015, 1, 1),
'ToExclusive': datetime(2015, 1, 1)
},
EndTime={
'FromInclusive': datetime(2015, 1, 1),
'ToExclusive': datetime(2015, 1, 1)
},
NextToken='string',
MaxResults=123
)
ResourceArns (list) –
The ARN (Amazon Resource Name) of the resource that was attacked. If this is left blank, all applicable resources for this account will be included.
(string) –
StartTime (dict) –
The start of the time period for the attacks. This is a timestamp
type. The sample request above indicates a number
type because the default used by WAF is Unix time in seconds. However any valid timestamp format is allowed.
EndTime (dict) –
The end of the time period for the attacks. This is a timestamp
type. The sample request above indicates a number
type because the default used by WAF is Unix time in seconds. However any valid timestamp format is allowed.
NextToken (string) – The ListAttacksRequest.NextMarker
value from a previous call to ListAttacksRequest
. Pass null if this is the first call.
MaxResults (integer) –
The maximum number of AttackSummary objects to return. If you leave this blank, Shield Advanced returns the first 20 results.
This is a maximum value. Shield Advanced might return the results in smaller batches. That is, the number of objects returned could be less than MaxResults
, even if there are still more objects yet to return. If there are more objects to return, Shield Advanced returns a value in NextToken
that you can use in your next request, to get the next batch of objects.
dict
Response Syntax
{
'AttackSummaries': [
{
'AttackId': 'string',
'ResourceArn': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'AttackVectors': [
{
'VectorType': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) –
AttackSummaries (list) –
The attack information for the specified time range.
(dict) –
Summarizes all DDoS attacks for a specified time period.
AttackId (string) –
The unique identifier (ID) of the attack.
ResourceArn (string) –
The ARN (Amazon Resource Name) of the resource that was attacked.
StartTime (datetime) –
The start time of the attack, in Unix time in seconds. For more information see timestamp .
EndTime (datetime) –
The end time of the attack, in Unix time in seconds. For more information see timestamp .
AttackVectors (list) –
The list of attacks for a specified time period.
(dict) –
Describes the attack.
VectorType (string) –
The attack type. Valid values:
UDP_TRAFFIC
UDP_FRAGMENT
GENERIC_UDP_REFLECTION
DNS_REFLECTION
NTP_REFLECTION
CHARGEN_REFLECTION
SSDP_REFLECTION
PORT_MAPPER
RIP_REFLECTION
SNMP_REFLECTION
MSSQL_REFLECTION
NET_BIOS_REFLECTION
SYN_FLOOD
ACK_FLOOD
REQUEST_FLOOD
HTTP_REFLECTION
UDS_REFLECTION
MEMCACHED_REFLECTION
NextToken (string) –
The token returned by a previous call to indicate that there is more data available. If not null, more results are available. Pass this value for the NextMarker
parameter in a subsequent call to ListAttacks
to retrieve the next set of items.
Shield Advanced might return the list of AttackSummary objects in batches smaller than the number specified by MaxResults. If there are more attack summary objects to return, Shield Advanced will always also return a NextToken
.
Exceptions
list_protection_groups
(**kwargs)¶Retrieves the ProtectionGroup objects for the account.
See also: AWS API Documentation
Request Syntax
response = client.list_protection_groups(
NextToken='string',
MaxResults=123
)
NextToken (string) – The next token value from a previous call to ListProtectionGroups
. Pass null if this is the first call.
MaxResults (integer) –
The maximum number of ProtectionGroup objects to return. If you leave this blank, Shield Advanced returns the first 20 results.
This is a maximum value. Shield Advanced might return the results in smaller batches. That is, the number of objects returned could be less than MaxResults
, even if there are still more objects yet to return. If there are more objects to return, Shield Advanced returns a value in NextToken
that you can use in your next request, to get the next batch of objects.
dict
Response Syntax
{
'ProtectionGroups': [
{
'ProtectionGroupId': 'string',
'Aggregation': 'SUM'|'MEAN'|'MAX',
'Pattern': 'ALL'|'ARBITRARY'|'BY_RESOURCE_TYPE',
'ResourceType': 'CLOUDFRONT_DISTRIBUTION'|'ROUTE_53_HOSTED_ZONE'|'ELASTIC_IP_ALLOCATION'|'CLASSIC_LOAD_BALANCER'|'APPLICATION_LOAD_BALANCER'|'GLOBAL_ACCELERATOR',
'Members': [
'string',
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) –
ProtectionGroups (list) –
(dict) –
A grouping of protected resources that you and AWS Shield Advanced can monitor as a collective. This resource grouping improves the accuracy of detection and reduces false positives.
ProtectionGroupId (string) –
The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
Aggregation (string) –
Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.
Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.
Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.
Max - Use the highest traffic from each resource. This is useful for resources that don’t share traffic and for resources that share that traffic in a non-uniform way. Examples include CloudFront distributions and origin resources for CloudFront distributions.
Pattern (string) –
The criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.
ResourceType (string) –
The resource type to include in the protection group. All protected resources of this type are included in the protection group. You must set this when you set Pattern
to BY_RESOURCE_TYPE
and you must not set it for any other Pattern
setting.
Members (list) –
The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set Pattern
to ARBITRARY
and you must not set it for any other Pattern
setting.
(string) –
NextToken (string) –
If you specify a value for MaxResults
and you have more protection groups than the value of MaxResults, AWS Shield Advanced returns this token that you can use in your next request, to get the next batch of objects.
Exceptions
list_protections
(**kwargs)¶Lists all Protection objects for the account.
See also: AWS API Documentation
Request Syntax
response = client.list_protections(
NextToken='string',
MaxResults=123
)
NextToken (string) – The ListProtectionsRequest.NextToken
value from a previous call to ListProtections
. Pass null if this is the first call.
MaxResults (integer) –
The maximum number of Protection objects to return. If you leave this blank, Shield Advanced returns the first 20 results.
This is a maximum value. Shield Advanced might return the results in smaller batches. That is, the number of objects returned could be less than MaxResults
, even if there are still more objects yet to return. If there are more objects to return, Shield Advanced returns a value in NextToken
that you can use in your next request, to get the next batch of objects.
dict
Response Syntax
{
'Protections': [
{
'Id': 'string',
'Name': 'string',
'ResourceArn': 'string',
'HealthCheckIds': [
'string',
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) –
Protections (list) –
The array of enabled Protection objects.
(dict) –
An object that represents a resource that is under DDoS protection.
Id (string) –
The unique identifier (ID) of the protection.
Name (string) –
The name of the protection. For example, My CloudFront distributions
.
ResourceArn (string) –
The ARN (Amazon Resource Name) of the AWS resource that is protected.
HealthCheckIds (list) –
The unique identifier (ID) for the Route 53 health check that’s associated with the protection.
(string) –
NextToken (string) –
If you specify a value for MaxResults
and you have more Protections than the value of MaxResults, AWS Shield Advanced returns a NextToken value in the response that allows you to list another group of Protections. For the second and subsequent ListProtections requests, specify the value of NextToken from the previous response to get information about another batch of Protections.
Shield Advanced might return the list of Protection objects in batches smaller than the number specified by MaxResults. If there are more Protection objects to return, Shield Advanced will always also return a NextToken
.
Exceptions
list_resources_in_protection_group
(**kwargs)¶Retrieves the resources that are included in the protection group.
See also: AWS API Documentation
Request Syntax
response = client.list_resources_in_protection_group(
ProtectionGroupId='string',
NextToken='string',
MaxResults=123
)
ProtectionGroupId (string) –
[REQUIRED]
The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
NextToken (string) – The next token value from a previous call to ListResourcesInProtectionGroup
. Pass null if this is the first call.
MaxResults (integer) –
The maximum number of resource ARN objects to return. If you leave this blank, Shield Advanced returns the first 20 results.
This is a maximum value. Shield Advanced might return the results in smaller batches. That is, the number of objects returned could be less than MaxResults
, even if there are still more objects yet to return. If there are more objects to return, Shield Advanced returns a value in NextToken
that you can use in your next request, to get the next batch of objects.
dict
Response Syntax
{
'ResourceArns': [
'string',
],
'NextToken': 'string'
}
Response Structure
(dict) –
ResourceArns (list) –
The Amazon Resource Names (ARNs) of the resources that are included in the protection group.
(string) –
NextToken (string) –
If you specify a value for MaxResults
and you have more resources in the protection group than the value of MaxResults, AWS Shield Advanced returns this token that you can use in your next request, to get the next batch of objects.
Exceptions
update_emergency_contact_settings
(**kwargs)¶Updates the details of the list of email addresses and phone numbers that the DDoS Response Team (DRT) can use to contact you if you have proactive engagement enabled, for escalations to the DRT and to initiate proactive customer support.
See also: AWS API Documentation
Request Syntax
response = client.update_emergency_contact_settings(
EmergencyContactList=[
{
'EmailAddress': 'string',
'PhoneNumber': 'string',
'ContactNotes': 'string'
},
]
)
EmergencyContactList (list) –
A list of email addresses and phone numbers that the DDoS Response Team (DRT) can use to contact you if you have proactive engagement enabled, for escalations to the DRT and to initiate proactive customer support.
If you have proactive engagement enabled, the contact list must include at least one phone number.
(dict) –
Contact information that the DRT can use to contact you if you have proactive engagement enabled, for escalations to the DRT and to initiate proactive customer support.
EmailAddress (string) – [REQUIRED]
The email address for the contact.
PhoneNumber (string) –
The phone number for the contact.
ContactNotes (string) –
Additional notes regarding the contact.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
update_protection_group
(**kwargs)¶Updates an existing protection group. A protection group is a grouping of protected resources so they can be handled as a collective. This resource grouping improves the accuracy of detection and reduces false positives.
See also: AWS API Documentation
Request Syntax
response = client.update_protection_group(
ProtectionGroupId='string',
Aggregation='SUM'|'MEAN'|'MAX',
Pattern='ALL'|'ARBITRARY'|'BY_RESOURCE_TYPE',
ResourceType='CLOUDFRONT_DISTRIBUTION'|'ROUTE_53_HOSTED_ZONE'|'ELASTIC_IP_ALLOCATION'|'CLASSIC_LOAD_BALANCER'|'APPLICATION_LOAD_BALANCER'|'GLOBAL_ACCELERATOR',
Members=[
'string',
]
)
ProtectionGroupId (string) –
[REQUIRED]
The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
Aggregation (string) –
[REQUIRED]
Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.
Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.
Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.
Max - Use the highest traffic from each resource. This is useful for resources that don’t share traffic and for resources that share that traffic in a non-uniform way. Examples include CloudFront distributions and origin resources for CloudFront distributions.
Pattern (string) –
[REQUIRED]
The criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.
ResourceType (string) – The resource type to include in the protection group. All protected resources of this type are included in the protection group. You must set this when you set Pattern
to BY_RESOURCE_TYPE
and you must not set it for any other Pattern
setting.
Members (list) –
The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set Pattern
to ARBITRARY
and you must not set it for any other Pattern
setting.
(string) –
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
update_subscription
(**kwargs)¶Updates the details of an existing subscription. Only enter values for parameters you want to change. Empty parameters are not updated.
See also: AWS API Documentation
Request Syntax
response = client.update_subscription(
AutoRenew='ENABLED'|'DISABLED'
)
AutoRenew (string) – When you initally create a subscription, AutoRenew
is set to ENABLED
. If ENABLED
, the subscription will be automatically renewed at the end of the existing subscription period. You can change this by submitting an UpdateSubscription
request. If the UpdateSubscription
request does not included a value for AutoRenew
, the existing value for AutoRenew
remains unchanged.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
Client exceptions are available on a client instance via the exceptions
property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.
The available client exceptions are:
Shield.Client.exceptions.
AccessDeniedException
¶Exception that indicates the specified AttackId
does not exist, or the requester does not have the appropriate permissions to access the AttackId
.
Example
try:
...
except client.exceptions.AccessDeniedException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates the specified AttackId
does not exist, or the requester does not have the appropriate permissions to access the AttackId
.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
AccessDeniedForDependencyException
¶In order to grant the necessary access to the DDoS Response Team (DRT), the user submitting the request must have the iam:PassRole
permission. This error indicates the user did not have the appropriate permissions. For more information, see Granting a User Permissions to Pass a Role to an AWS Service .
Example
try:
...
except client.exceptions.AccessDeniedForDependencyException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
In order to grant the necessary access to the DDoS Response Team (DRT), the user submitting the request must have the iam:PassRole
permission. This error indicates the user did not have the appropriate permissions. For more information, see Granting a User Permissions to Pass a Role to an AWS Service .
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
InternalErrorException
¶Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.
Example
try:
...
except client.exceptions.InternalErrorException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
InvalidOperationException
¶Exception that indicates that the operation would not cause any change to occur.
Example
try:
...
except client.exceptions.InvalidOperationException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates that the operation would not cause any change to occur.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
InvalidPaginationTokenException
¶Exception that indicates that the NextToken specified in the request is invalid. Submit the request using the NextToken value that was returned in the response.
Example
try:
...
except client.exceptions.InvalidPaginationTokenException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates that the NextToken specified in the request is invalid. Submit the request using the NextToken value that was returned in the response.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
InvalidParameterException
¶Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties.
Example
try:
...
except client.exceptions.InvalidParameterException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'reason': 'FIELD_VALIDATION_FAILED'|'OTHER',
'fields': [
{
'name': 'string',
'message': 'string'
},
],
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties.
message (string) –
reason (string) –
Additional information about the exception.
fields (list) –
Fields that caused the exception.
(dict) –
Provides information about a particular parameter passed inside a request that resulted in an exception.
name (string) –
The name of the parameter that failed validation.
message (string) –
The message describing why the parameter failed validation.
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
InvalidResourceException
¶Exception that indicates that the resource is invalid. You might not have access to the resource, or the resource might not exist.
Example
try:
...
except client.exceptions.InvalidResourceException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates that the resource is invalid. You might not have access to the resource, or the resource might not exist.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
LimitsExceededException
¶Exception that indicates that the operation would exceed a limit.
Type
is the type of limit that would be exceeded.
Limit
is the threshold that would be exceeded.
Example
try:
...
except client.exceptions.LimitsExceededException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Type': 'string',
'Limit': 123,
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates that the operation would exceed a limit.
Type
is the type of limit that would be exceeded.
Limit
is the threshold that would be exceeded.
message (string) –
Type (string) –
Limit (integer) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
LockedSubscriptionException
¶You are trying to update a subscription that has not yet completed the 1-year commitment. You can change the AutoRenew
parameter during the last 30 days of your subscription. This exception indicates that you are attempting to change AutoRenew
prior to that period.
Example
try:
...
except client.exceptions.LockedSubscriptionException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
You are trying to update a subscription that has not yet completed the 1-year commitment. You can change the AutoRenew
parameter during the last 30 days of your subscription. This exception indicates that you are attempting to change AutoRenew
prior to that period.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
NoAssociatedRoleException
¶The ARN of the role that you specifed does not exist.
Example
try:
...
except client.exceptions.NoAssociatedRoleException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
The ARN of the role that you specifed does not exist.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
OptimisticLockException
¶Exception that indicates that the resource state has been modified by another client. Retrieve the resource and then retry your request.
Example
try:
...
except client.exceptions.OptimisticLockException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception that indicates that the resource state has been modified by another client. Retrieve the resource and then retry your request.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
ResourceAlreadyExistsException
¶Exception indicating the specified resource already exists. If available, this exception includes details in additional properties.
Example
try:
...
except client.exceptions.ResourceAlreadyExistsException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'resourceType': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception indicating the specified resource already exists. If available, this exception includes details in additional properties.
message (string) –
resourceType (string) –
The type of resource that already exists.
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
Shield.Client.exceptions.
ResourceNotFoundException
¶Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.
Example
try:
...
except client.exceptions.ResourceNotFoundException as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'resourceType': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.
message (string) –
resourceType (string) –
Type of resource.
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
The available paginators are:
Shield.Paginator.
ListAttacks
¶paginator = client.get_paginator('list_attacks')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from Shield.Client.list_attacks()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ResourceArns=[
'string',
],
StartTime={
'FromInclusive': datetime(2015, 1, 1),
'ToExclusive': datetime(2015, 1, 1)
},
EndTime={
'FromInclusive': datetime(2015, 1, 1),
'ToExclusive': datetime(2015, 1, 1)
},
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
ResourceArns (list) –
The ARN (Amazon Resource Name) of the resource that was attacked. If this is left blank, all applicable resources for this account will be included.
(string) –
StartTime (dict) –
The start of the time period for the attacks. This is a timestamp
type. The sample request above indicates a number
type because the default used by WAF is Unix time in seconds. However any valid timestamp format is allowed.
EndTime (dict) –
The end of the time period for the attacks. This is a timestamp
type. The sample request above indicates a number
type because the default used by WAF is Unix time in seconds. However any valid timestamp format is allowed.
PaginationConfig (dict) –
A dictionary that provides parameters to control pagination.
MaxItems (integer) –
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
PageSize (integer) –
The size of each page.
StartingToken (string) –
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'AttackSummaries': [
{
'AttackId': 'string',
'ResourceArn': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'AttackVectors': [
{
'VectorType': 'string'
},
]
},
],
}
Response Structure
(dict) –
AttackSummaries (list) –
The attack information for the specified time range.
(dict) –
Summarizes all DDoS attacks for a specified time period.
AttackId (string) –
The unique identifier (ID) of the attack.
ResourceArn (string) –
The ARN (Amazon Resource Name) of the resource that was attacked.
StartTime (datetime) –
The start time of the attack, in Unix time in seconds. For more information see timestamp .
EndTime (datetime) –
The end time of the attack, in Unix time in seconds. For more information see timestamp .
AttackVectors (list) –
The list of attacks for a specified time period.
(dict) –
Describes the attack.
VectorType (string) –
The attack type. Valid values:
UDP_TRAFFIC
UDP_FRAGMENT
GENERIC_UDP_REFLECTION
DNS_REFLECTION
NTP_REFLECTION
CHARGEN_REFLECTION
SSDP_REFLECTION
PORT_MAPPER
RIP_REFLECTION
SNMP_REFLECTION
MSSQL_REFLECTION
NET_BIOS_REFLECTION
SYN_FLOOD
ACK_FLOOD
REQUEST_FLOOD
HTTP_REFLECTION
UDS_REFLECTION
MEMCACHED_REFLECTION
Shield.Paginator.
ListProtections
¶paginator = client.get_paginator('list_protections')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from Shield.Client.list_protections()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
PaginationConfig (dict) –
A dictionary that provides parameters to control pagination.
MaxItems (integer) –
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
PageSize (integer) –
The size of each page.
StartingToken (string) –
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'Protections': [
{
'Id': 'string',
'Name': 'string',
'ResourceArn': 'string',
'HealthCheckIds': [
'string',
]
},
],
}
Response Structure
(dict) –
Protections (list) –
The array of enabled Protection objects.
(dict) –
An object that represents a resource that is under DDoS protection.
Id (string) –
The unique identifier (ID) of the protection.
Name (string) –
The name of the protection. For example, My CloudFront distributions
.
ResourceArn (string) –
The ARN (Amazon Resource Name) of the AWS resource that is protected.
HealthCheckIds (list) –
The unique identifier (ID) for the Route 53 health check that’s associated with the protection.
(string) –