ShieldClient
Auto-generated documentation for Shield type annotations stubs module mypy-boto3-shield.
ShieldClient
Type annotations and code completion for boto3.client("shield")
.
boto3 documentation
from boto3.session import Session
from mypy_boto3_shield.client import ShieldClient
def get_shield_client() -> ShieldClient:
return Session().client("shield")
Exceptions
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("shield").exceptions
structure.
client = boto3.client("shield")
try:
do_something(client)
except (
client.AccessDeniedException,
client.AccessDeniedForDependencyException,
client.ClientError,
client.InternalErrorException,
client.InvalidOperationException,
client.InvalidPaginationTokenException,
client.InvalidParameterException,
client.InvalidResourceException,
client.LimitsExceededException,
client.LockedSubscriptionException,
client.NoAssociatedRoleException,
client.OptimisticLockException,
client.ResourceAlreadyExistsException,
client.ResourceNotFoundException,
) as e:
print(e)
from mypy_boto3_shield.client import Exceptions
def handle_error(exc: Exceptions.AccessDeniedException) -> None:
...
Methods
associate_drt_log_bucket
Authorizes the Shield Response Team (SRT) to access the specified Amazon S3 bucket containing log data such as Application Load Balancer access logs, CloudFront logs, or logs from third party sources.
Type annotations and code completion for boto3.client("shield").associate_drt_log_bucket
method.
boto3 documentation
kwargs: AssociateDRTLogBucketRequestRequestTypeDef = { # (1)
"LogBucket": ...,
}
parent.associate_drt_log_bucket(**kwargs)
associate_drt_role
Authorizes the Shield Response Team (SRT) using the specified role, to access your Amazon Web Services account to assist with DDoS attack mitigation during potential attacks.
Type annotations and code completion for boto3.client("shield").associate_drt_role
method.
boto3 documentation
kwargs: AssociateDRTRoleRequestRequestTypeDef = { # (1)
"RoleArn": ...,
}
parent.associate_drt_role(**kwargs)
associate_health_check
Adds health-based detection to the Shield Advanced protection for a resource.
Type annotations and code completion for boto3.client("shield").associate_health_check
method.
boto3 documentation
def associate_health_check(
self,
*,
ProtectionId: str,
HealthCheckArn: str,
) -> Dict[str, Any]:
...
kwargs: AssociateHealthCheckRequestRequestTypeDef = { # (1)
"ProtectionId": ...,
"HealthCheckArn": ...,
}
parent.associate_health_check(**kwargs)
associate_proactive_engagement_details
Initializes proactive engagement and sets the list of contacts for the Shield Response Team (SRT) to use.
Type annotations and code completion for boto3.client("shield").associate_proactive_engagement_details
method.
boto3 documentation
def associate_proactive_engagement_details(
self,
*,
EmergencyContactList: Sequence[EmergencyContactTypeDef], # (1)
) -> Dict[str, Any]:
...
kwargs: AssociateProactiveEngagementDetailsRequestRequestTypeDef = { # (1)
"EmergencyContactList": ...,
}
parent.associate_proactive_engagement_details(**kwargs)
can_paginate
Check if an operation can be paginated.
Type annotations and code completion for boto3.client("shield").can_paginate
method.
boto3 documentation
close
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("shield").close
method.
boto3 documentation
create_protection
Enables Shield Advanced for a specific Amazon Web Services resource.
Type annotations and code completion for boto3.client("shield").create_protection
method.
boto3 documentation
def create_protection(
self,
*,
Name: str,
ResourceArn: str,
Tags: Sequence[TagTypeDef] = ..., # (1)
) -> CreateProtectionResponseTypeDef: # (2)
...
kwargs: CreateProtectionRequestRequestTypeDef = { # (1)
"Name": ...,
"ResourceArn": ...,
}
parent.create_protection(**kwargs)
create_protection_group
Creates a grouping of protected resources so they can be handled as a collective.
Type annotations and code completion for boto3.client("shield").create_protection_group
method.
boto3 documentation
def create_protection_group(
self,
*,
ProtectionGroupId: str,
Aggregation: ProtectionGroupAggregationType, # (1)
Pattern: ProtectionGroupPatternType, # (2)
ResourceType: ProtectedResourceTypeType = ..., # (3)
Members: Sequence[str] = ...,
Tags: Sequence[TagTypeDef] = ..., # (4)
) -> Dict[str, Any]:
...
- See ProtectionGroupAggregationType
- See ProtectionGroupPatternType
- See ProtectedResourceTypeType
- See TagTypeDef
kwargs: CreateProtectionGroupRequestRequestTypeDef = { # (1)
"ProtectionGroupId": ...,
"Aggregation": ...,
"Pattern": ...,
}
parent.create_protection_group(**kwargs)
create_subscription
Activates Shield Advanced for an account.
Type annotations and code completion for boto3.client("shield").create_subscription
method.
boto3 documentation
delete_protection
Deletes an Shield Advanced Protection.
Type annotations and code completion for boto3.client("shield").delete_protection
method.
boto3 documentation
kwargs: DeleteProtectionRequestRequestTypeDef = { # (1)
"ProtectionId": ...,
}
parent.delete_protection(**kwargs)
delete_protection_group
Removes the specified protection group.
Type annotations and code completion for boto3.client("shield").delete_protection_group
method.
boto3 documentation
def delete_protection_group(
self,
*,
ProtectionGroupId: str,
) -> Dict[str, Any]:
...
kwargs: DeleteProtectionGroupRequestRequestTypeDef = { # (1)
"ProtectionGroupId": ...,
}
parent.delete_protection_group(**kwargs)
delete_subscription
Removes Shield Advanced from an account.
Type annotations and code completion for boto3.client("shield").delete_subscription
method.
boto3 documentation
describe_attack
Describes the details of a DDoS attack.
Type annotations and code completion for boto3.client("shield").describe_attack
method.
boto3 documentation
def describe_attack(
self,
*,
AttackId: str,
) -> DescribeAttackResponseTypeDef: # (1)
...
kwargs: DescribeAttackRequestRequestTypeDef = { # (1)
"AttackId": ...,
}
parent.describe_attack(**kwargs)
describe_attack_statistics
Provides information about the number and type of attacks 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.
Type annotations and code completion for boto3.client("shield").describe_attack_statistics
method.
boto3 documentation
def describe_attack_statistics(
self,
) -> DescribeAttackStatisticsResponseTypeDef: # (1)
...
describe_drt_access
Returns the current role and list of Amazon S3 log buckets used by the Shield Response Team (SRT) to access your Amazon Web Services account while assisting with attack mitigation.
Type annotations and code completion for boto3.client("shield").describe_drt_access
method.
boto3 documentation
describe_emergency_contact_settings
A list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you if you have proactive engagement enabled, for escalations to the SRT and to initiate proactive customer support.
Type annotations and code completion for boto3.client("shield").describe_emergency_contact_settings
method.
boto3 documentation
def describe_emergency_contact_settings(
self,
) -> DescribeEmergencyContactSettingsResponseTypeDef: # (1)
...
describe_protection
Lists the details of a Protection object.
Type annotations and code completion for boto3.client("shield").describe_protection
method.
boto3 documentation
def describe_protection(
self,
*,
ProtectionId: str = ...,
ResourceArn: str = ...,
) -> DescribeProtectionResponseTypeDef: # (1)
...
kwargs: DescribeProtectionRequestRequestTypeDef = { # (1)
"ProtectionId": ...,
}
parent.describe_protection(**kwargs)
describe_protection_group
Returns the specification for the specified protection group.
Type annotations and code completion for boto3.client("shield").describe_protection_group
method.
boto3 documentation
def describe_protection_group(
self,
*,
ProtectionGroupId: str,
) -> DescribeProtectionGroupResponseTypeDef: # (1)
...
kwargs: DescribeProtectionGroupRequestRequestTypeDef = { # (1)
"ProtectionGroupId": ...,
}
parent.describe_protection_group(**kwargs)
describe_subscription
Provides details about the Shield Advanced subscription for an account.
Type annotations and code completion for boto3.client("shield").describe_subscription
method.
boto3 documentation
def describe_subscription(
self,
) -> DescribeSubscriptionResponseTypeDef: # (1)
...
disable_application_layer_automatic_response
Disable the Shield Advanced automatic application layer DDoS mitigation feature for the protected resource.
Type annotations and code completion for boto3.client("shield").disable_application_layer_automatic_response
method.
boto3 documentation
def disable_application_layer_automatic_response(
self,
*,
ResourceArn: str,
) -> Dict[str, Any]:
...
kwargs: DisableApplicationLayerAutomaticResponseRequestRequestTypeDef = { # (1)
"ResourceArn": ...,
}
parent.disable_application_layer_automatic_response(**kwargs)
disable_proactive_engagement
Removes authorization from the Shield Response Team (SRT) to notify contacts about escalations to the SRT and to initiate proactive customer support.
Type annotations and code completion for boto3.client("shield").disable_proactive_engagement
method.
boto3 documentation
disassociate_drt_log_bucket
Removes the Shield Response Team's (SRT) access to the specified Amazon S3 bucket containing the logs that you shared previously.
Type annotations and code completion for boto3.client("shield").disassociate_drt_log_bucket
method.
boto3 documentation
kwargs: DisassociateDRTLogBucketRequestRequestTypeDef = { # (1)
"LogBucket": ...,
}
parent.disassociate_drt_log_bucket(**kwargs)
disassociate_drt_role
Removes the Shield Response Team's (SRT) access to your Amazon Web Services account.
Type annotations and code completion for boto3.client("shield").disassociate_drt_role
method.
boto3 documentation
disassociate_health_check
Removes health-based detection from the Shield Advanced protection for a resource.
Type annotations and code completion for boto3.client("shield").disassociate_health_check
method.
boto3 documentation
def disassociate_health_check(
self,
*,
ProtectionId: str,
HealthCheckArn: str,
) -> Dict[str, Any]:
...
kwargs: DisassociateHealthCheckRequestRequestTypeDef = { # (1)
"ProtectionId": ...,
"HealthCheckArn": ...,
}
parent.disassociate_health_check(**kwargs)
enable_application_layer_automatic_response
Enable the Shield Advanced automatic application layer DDoS mitigation for the protected resource.
Type annotations and code completion for boto3.client("shield").enable_application_layer_automatic_response
method.
boto3 documentation
def enable_application_layer_automatic_response(
self,
*,
ResourceArn: str,
Action: ResponseActionTypeDef, # (1)
) -> Dict[str, Any]:
...
kwargs: EnableApplicationLayerAutomaticResponseRequestRequestTypeDef = { # (1)
"ResourceArn": ...,
"Action": ...,
}
parent.enable_application_layer_automatic_response(**kwargs)
enable_proactive_engagement
Authorizes the Shield Response Team (SRT) to use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.
Type annotations and code completion for boto3.client("shield").enable_proactive_engagement
method.
boto3 documentation
generate_presigned_url
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for boto3.client("shield").generate_presigned_url
method.
boto3 documentation
def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
get_subscription_state
Returns the SubscriptionState
, either Active
or Inactive
.
Type annotations and code completion for boto3.client("shield").get_subscription_state
method.
boto3 documentation
def get_subscription_state(
self,
) -> GetSubscriptionStateResponseTypeDef: # (1)
...
list_attacks
Returns all ongoing DDoS attacks or all DDoS attacks during a specified time period.
Type annotations and code completion for boto3.client("shield").list_attacks
method.
boto3 documentation
def list_attacks(
self,
*,
ResourceArns: Sequence[str] = ...,
StartTime: TimeRangeTypeDef = ..., # (1)
EndTime: TimeRangeTypeDef = ..., # (1)
NextToken: str = ...,
MaxResults: int = ...,
) -> ListAttacksResponseTypeDef: # (3)
...
kwargs: ListAttacksRequestRequestTypeDef = { # (1)
"ResourceArns": ...,
}
parent.list_attacks(**kwargs)
list_protection_groups
Retrieves ProtectionGroup objects for the account.
Type annotations and code completion for boto3.client("shield").list_protection_groups
method.
boto3 documentation
def list_protection_groups(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
InclusionFilters: InclusionProtectionGroupFiltersTypeDef = ..., # (1)
) -> ListProtectionGroupsResponseTypeDef: # (2)
...
kwargs: ListProtectionGroupsRequestRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_protection_groups(**kwargs)
list_protections
Retrieves Protection objects for the account.
Type annotations and code completion for boto3.client("shield").list_protections
method.
boto3 documentation
def list_protections(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
InclusionFilters: InclusionProtectionFiltersTypeDef = ..., # (1)
) -> ListProtectionsResponseTypeDef: # (2)
...
kwargs: ListProtectionsRequestRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_protections(**kwargs)
list_resources_in_protection_group
Retrieves the resources that are included in the protection group.
Type annotations and code completion for boto3.client("shield").list_resources_in_protection_group
method.
boto3 documentation
def list_resources_in_protection_group(
self,
*,
ProtectionGroupId: str,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListResourcesInProtectionGroupResponseTypeDef: # (1)
...
kwargs: ListResourcesInProtectionGroupRequestRequestTypeDef = { # (1)
"ProtectionGroupId": ...,
}
parent.list_resources_in_protection_group(**kwargs)
list_tags_for_resource
Gets information about Amazon Web Services tags for a specified Amazon Resource Name (ARN) in Shield.
Type annotations and code completion for boto3.client("shield").list_tags_for_resource
method.
boto3 documentation
def list_tags_for_resource(
self,
*,
ResourceARN: str,
) -> ListTagsForResourceResponseTypeDef: # (1)
...
kwargs: ListTagsForResourceRequestRequestTypeDef = { # (1)
"ResourceARN": ...,
}
parent.list_tags_for_resource(**kwargs)
tag_resource
Adds or updates tags for a resource in Shield.
Type annotations and code completion for boto3.client("shield").tag_resource
method.
boto3 documentation
def tag_resource(
self,
*,
ResourceARN: str,
Tags: Sequence[TagTypeDef], # (1)
) -> Dict[str, Any]:
...
- See TagTypeDef
kwargs: TagResourceRequestRequestTypeDef = { # (1)
"ResourceARN": ...,
"Tags": ...,
}
parent.tag_resource(**kwargs)
untag_resource
Removes tags from a resource in Shield.
Type annotations and code completion for boto3.client("shield").untag_resource
method.
boto3 documentation
def untag_resource(
self,
*,
ResourceARN: str,
TagKeys: Sequence[str],
) -> Dict[str, Any]:
...
kwargs: UntagResourceRequestRequestTypeDef = { # (1)
"ResourceARN": ...,
"TagKeys": ...,
}
parent.untag_resource(**kwargs)
update_application_layer_automatic_response
Updates an existing Shield Advanced automatic application layer DDoS mitigation configuration for the specified resource.
Type annotations and code completion for boto3.client("shield").update_application_layer_automatic_response
method.
boto3 documentation
def update_application_layer_automatic_response(
self,
*,
ResourceArn: str,
Action: ResponseActionTypeDef, # (1)
) -> Dict[str, Any]:
...
kwargs: UpdateApplicationLayerAutomaticResponseRequestRequestTypeDef = { # (1)
"ResourceArn": ...,
"Action": ...,
}
parent.update_application_layer_automatic_response(**kwargs)
update_emergency_contact_settings
Updates the details of the list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you if you have proactive engagement enabled, for escalations to the SRT and to initiate proactive customer support.
Type annotations and code completion for boto3.client("shield").update_emergency_contact_settings
method.
boto3 documentation
def update_emergency_contact_settings(
self,
*,
EmergencyContactList: Sequence[EmergencyContactTypeDef] = ..., # (1)
) -> Dict[str, Any]:
...
kwargs: UpdateEmergencyContactSettingsRequestRequestTypeDef = { # (1)
"EmergencyContactList": ...,
}
parent.update_emergency_contact_settings(**kwargs)
update_protection_group
Updates an existing protection group.
Type annotations and code completion for boto3.client("shield").update_protection_group
method.
boto3 documentation
def update_protection_group(
self,
*,
ProtectionGroupId: str,
Aggregation: ProtectionGroupAggregationType, # (1)
Pattern: ProtectionGroupPatternType, # (2)
ResourceType: ProtectedResourceTypeType = ..., # (3)
Members: Sequence[str] = ...,
) -> Dict[str, Any]:
...
kwargs: UpdateProtectionGroupRequestRequestTypeDef = { # (1)
"ProtectionGroupId": ...,
"Aggregation": ...,
"Pattern": ...,
}
parent.update_protection_group(**kwargs)
update_subscription
Updates the details of an existing subscription.
Type annotations and code completion for boto3.client("shield").update_subscription
method.
boto3 documentation
def update_subscription(
self,
*,
AutoRenew: AutoRenewType = ..., # (1)
) -> Dict[str, Any]:
...
- See AutoRenewType
kwargs: UpdateSubscriptionRequestRequestTypeDef = { # (1)
"AutoRenew": ...,
}
parent.update_subscription(**kwargs)
get_paginator
Type annotations and code completion for boto3.client("shield").get_paginator
method with overloads.
client.get_paginator("list_attacks")
-> ListAttacksPaginatorclient.get_paginator("list_protections")
-> ListProtectionsPaginator