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

# ShieldClient 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.

# Exceptions.exceptions usage example

client = boto3.client("shield")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.AccessDeniedForDependencyException,
    client.exceptions.ClientError,
    client.exceptions.InternalErrorException,
    client.exceptions.InvalidOperationException,
    client.exceptions.InvalidPaginationTokenException,
    client.exceptions.InvalidParameterException,
    client.exceptions.InvalidResourceException,
    client.exceptions.LimitsExceededException,
    client.exceptions.LockedSubscriptionException,
    client.exceptions.NoAssociatedRoleException,
    client.exceptions.OptimisticLockException,
    client.exceptions.ResourceAlreadyExistsException,
    client.exceptions.ResourceNotFoundException,
) as e:
    print(e)
# Exceptions.exceptions 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

# associate_drt_log_bucket method definition

def associate_drt_log_bucket(
    self,
    *,
    LogBucket: str,
) -> Dict[str, Any]:
    ...
# associate_drt_log_bucket method usage example with argument unpacking

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

# associate_drt_role method definition

def associate_drt_role(
    self,
    *,
    RoleArn: str,
) -> Dict[str, Any]:
    ...
# associate_drt_role method usage example with argument unpacking

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

# associate_health_check method definition

def associate_health_check(
    self,
    *,
    ProtectionId: str,
    HealthCheckArn: str,
) -> Dict[str, Any]:
    ...
# associate_health_check method usage example with argument unpacking

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

# associate_proactive_engagement_details method definition

def associate_proactive_engagement_details(
    self,
    *,
    EmergencyContactList: Sequence[EmergencyContactTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See EmergencyContactTypeDef
# associate_proactive_engagement_details method usage example with argument unpacking

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

# can_paginate 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

# close 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

# create_protection method definition

def create_protection(
    self,
    *,
    Name: str,
    ResourceArn: str,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CreateProtectionResponseTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CreateProtectionResponseTypeDef
# create_protection method usage example with argument unpacking

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

# create_protection_group 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
# create_protection_group method usage example with argument unpacking

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

# create_subscription 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

# delete_protection method definition

def delete_protection(
    self,
    *,
    ProtectionId: str,
) -> Dict[str, Any]:
    ...
# delete_protection method usage example with argument unpacking

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

# delete_protection_group method definition

def delete_protection_group(
    self,
    *,
    ProtectionGroupId: str,
) -> Dict[str, Any]:
    ...
# delete_protection_group method usage example with argument unpacking

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

# delete_subscription 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

# describe_attack method definition

def describe_attack(
    self,
    *,
    AttackId: str,
) -> DescribeAttackResponseTypeDef:  # (1)
    ...
  1. See DescribeAttackResponseTypeDef
# describe_attack method usage example with argument unpacking

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

# describe_attack_statistics 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

# describe_drt_access 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

# describe_emergency_contact_settings 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

# describe_protection method definition

def describe_protection(
    self,
    *,
    ProtectionId: str = ...,
    ResourceArn: str = ...,
) -> DescribeProtectionResponseTypeDef:  # (1)
    ...
  1. See DescribeProtectionResponseTypeDef
# describe_protection method usage example with argument unpacking

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

# describe_protection_group method definition

def describe_protection_group(
    self,
    *,
    ProtectionGroupId: str,
) -> DescribeProtectionGroupResponseTypeDef:  # (1)
    ...
  1. See DescribeProtectionGroupResponseTypeDef
# describe_protection_group method usage example with argument unpacking

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

# describe_subscription 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

# disable_application_layer_automatic_response method definition

def disable_application_layer_automatic_response(
    self,
    *,
    ResourceArn: str,
) -> Dict[str, Any]:
    ...
# disable_application_layer_automatic_response method usage example with argument unpacking

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

# disable_proactive_engagement 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

# disassociate_drt_log_bucket method definition

def disassociate_drt_log_bucket(
    self,
    *,
    LogBucket: str,
) -> Dict[str, Any]:
    ...
# disassociate_drt_log_bucket method usage example with argument unpacking

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.