Skip to content

ShieldClient

Index > Shield > 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

Usage example
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.

Usage example
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)
Type checking example
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

Method definition
def associate_drt_log_bucket(
    self,
    *,
    LogBucket: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: AssociateDRTLogBucketRequestRequestTypeDef = {  # (1)
    "LogBucket": ...,
}

parent.associate_drt_log_bucket(**kwargs)
  1. See AssociateDRTLogBucketRequestRequestTypeDef

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

Method definition
def associate_drt_role(
    self,
    *,
    RoleArn: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: AssociateDRTRoleRequestRequestTypeDef = {  # (1)
    "RoleArn": ...,
}

parent.associate_drt_role(**kwargs)
  1. See AssociateDRTRoleRequestRequestTypeDef

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

Method definition
def associate_health_check(
    self,
    *,
    ProtectionId: str,
    HealthCheckArn: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: AssociateHealthCheckRequestRequestTypeDef = {  # (1)
    "ProtectionId": ...,
    "HealthCheckArn": ...,
}

parent.associate_health_check(**kwargs)
  1. See AssociateHealthCheckRequestRequestTypeDef

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

Method definition
def associate_proactive_engagement_details(
    self,
    *,
    EmergencyContactList: Sequence[EmergencyContactTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See EmergencyContactTypeDef
Usage example with kwargs
kwargs: AssociateProactiveEngagementDetailsRequestRequestTypeDef = {  # (1)
    "EmergencyContactList": ...,
}

parent.associate_proactive_engagement_details(**kwargs)
  1. See AssociateProactiveEngagementDetailsRequestRequestTypeDef

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("shield").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("shield").close method. boto3 documentation

Method definition
def close(
    self,
) -> None:
    ...

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

Method definition
def create_protection(
    self,
    *,
    Name: str,
    ResourceArn: str,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CreateProtectionResponseTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CreateProtectionResponseTypeDef
Usage example with kwargs
kwargs: CreateProtectionRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "ResourceArn": ...,
}

parent.create_protection(**kwargs)
  1. See CreateProtectionRequestRequestTypeDef

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

Method definition
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]:
    ...
  1. See ProtectionGroupAggregationType
  2. See ProtectionGroupPatternType
  3. See ProtectedResourceTypeType
  4. See TagTypeDef
Usage example with kwargs
kwargs: CreateProtectionGroupRequestRequestTypeDef = {  # (1)
    "ProtectionGroupId": ...,
    "Aggregation": ...,
    "Pattern": ...,
}

parent.create_protection_group(**kwargs)
  1. See CreateProtectionGroupRequestRequestTypeDef

create_subscription

Activates Shield Advanced for an account.

Type annotations and code completion for boto3.client("shield").create_subscription method. boto3 documentation

Method definition
def create_subscription(
    self,
) -> Dict[str, Any]:
    ...

delete_protection

Deletes an Shield Advanced Protection .

Type annotations and code completion for boto3.client("shield").delete_protection method. boto3 documentation

Method definition
def delete_protection(
    self,
    *,
    ProtectionId: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteProtectionRequestRequestTypeDef = {  # (1)
    "ProtectionId": ...,
}

parent.delete_protection(**kwargs)
  1. See DeleteProtectionRequestRequestTypeDef

delete_protection_group

Removes the specified protection group.

Type annotations and code completion for boto3.client("shield").delete_protection_group method. boto3 documentation

Method definition
def delete_protection_group(
    self,
    *,
    ProtectionGroupId: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteProtectionGroupRequestRequestTypeDef = {  # (1)
    "ProtectionGroupId": ...,
}

parent.delete_protection_group(**kwargs)
  1. See DeleteProtectionGroupRequestRequestTypeDef

delete_subscription

Removes Shield Advanced from an account.

Type annotations and code completion for boto3.client("shield").delete_subscription method. boto3 documentation

Method definition
def delete_subscription(
    self,
) -> Dict[str, Any]:
    ...

describe_attack

Describes the details of a DDoS attack.

Type annotations and code completion for boto3.client("shield").describe_attack method. boto3 documentation

Method definition
def describe_attack(
    self,
    *,
    AttackId: str,
) -> DescribeAttackResponseTypeDef:  # (1)
    ...
  1. See DescribeAttackResponseTypeDef
Usage example with kwargs
kwargs: DescribeAttackRequestRequestTypeDef = {  # (1)
    "AttackId": ...,
}

parent.describe_attack(**kwargs)
  1. See DescribeAttackRequestRequestTypeDef

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

Method definition
def describe_attack_statistics(
    self,
) -> DescribeAttackStatisticsResponseTypeDef:  # (1)
    ...
  1. See DescribeAttackStatisticsResponseTypeDef

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

Method definition
def describe_drt_access(
    self,
) -> DescribeDRTAccessResponseTypeDef:  # (1)
    ...
  1. See DescribeDRTAccessResponseTypeDef

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

Method definition
def describe_emergency_contact_settings(
    self,
) -> DescribeEmergencyContactSettingsResponseTypeDef:  # (1)
    ...
  1. See DescribeEmergencyContactSettingsResponseTypeDef

describe_protection

Lists the details of a Protection object.

Type annotations and code completion for boto3.client("shield").describe_protection method. boto3 documentation

Method definition
def describe_protection(
    self,
    *,
    ProtectionId: str = ...,
    ResourceArn: str = ...,
) -> DescribeProtectionResponseTypeDef:  # (1)
    ...
  1. See DescribeProtectionResponseTypeDef
Usage example with kwargs
kwargs: DescribeProtectionRequestRequestTypeDef = {  # (1)
    "ProtectionId": ...,
}

parent.describe_protection(**kwargs)
  1. See DescribeProtectionRequestRequestTypeDef

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

Method definition
def describe_protection_group(
    self,
    *,
    ProtectionGroupId: str,
) -> DescribeProtectionGroupResponseTypeDef:  # (1)
    ...
  1. See DescribeProtectionGroupResponseTypeDef
Usage example with kwargs
kwargs: DescribeProtectionGroupRequestRequestTypeDef = {  # (1)
    "ProtectionGroupId": ...,
}

parent.describe_protection_group(**kwargs)
  1. See DescribeProtectionGroupRequestRequestTypeDef

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

Method definition
def describe_subscription(
    self,
) -> DescribeSubscriptionResponseTypeDef:  # (1)
    ...
  1. See DescribeSubscriptionResponseTypeDef

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

Method definition
def disable_application_layer_automatic_response(
    self,
    *,
    ResourceArn: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DisableApplicationLayerAutomaticResponseRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
}

parent.disable_application_layer_automatic_response(**kwargs)
  1. See DisableApplicationLayerAutomaticResponseRequestRequestTypeDef

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

Method definition
def disable_proactive_engagement(
    self,
) -> Dict[str, Any]:
    ...

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

Method definition
def disassociate_drt_log_bucket(
    self,
    *,
    LogBucket: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DisassociateDRTLogBucketRequestRequestTypeDef = {  # (1)
    "LogBucket": ...,
}

parent.disassociate_drt_log_bucket(**kwargs)
  1. See DisassociateDRTLogBucketRequestRequestTypeDef

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

Method definition
def disassociate_drt_role(
    self,
) -> Dict[str, Any]:
    ...

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

Method definition
def disassociate_health_check(
    self,
    *,
    ProtectionId: str,
    HealthCheckArn: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DisassociateHealthCheckRequestRequestTypeDef = {  # (1)
    "ProtectionId": ...,
    "HealthCheckArn": ...,
}

parent.disassociate_health_check(**kwargs)
  1. See DisassociateHealthCheckRequestRequestTypeDef

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

Method definition
def enable_application_layer_automatic_response(
    self,
    *,
    ResourceArn: str,
    Action: ResponseActionTypeDef,  # (1)
) -> Dict[str, Any]:
    ...
  1. See ResponseActionTypeDef
Usage example with kwargs
kwargs: EnableApplicationLayerAutomaticResponseRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "Action": ...,
}

parent.enable_application_layer_automatic_response(**kwargs)
  1. See EnableApplicationLayerAutomaticResponseRequestRequestTypeDef

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

Method definition
def enable_proactive_engagement(
    self,
) -> Dict[str, Any]:
    ...

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

Method definition
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

Method definition
def get_subscription_state(
    self,
) -> GetSubscriptionStateResponseTypeDef:  # (1)
    ...
  1. See GetSubscriptionStateResponseTypeDef

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

Method definition
def list_attacks(
    self,
    *,
    ResourceArns: Sequence[str] = ...,
    StartTime: TimeRangeTypeDef = ...,  # (1)
    EndTime: TimeRangeTypeDef = ...,  # (1)
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListAttacksResponseTypeDef:  # (3)
    ...
  1. See TimeRangeTypeDef
  2. See TimeRangeTypeDef
  3. See ListAttacksResponseTypeDef
Usage example with kwargs
kwargs: ListAttacksRequestRequestTypeDef = {  # (1)
    "ResourceArns": ...,
}

parent.list_attacks(**kwargs)
  1. See ListAttacksRequestRequestTypeDef

list_protection_groups

Retrieves ProtectionGroup objects for the account.

Type annotations and code completion for boto3.client("shield").list_protection_groups method. boto3 documentation

Method definition
def list_protection_groups(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
    InclusionFilters: InclusionProtectionGroupFiltersTypeDef = ...,  # (1)
) -> ListProtectionGroupsResponseTypeDef:  # (2)
    ...
  1. See InclusionProtectionGroupFiltersTypeDef
  2. See ListProtectionGroupsResponseTypeDef
Usage example with kwargs
kwargs: ListProtectionGroupsRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_protection_groups(**kwargs)
  1. See ListProtectionGroupsRequestRequestTypeDef

list_protections

Retrieves Protection objects for the account.

Type annotations and code completion for boto3.client("shield").list_protections method. boto3 documentation

Method definition
def list_protections(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
    InclusionFilters: InclusionProtectionFiltersTypeDef = ...,  # (1)
) -> ListProtectionsResponseTypeDef:  # (2)
    ...
  1. See InclusionProtectionFiltersTypeDef
  2. See ListProtectionsResponseTypeDef
Usage example with kwargs
kwargs: ListProtectionsRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_protections(**kwargs)
  1. See ListProtectionsRequestRequestTypeDef

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

Method definition
def list_resources_in_protection_group(
    self,
    *,
    ProtectionGroupId: str,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListResourcesInProtectionGroupResponseTypeDef:  # (1)
    ...
  1. See ListResourcesInProtectionGroupResponseTypeDef
Usage example with kwargs
kwargs: ListResourcesInProtectionGroupRequestRequestTypeDef = {  # (1)
    "ProtectionGroupId": ...,
}

parent.list_resources_in_protection_group(**kwargs)
  1. See ListResourcesInProtectionGroupRequestRequestTypeDef

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

Method definition
def list_tags_for_resource(
    self,
    *,
    ResourceARN: str,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
Usage example with kwargs
kwargs: ListTagsForResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestRequestTypeDef

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

Method definition
def tag_resource(
    self,
    *,
    ResourceARN: str,
    Tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TagTypeDef
Usage example with kwargs
kwargs: TagResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
    "Tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestRequestTypeDef

untag_resource

Removes tags from a resource in Shield.

Type annotations and code completion for boto3.client("shield").untag_resource method. boto3 documentation

Method definition
def untag_resource(
    self,
    *,
    ResourceARN: str,
    TagKeys: Sequence[str],
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: UntagResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
    "TagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestRequestTypeDef

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

Method definition
def update_application_layer_automatic_response(
    self,
    *,
    ResourceArn: str,
    Action: ResponseActionTypeDef,  # (1)
) -> Dict[str, Any]:
    ...
  1. See ResponseActionTypeDef
Usage example with kwargs
kwargs: UpdateApplicationLayerAutomaticResponseRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "Action": ...,
}

parent.update_application_layer_automatic_response(**kwargs)
  1. See UpdateApplicationLayerAutomaticResponseRequestRequestTypeDef

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

Method definition
def update_emergency_contact_settings(
    self,
    *,
    EmergencyContactList: Sequence[EmergencyContactTypeDef] = ...,  # (1)
) -> Dict[str, Any]:
    ...
  1. See EmergencyContactTypeDef
Usage example with kwargs
kwargs: UpdateEmergencyContactSettingsRequestRequestTypeDef = {  # (1)
    "EmergencyContactList": ...,
}

parent.update_emergency_contact_settings(**kwargs)
  1. See UpdateEmergencyContactSettingsRequestRequestTypeDef

update_protection_group

Updates an existing protection group.

Type annotations and code completion for boto3.client("shield").update_protection_group method. boto3 documentation

Method definition
def update_protection_group(
    self,
    *,
    ProtectionGroupId: str,
    Aggregation: ProtectionGroupAggregationType,  # (1)
    Pattern: ProtectionGroupPatternType,  # (2)
    ResourceType: ProtectedResourceTypeType = ...,  # (3)
    Members: Sequence[str] = ...,
) -> Dict[str, Any]:
    ...
  1. See ProtectionGroupAggregationType
  2. See ProtectionGroupPatternType
  3. See ProtectedResourceTypeType
Usage example with kwargs
kwargs: UpdateProtectionGroupRequestRequestTypeDef = {  # (1)
    "ProtectionGroupId": ...,
    "Aggregation": ...,
    "Pattern": ...,
}

parent.update_protection_group(**kwargs)
  1. See UpdateProtectionGroupRequestRequestTypeDef

update_subscription

Updates the details of an existing subscription.

Type annotations and code completion for boto3.client("shield").update_subscription method. boto3 documentation

Method definition
def update_subscription(
    self,
    *,
    AutoRenew: AutoRenewType = ...,  # (1)
) -> Dict[str, Any]:
    ...
  1. See AutoRenewType
Usage example with kwargs
kwargs: UpdateSubscriptionRequestRequestTypeDef = {  # (1)
    "AutoRenew": ...,
}

parent.update_subscription(**kwargs)
  1. See UpdateSubscriptionRequestRequestTypeDef

get_paginator

Type annotations and code completion for boto3.client("shield").get_paginator method with overloads.