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