Skip to content

CloudFrontClient#

Index > CloudFront > CloudFrontClient

Auto-generated documentation for CloudFront type annotations stubs module mypy-boto3-cloudfront.

CloudFrontClient#

Type annotations and code completion for boto3.client("cloudfront"). boto3 documentation

# CloudFrontClient usage example

from boto3.session import Session
from mypy_boto3_cloudfront.client import CloudFrontClient

def get_cloudfront_client() -> CloudFrontClient:
    return Session().client("cloudfront")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("cloudfront").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("cloudfront")

try:
    do_something(client)
except (
    client.exceptions.AccessDenied,
    client.exceptions.BatchTooLarge,
    client.exceptions.CNAMEAlreadyExists,
    client.exceptions.CachePolicyAlreadyExists,
    client.exceptions.CachePolicyInUse,
    client.exceptions.CannotChangeImmutablePublicKeyFields,
    client.exceptions.CannotDeleteEntityWhileInUse,
    client.exceptions.ClientError,
    client.exceptions.CloudFrontOriginAccessIdentityAlreadyExists,
    client.exceptions.CloudFrontOriginAccessIdentityInUse,
    client.exceptions.ContinuousDeploymentPolicyAlreadyExists,
    client.exceptions.ContinuousDeploymentPolicyInUse,
    client.exceptions.DistributionAlreadyExists,
    client.exceptions.DistributionNotDisabled,
    client.exceptions.EntityAlreadyExists,
    client.exceptions.EntityLimitExceeded,
    client.exceptions.EntityNotFound,
    client.exceptions.EntitySizeLimitExceeded,
    client.exceptions.FieldLevelEncryptionConfigAlreadyExists,
    client.exceptions.FieldLevelEncryptionConfigInUse,
    client.exceptions.FieldLevelEncryptionProfileAlreadyExists,
    client.exceptions.FieldLevelEncryptionProfileInUse,
    client.exceptions.FieldLevelEncryptionProfileSizeExceeded,
    client.exceptions.FunctionAlreadyExists,
    client.exceptions.FunctionInUse,
    client.exceptions.FunctionSizeLimitExceeded,
    client.exceptions.IllegalDelete,
    client.exceptions.IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior,
    client.exceptions.IllegalOriginAccessConfiguration,
    client.exceptions.IllegalUpdate,
    client.exceptions.InconsistentQuantities,
    client.exceptions.InvalidArgument,
    client.exceptions.InvalidDefaultRootObject,
    client.exceptions.InvalidDomainNameForOriginAccessControl,
    client.exceptions.InvalidErrorCode,
    client.exceptions.InvalidForwardCookies,
    client.exceptions.InvalidFunctionAssociation,
    client.exceptions.InvalidGeoRestrictionParameter,
    client.exceptions.InvalidHeadersForS3Origin,
    client.exceptions.InvalidIfMatchVersion,
    client.exceptions.InvalidLambdaFunctionAssociation,
    client.exceptions.InvalidLocationCode,
    client.exceptions.InvalidMinimumProtocolVersion,
    client.exceptions.InvalidOrigin,
    client.exceptions.InvalidOriginAccessControl,
    client.exceptions.InvalidOriginAccessIdentity,
    client.exceptions.InvalidOriginKeepaliveTimeout,
    client.exceptions.InvalidOriginReadTimeout,
    client.exceptions.InvalidProtocolSettings,
    client.exceptions.InvalidQueryStringParameters,
    client.exceptions.InvalidRelativePath,
    client.exceptions.InvalidRequiredProtocol,
    client.exceptions.InvalidResponseCode,
    client.exceptions.InvalidTTLOrder,
    client.exceptions.InvalidTagging,
    client.exceptions.InvalidViewerCertificate,
    client.exceptions.InvalidWebACLId,
    client.exceptions.KeyGroupAlreadyExists,
    client.exceptions.MissingBody,
    client.exceptions.MonitoringSubscriptionAlreadyExists,
    client.exceptions.NoSuchCachePolicy,
    client.exceptions.NoSuchCloudFrontOriginAccessIdentity,
    client.exceptions.NoSuchContinuousDeploymentPolicy,
    client.exceptions.NoSuchDistribution,
    client.exceptions.NoSuchFieldLevelEncryptionConfig,
    client.exceptions.NoSuchFieldLevelEncryptionProfile,
    client.exceptions.NoSuchFunctionExists,
    client.exceptions.NoSuchInvalidation,
    client.exceptions.NoSuchMonitoringSubscription,
    client.exceptions.NoSuchOrigin,
    client.exceptions.NoSuchOriginAccessControl,
    client.exceptions.NoSuchOriginRequestPolicy,
    client.exceptions.NoSuchPublicKey,
    client.exceptions.NoSuchRealtimeLogConfig,
    client.exceptions.NoSuchResource,
    client.exceptions.NoSuchResponseHeadersPolicy,
    client.exceptions.NoSuchStreamingDistribution,
    client.exceptions.OriginAccessControlAlreadyExists,
    client.exceptions.OriginAccessControlInUse,
    client.exceptions.OriginRequestPolicyAlreadyExists,
    client.exceptions.OriginRequestPolicyInUse,
    client.exceptions.PreconditionFailed,
    client.exceptions.PublicKeyAlreadyExists,
    client.exceptions.PublicKeyInUse,
    client.exceptions.QueryArgProfileEmpty,
    client.exceptions.RealtimeLogConfigAlreadyExists,
    client.exceptions.RealtimeLogConfigInUse,
    client.exceptions.RealtimeLogConfigOwnerMismatch,
    client.exceptions.ResourceInUse,
    client.exceptions.ResponseHeadersPolicyAlreadyExists,
    client.exceptions.ResponseHeadersPolicyInUse,
    client.exceptions.StagingDistributionInUse,
    client.exceptions.StreamingDistributionAlreadyExists,
    client.exceptions.StreamingDistributionNotDisabled,
    client.exceptions.TestFunctionFailed,
    client.exceptions.TooLongCSPInResponseHeadersPolicy,
    client.exceptions.TooManyCacheBehaviors,
    client.exceptions.TooManyCachePolicies,
    client.exceptions.TooManyCertificates,
    client.exceptions.TooManyCloudFrontOriginAccessIdentities,
    client.exceptions.TooManyContinuousDeploymentPolicies,
    client.exceptions.TooManyCookieNamesInWhiteList,
    client.exceptions.TooManyCookiesInCachePolicy,
    client.exceptions.TooManyCookiesInOriginRequestPolicy,
    client.exceptions.TooManyCustomHeadersInResponseHeadersPolicy,
    client.exceptions.TooManyDistributionCNAMEs,
    client.exceptions.TooManyDistributions,
    client.exceptions.TooManyDistributionsAssociatedToCachePolicy,
    client.exceptions.TooManyDistributionsAssociatedToFieldLevelEncryptionConfig,
    client.exceptions.TooManyDistributionsAssociatedToKeyGroup,
    client.exceptions.TooManyDistributionsAssociatedToOriginAccessControl,
    client.exceptions.TooManyDistributionsAssociatedToOriginRequestPolicy,
    client.exceptions.TooManyDistributionsAssociatedToResponseHeadersPolicy,
    client.exceptions.TooManyDistributionsWithFunctionAssociations,
    client.exceptions.TooManyDistributionsWithLambdaAssociations,
    client.exceptions.TooManyDistributionsWithSingleFunctionARN,
    client.exceptions.TooManyFieldLevelEncryptionConfigs,
    client.exceptions.TooManyFieldLevelEncryptionContentTypeProfiles,
    client.exceptions.TooManyFieldLevelEncryptionEncryptionEntities,
    client.exceptions.TooManyFieldLevelEncryptionFieldPatterns,
    client.exceptions.TooManyFieldLevelEncryptionProfiles,
    client.exceptions.TooManyFieldLevelEncryptionQueryArgProfiles,
    client.exceptions.TooManyFunctionAssociations,
    client.exceptions.TooManyFunctions,
    client.exceptions.TooManyHeadersInCachePolicy,
    client.exceptions.TooManyHeadersInForwardedValues,
    client.exceptions.TooManyHeadersInOriginRequestPolicy,
    client.exceptions.TooManyInvalidationsInProgress,
    client.exceptions.TooManyKeyGroups,
    client.exceptions.TooManyKeyGroupsAssociatedToDistribution,
    client.exceptions.TooManyLambdaFunctionAssociations,
    client.exceptions.TooManyOriginAccessControls,
    client.exceptions.TooManyOriginCustomHeaders,
    client.exceptions.TooManyOriginGroupsPerDistribution,
    client.exceptions.TooManyOriginRequestPolicies,
    client.exceptions.TooManyOrigins,
    client.exceptions.TooManyPublicKeys,
    client.exceptions.TooManyPublicKeysInKeyGroup,
    client.exceptions.TooManyQueryStringParameters,
    client.exceptions.TooManyQueryStringsInCachePolicy,
    client.exceptions.TooManyQueryStringsInOriginRequestPolicy,
    client.exceptions.TooManyRealtimeLogConfigs,
    client.exceptions.TooManyRemoveHeadersInResponseHeadersPolicy,
    client.exceptions.TooManyResponseHeadersPolicies,
    client.exceptions.TooManyStreamingDistributionCNAMEs,
    client.exceptions.TooManyStreamingDistributions,
    client.exceptions.TooManyTrustedSigners,
    client.exceptions.TrustedKeyGroupDoesNotExist,
    client.exceptions.TrustedSignerDoesNotExist,
    client.exceptions.UnsupportedOperation,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_cloudfront.client import Exceptions

def handle_error(exc: Exceptions.AccessDenied) -> None:
    ...

Methods#

associate_alias#

Associates an alias (also known as a CNAME or an alternate domain name) with a CloudFront distribution.

Type annotations and code completion for boto3.client("cloudfront").associate_alias method. boto3 documentation

# associate_alias method definition

def associate_alias(
    self,
    *,
    TargetDistributionId: str,
    Alias: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# associate_alias method usage example with argument unpacking

kwargs: AssociateAliasRequestRequestTypeDef = {  # (1)
    "TargetDistributionId": ...,
    "Alias": ...,
}

parent.associate_alias(**kwargs)
  1. See AssociateAliasRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("cloudfront").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("cloudfront").close method.