AWS Fundamentals Logo
AWS Fundamentals
aws cloudfront

AWS Amazon CloudFront CLI Commands

167 CLI commands available for Amazon CloudFront.

CommandSample
associate-alias

The AssociateAlias API operation only supports standard distributions. To move domains between distribution tenants and/or standard distributions, we recommend that you use the UpdateDomainAssociation API operation instead. Associates an alias with a CloudFront standard distribution. An alias is c

associate-distribution-tenant-web-acl

Associates the WAF web ACL with a distribution tenant.

associate-distribution-web-acl

Associates the WAF web ACL with a distribution.

copy-distribution

Creates a staging distribution using the configuration of the provided primary distribution. A staging distribution is a copy of an existing distribution (called the primary distribution) that you can use in a continuous deployment workflow. After you create a staging distribution, you can use Updat

create-anycast-ip-list

Creates an Anycast static IP list.

create-cache-policy

Creates a cache policy. After you create a cache policy, you can attach it to one or more cache behaviors. When it's attached to a cache behavior, the cache policy determines the following: The values that CloudFront includes in the cache key. These values can include HTTP headers, cookies, and UR

create-cloud-front-origin-access-identity

Creates a new origin access identity. If you're using Amazon S3 for your origin, you can use an origin access identity to require users to access your content using a CloudFront URL instead of the Amazon S3 URL. For more information about how to use origin access identities, see Serving Private Cont

create-connection-function

Creates a connection function.

create-connection-group

Creates a connection group.

create-continuous-deployment-policy

Creates a continuous deployment policy that distributes traffic for a custom domain name to two different CloudFront distributions. To use a continuous deployment policy, first use CopyDistribution to create a staging distribution, then use UpdateDistribution to modify the staging distribution's con

create-distribution

Creates a CloudFront distribution.

create-distribution-tenant

Creates a distribution tenant.

create-distribution-with-tags

Create a new distribution with tags. This API operation requires the following IAM permissions: CreateDistribution TagResource

create-field-level-encryption-config

Create a new field-level encryption configuration.

create-field-level-encryption-profile

Create a field-level encryption profile.

create-function

Creates a CloudFront function. To create a function, you provide the function code and some configuration information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function. When you create a function, it's in the DEVELOPMENT stage. In this stag

create-invalidation

Create a new invalidation. For more information, see Invalidating files in the Amazon CloudFront Developer Guide.

create-invalidation-for-distribution-tenant

Creates an invalidation for a distribution tenant. For more information, see Invalidating files in the Amazon CloudFront Developer Guide.

create-key-group

Creates a key group that you can use with CloudFront signed URLs and signed cookies. To create a key group, you must specify at least one public key for the key group. After you create a key group, you can reference it from one or more cache behaviors. When you reference a key group in a cache behav

create-key-value-store

Specifies the key value store resource to add to your account. In your account, the key value store names must be unique. You can also import key value store data in JSON format from an S3 bucket by providing a valid ImportSource that you own.

create-monitoring-subscription

Enables or disables additional Amazon CloudWatch metrics for the specified CloudFront distribution. The additional metrics incur an additional cost. For more information, see Viewing additional CloudFront distribution metrics in the Amazon CloudFront Developer Guide.

create-origin-access-control

Creates a new origin access control in CloudFront. After you create an origin access control, you can add it to an origin in a CloudFront distribution so that CloudFront sends authenticated (signed) requests to the origin. This makes it possible to block public access to the origin, allowing viewers

create-origin-request-policy

Creates an origin request policy. After you create an origin request policy, you can attach it to one or more cache behaviors. When it's attached to a cache behavior, the origin request policy determines the values that CloudFront includes in requests that it sends to the origin. Each request that C

create-public-key

Uploads a public key to CloudFront that you can use with signed URLs and signed cookies, or with field-level encryption.

create-realtime-log-config

Creates a real-time log configuration. After you create a real-time log configuration, you can attach it to one or more cache behaviors to send real-time log data to the specified Amazon Kinesis data stream. For more information about real-time log configurations, see Real-time logs in the Amazon Cl

create-response-headers-policy

Creates a response headers policy. A response headers policy contains information about a set of HTTP headers. To create a response headers policy, you provide some metadata about the policy and a set of configurations that specify the headers. After you create a response headers policy, you can use

create-streaming-distribution

This API is deprecated. Amazon CloudFront is deprecating real-time messaging protocol (RTMP) distributions on December 31, 2020. For more information, read the announcement on the Amazon CloudFront discussion forum.

create-streaming-distribution-with-tags

This API is deprecated. Amazon CloudFront is deprecating real-time messaging protocol (RTMP) distributions on December 31, 2020. For more information, read the announcement on the Amazon CloudFront discussion forum.

create-trust-store

Creates a trust store.

create-vpc-origin

Create an Amazon CloudFront VPC origin.

delete-anycast-ip-list

Deletes an Anycast static IP list.

delete-cache-policy

Deletes a cache policy. You cannot delete a cache policy if it's attached to a cache behavior. First update your distributions to remove the cache policy from all cache behaviors, then delete the cache policy. To delete a cache policy, you must provide the policy's identifier and version. To get the

delete-cloud-front-origin-access-identity

Delete an origin access identity.

delete-connection-function

Deletes a connection function.

delete-connection-group

Deletes a connection group.

delete-continuous-deployment-policy

Deletes a continuous deployment policy. You cannot delete a continuous deployment policy that's attached to a primary distribution. First update your distribution to remove the continuous deployment policy, then you can delete the policy.

delete-distribution

Delete a distribution. Before you can delete a distribution, you must disable it, which requires permission to update the distribution. Once deleted, a distribution cannot be recovered.

delete-distribution-tenant

Deletes a distribution tenant. If you use this API operation to delete a distribution tenant that is currently enabled, the request will fail. To delete a distribution tenant, you must first disable the distribution tenant by using the UpdateDistributionTenant API operation.

delete-field-level-encryption-config

Remove a field-level encryption configuration.

delete-field-level-encryption-profile

Remove a field-level encryption profile.

delete-function

Deletes a CloudFront function. You cannot delete a function if it's associated with a cache behavior. First, update your distributions to remove the function association from all cache behaviors, then delete the function. To delete a function, you must provide the function's name and version (ETag v

delete-key-group

Deletes a key group. You cannot delete a key group that is referenced in a cache behavior. First update your distributions to remove the key group from all cache behaviors, then delete the key group. To delete a key group, you must provide the key group's identifier and version. To get these values,

delete-key-value-store

Specifies the key value store to delete.

delete-monitoring-subscription

Disables additional CloudWatch metrics for the specified CloudFront distribution.

delete-origin-access-control

Deletes a CloudFront origin access control. You cannot delete an origin access control if it's in use. First, update all distributions to remove the origin access control from all origins, then delete the origin access control.

delete-origin-request-policy

Deletes an origin request policy. You cannot delete an origin request policy if it's attached to any cache behaviors. First update your distributions to remove the origin request policy from all cache behaviors, then delete the origin request policy. To delete an origin request policy, you must prov

delete-public-key

Remove a public key you previously added to CloudFront.

delete-realtime-log-config

Deletes a real-time log configuration. You cannot delete a real-time log configuration if it's attached to a cache behavior. First update your distributions to remove the real-time log configuration from all cache behaviors, then delete the real-time log configuration. To delete a real-time log conf

delete-resource-policy

Deletes the resource policy attached to the CloudFront resource.

delete-response-headers-policy

Deletes a response headers policy. You cannot delete a response headers policy if it's attached to a cache behavior. First update your distributions to remove the response headers policy from all cache behaviors, then delete the response headers policy. To delete a response headers policy, you must

delete-streaming-distribution

Delete a streaming distribution. To delete an RTMP distribution using the CloudFront API, perform the following steps. To delete an RTMP distribution using the CloudFront API: Disable the RTMP distribution. Submit a GET Streaming Distribution Config request to get the current configuration and

delete-trust-store

Deletes a trust store.

delete-vpc-origin

Delete an Amazon CloudFront VPC origin.

describe-connection-function

Describes a connection function.

describe-function

Gets configuration information and metadata about a CloudFront function, but not the function's code. To get a function's code, use GetFunction. To get configuration information and metadata about a function, you must provide the function's name and stage. To get these values, you can use ListFuncti

describe-key-value-store

Specifies the key value store and its configuration.

disassociate-distribution-tenant-web-acl

Disassociates a distribution tenant from the WAF web ACL.

disassociate-distribution-web-acl

Disassociates a distribution from the WAF web ACL.

get-anycast-ip-list

Gets an Anycast static IP list.

get-cache-policy

Gets a cache policy, including the following metadata: The policy's identifier. The date and time when the policy was last modified. To get a cache policy, you must provide the policy's identifier. If the cache policy is attached to a distribution's cache behavior, you can get the policy's ide

get-cache-policy-config

Gets a cache policy configuration. To get a cache policy configuration, you must provide the policy's identifier. If the cache policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the cache policy is not attached to

get-cloud-front-origin-access-identity

Get the information about an origin access identity.

get-cloud-front-origin-access-identity-config

Get the configuration information about an origin access identity.

get-connection-function

Gets a connection function.

get-connection-group

Gets information about a connection group.

get-connection-group-by-routing-endpoint

Gets information about a connection group by using the endpoint that you specify.

get-continuous-deployment-policy

Gets a continuous deployment policy, including metadata (the policy's identifier and the date and time when the policy was last modified).

get-continuous-deployment-policy-config

Gets configuration information about a continuous deployment policy.

get-distribution

Get the information about a distribution.

get-distribution-config

Get the configuration information about a distribution.

get-distribution-tenant

Gets information about a distribution tenant.

get-distribution-tenant-by-domain

Gets information about a distribution tenant by the associated domain.

get-field-level-encryption

Get the field-level encryption configuration information.

get-field-level-encryption-config

Get the field-level encryption configuration information.

get-field-level-encryption-profile

Get the field-level encryption profile information.

get-field-level-encryption-profile-config

Get the field-level encryption profile configuration information.

get-function

Gets the code of a CloudFront function. To get configuration information and metadata about a function, use DescribeFunction. To get a function's code, you must provide the function's name and stage. To get these values, you can use ListFunctions.

get-invalidation

Get the information about an invalidation.

get-invalidation-for-distribution-tenant

Gets information about a specific invalidation for a distribution tenant.

get-key-group

Gets a key group, including the date and time when the key group was last modified. To get a key group, you must provide the key group's identifier. If the key group is referenced in a distribution's cache behavior, you can get the key group's identifier using ListDistributions or GetDistribution. I

get-key-group-config

Gets a key group configuration. To get a key group configuration, you must provide the key group's identifier. If the key group is referenced in a distribution's cache behavior, you can get the key group's identifier using ListDistributions or GetDistribution. If the key group is not referenced in a

get-managed-certificate-details

Gets details about the CloudFront managed ACM certificate.

get-monitoring-subscription

Gets information about whether additional CloudWatch metrics are enabled for the specified CloudFront distribution.

get-origin-access-control

Gets a CloudFront origin access control, including its unique identifier.

get-origin-access-control-config

Gets a CloudFront origin access control configuration.

get-origin-request-policy

Gets an origin request policy, including the following metadata: The policy's identifier. The date and time when the policy was last modified. To get an origin request policy, you must provide the policy's identifier. If the origin request policy is attached to a distribution's cache behavior,

get-origin-request-policy-config

Gets an origin request policy configuration. To get an origin request policy configuration, you must provide the policy's identifier. If the origin request policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the or

get-public-key

Gets a public key.

get-public-key-config

Gets a public key configuration.

get-realtime-log-config

Gets a real-time log configuration. To get a real-time log configuration, you can provide the configuration's name or its Amazon Resource Name (ARN). You must provide at least one. If you provide both, CloudFront uses the name to identify the real-time log configuration to get.

get-resource-policy

Retrieves the resource policy for the specified CloudFront resource that you own and have shared.

get-response-headers-policy

Gets a response headers policy, including metadata (the policy's identifier and the date and time when the policy was last modified). To get a response headers policy, you must provide the policy's identifier. If the response headers policy is attached to a distribution's cache behavior, you can get

get-response-headers-policy-config

Gets a response headers policy configuration. To get a response headers policy configuration, you must provide the policy's identifier. If the response headers policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If th

get-streaming-distribution

Gets information about a specified RTMP distribution, including the distribution configuration.

get-streaming-distribution-config

Get the configuration information about a streaming distribution.

get-trust-store

Gets a trust store.

get-vpc-origin

Get the details of an Amazon CloudFront VPC origin.

list-anycast-ip-lists

Lists your Anycast static IP lists.

list-cache-policies

Gets a list of cache policies. You can optionally apply a filter to return only the managed policies created by Amazon Web Services, or only the custom policies created in your Amazon Web Services account. You can optionally specify the maximum number of items to receive in the response. If the tota

list-cloud-front-origin-access-identities

Lists origin access identities.

list-conflicting-aliases

The ListConflictingAliases API operation only supports standard distributions. To list domain conflicts for both standard distributions and distribution tenants, we recommend that you use the ListDomainConflicts API operation instead. Gets a list of aliases that conflict or overlap with the provid

list-connection-functions

Lists connection functions.

list-connection-groups

Lists the connection groups in your Amazon Web Services account.

list-continuous-deployment-policies

Gets a list of the continuous deployment policies in your Amazon Web Services account. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated.

list-distribution-tenants

Lists the distribution tenants in your Amazon Web Services account.

list-distribution-tenants-by-customization

Lists distribution tenants by the customization that you specify. You must specify either the CertificateArn parameter or WebACLArn parameter, but not both in the same request.

list-distributions

List CloudFront distributions.

list-distributions-by-anycast-ip-list-id

Lists the distributions in your account that are associated with the specified AnycastIpListId.

list-distributions-by-cache-policy-id

Gets a list of distribution IDs for distributions that have a cache behavior that's associated with the specified cache policy. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the def

list-distributions-by-connection-function

Lists distributions by connection function.

list-distributions-by-connection-mode

Lists the distributions by the connection mode that you specify.

list-distributions-by-key-group

Gets a list of distribution IDs for distributions that have a cache behavior that references the specified key group. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maxim

list-distributions-by-origin-request-policy-id

Gets a list of distribution IDs for distributions that have a cache behavior that's associated with the specified origin request policy. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, o

list-distributions-by-owned-resource

Lists the CloudFront distributions that are associated with the specified resource that you own.

list-distributions-by-realtime-log-config

Gets a list of distributions that have a cache behavior that's associated with the specified real-time log configuration. You can specify the real-time log configuration by its name or its Amazon Resource Name (ARN). You must provide at least one. If you provide both, CloudFront uses the name to ide

list-distributions-by-response-headers-policy-id

Gets a list of distribution IDs for distributions that have a cache behavior that's associated with the specified response headers policy. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify,

list-distributions-by-trust-store

Lists distributions by trust store.

list-distributions-by-vpc-origin-id

List CloudFront distributions by their VPC origin ID.

list-distributions-by-web-acl-id

List the distributions that are associated with a specified WAF web ACL.

list-domain-conflicts

We recommend that you use the ListDomainConflicts API operation to check for domain conflicts, as it supports both standard distributions and distribution tenants. ListConflictingAliases performs similar checks but only supports standard distributions. Lists existing domain associations that confl

list-field-level-encryption-configs

List all field-level encryption configurations that have been created in CloudFront for this account.

list-field-level-encryption-profiles

Request a list of field-level encryption profiles that have been created in CloudFront for this account.

list-functions

Gets a list of all CloudFront functions in your Amazon Web Services account. You can optionally apply a filter to return only the functions that are in the specified stage, either DEVELOPMENT or LIVE. You can optionally specify the maximum number of items to receive in the response. If the total num

list-invalidations

Lists invalidation batches.

list-invalidations-for-distribution-tenant

Lists the invalidations for a distribution tenant.

list-key-groups

Gets a list of key groups. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a subsequent request tha

list-key-value-stores

Specifies the key value stores to list.

list-origin-access-controls

Gets the list of CloudFront origin access controls (OACs) in this Amazon Web Services account. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is pag

list-origin-request-policies

Gets a list of origin request policies. You can optionally apply a filter to return only the managed policies created by Amazon Web Services, or only the custom policies created in your Amazon Web Services account. You can optionally specify the maximum number of items to receive in the response. If

list-public-keys

List all public keys that have been added to CloudFront for this account.

list-realtime-log-configs

Gets a list of real-time log configurations. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a subs

list-response-headers-policies

Gets a list of response headers policies. You can optionally apply a filter to get only the managed policies created by Amazon Web Services, or only the custom policies created in your Amazon Web Services account. You can optionally specify the maximum number of items to receive in the response. If

list-streaming-distributions

List streaming distributions.

list-tags-for-resource

List tags for a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide.

list-trust-stores

Lists trust stores.

list-vpc-origins

List the CloudFront VPC origins in your account.

publish-connection-function

Publishes a connection function.

publish-function

Publishes a CloudFront function by copying the function code from the DEVELOPMENT stage to LIVE. This automatically updates all cache behaviors that are using this function to use the newly published copy in the LIVE stage. When a function is published to the LIVE stage, you can attach the function

put-resource-policy

Creates a resource control policy for a given CloudFront resource.

tag-resource

Add tags to a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide.

test-connection-function

Tests a connection function.

test-function

Tests a CloudFront function. To test a function, you provide an event object that represents an HTTP request or response that your CloudFront distribution could receive in production. CloudFront runs the function, passing it the event object that you provided, and returns the function's result (the

untag-resource

Remove tags from a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide.

update-anycast-ip-list

Updates an Anycast static IP list.

update-cache-policy

Updates a cache policy configuration. When you update a cache policy configuration, all the fields are updated with the values provided in the request. You cannot update some fields independent of others. To update a cache policy configuration: Use GetCachePolicyConfig to get the current configura

update-cloud-front-origin-access-identity

Update an origin access identity.

update-connection-function

Updates a connection function.

update-connection-group

Updates a connection group.

update-continuous-deployment-policy

Updates a continuous deployment policy. You can update a continuous deployment policy to enable or disable it, to change the percentage of traffic that it sends to the staging distribution, or to change the staging distribution that it sends traffic to. When you update a continuous deployment policy

update-distribution

Updates the configuration for a CloudFront distribution. The update process includes getting the current distribution configuration, updating it to make your changes, and then submitting an UpdateDistribution request to make the updates. To update a web distribution using the CloudFront API Use

update-distribution-tenant

Updates a distribution tenant.

update-distribution-with-staging-config

Copies the staging distribution's configuration to its corresponding primary distribution. The primary distribution retains its Aliases (also known as alternate domain names or CNAMEs) and ContinuousDeploymentPolicyId value, but otherwise its configuration is overwritten to match the staging distrib

update-domain-association

We recommend that you use the UpdateDomainAssociation API operation to move a domain association, as it supports both standard distributions and distribution tenants. AssociateAlias performs similar checks but only supports standard distributions. Moves a domain from its current standard distribut

update-field-level-encryption-config

Update a field-level encryption configuration.

update-field-level-encryption-profile

Update a field-level encryption profile.

update-function

Updates a CloudFront function. You can update a function's code or the comment that describes the function. You cannot update a function's name. To update a function, you provide the function's name and version (ETag value) along with the updated function code. To get the name and version, you can u

update-key-group

Updates a key group. When you update a key group, all the fields are updated with the values provided in the request. You cannot update some fields independent of others. To update a key group: Get the current key group with GetKeyGroup or GetKeyGroupConfig. Locally modify the fields in the key

update-key-value-store

Specifies the key value store to update.

update-origin-access-control

Updates a CloudFront origin access control.

update-origin-request-policy

Updates an origin request policy configuration. When you update an origin request policy configuration, all the fields are updated with the values provided in the request. You cannot update some fields independent of others. To update an origin request policy configuration: Use GetOriginRequestPol

update-public-key

Update public key information. Note that the only value you can change is the comment.

update-realtime-log-config

Updates a real-time log configuration. When you update a real-time log configuration, all the parameters are updated with the values provided in the request. You cannot update some parameters independent of others. To update a real-time log configuration: Call GetRealtimeLogConfig to get the curre

update-response-headers-policy

Updates a response headers policy. When you update a response headers policy, the entire policy is replaced. You cannot update some policy fields independent of others. To update a response headers policy configuration: Use GetResponseHeadersPolicyConfig to get the current policy's configuration.

update-streaming-distribution

Update a streaming distribution.

update-trust-store

Updates a trust store.

update-vpc-origin

Update an Amazon CloudFront VPC origin in your account.

verify-dns-configuration

Verify the DNS configuration for your domain names. This API operation checks whether your domain name points to the correct routing endpoint of the connection group, such as d111111abcdef8.cloudfront.net. You can use this API operation to troubleshoot and resolve DNS configuration issues.

Get the Amazon CloudFront Cheat Sheet

Everything you need to know about Amazon CloudFront on one page. HD quality, print-friendly.

Download Free Infographic

Get the Amazon CloudFront Cheat Sheet

Everything you need to know about Amazon CloudFront on one page. HD quality, print-friendly.

Download Free Infographic

Quick Stats

Total Commands167
ServiceCloudFront