Skip to content

Client

cloudfront R Documentation

Amazon CloudFront

Description

This is the Amazon CloudFront API Reference. This guide is for developers who need detailed information about CloudFront API actions, data types, and errors. For detailed information about CloudFront features, see the Amazon CloudFront Developer Guide.

Usage

cloudfront(
  config = list(),
  credentials = list(),
  endpoint = NULL,
  region = NULL
)

Arguments

config

Optional configuration of credentials, endpoint, and/or region.

  • credentials:

    • creds:

      • access_key_id: AWS access key ID

      • secret_access_key: AWS secret access key

      • session_token: AWS temporary session token

    • profile: The name of a profile to use. If not given, then the default profile is used.

    • anonymous: Set anonymous credentials.

  • endpoint: The complete URL to use for the constructed client.

  • region: The AWS Region used in instantiating the client.

  • close_connection: Immediately close all HTTP connections.

  • timeout: The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.

  • s3_force_path_style: Set this to true to force the request to use path-style addressing, i.e. ⁠http://s3.amazonaws.com/BUCKET/KEY⁠.

  • sts_regional_endpoint: Set sts regional endpoint resolver to regional or legacy https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html

credentials

Optional credentials shorthand for the config parameter

  • creds:

    • access_key_id: AWS access key ID

    • secret_access_key: AWS secret access key

    • session_token: AWS temporary session token

  • profile: The name of a profile to use. If not given, then the default profile is used.

  • anonymous: Set anonymous credentials.

endpoint

Optional shorthand for complete URL to use for the constructed client.

region

Optional shorthand for AWS Region used in instantiating the client.

Value

A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.

Service syntax

svc <- cloudfront(
  config = list(
    credentials = list(
      creds = list(
        access_key_id = "string",
        secret_access_key = "string",
        session_token = "string"
      ),
      profile = "string",
      anonymous = "logical"
    ),
    endpoint = "string",
    region = "string",
    close_connection = "logical",
    timeout = "numeric",
    s3_force_path_style = "logical",
    sts_regional_endpoint = "string"
  ),
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string",
    anonymous = "logical"
  ),
  endpoint = "string",
  region = "string"
)

Operations

associate_alias
Associates an alias (also known as a CNAME or an alternate domain name) with a CloudFront distribution
copy_distribution
Creates a staging distribution using the configuration of the provided primary distribution
create_cache_policy
Creates a cache policy
create_cloud_front_origin_access_identity
Creates a new origin access identity
create_continuous_deployment_policy
Creates a continuous deployment policy that distributes traffic for a custom domain name to two different CloudFront distributions
create_distribution
Creates a CloudFront distribution
create_distribution_with_tags
Create a new distribution with tags
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
create_invalidation
Create a new invalidation
create_key_group
Creates a key group that you can use with CloudFront signed URLs and signed cookies
create_key_value_store
Specifies the Key Value Store resource to add to your account
create_monitoring_subscription
Enables additional CloudWatch metrics for the specified CloudFront distribution
create_origin_access_control
Creates a new origin access control in CloudFront
create_origin_request_policy
Creates an origin request policy
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
create_response_headers_policy
Creates a response headers policy
create_streaming_distribution
This API is deprecated
create_streaming_distribution_with_tags
This API is deprecated
delete_cache_policy
Deletes a cache policy
delete_cloud_front_origin_access_identity
Delete an origin access identity
delete_continuous_deployment_policy
Deletes a continuous deployment policy
delete_distribution
Delete a distribution
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
delete_key_group
Deletes a key group
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
delete_origin_request_policy
Deletes an origin request policy
delete_public_key
Remove a public key you previously added to CloudFront
delete_realtime_log_config
Deletes a real-time log configuration
delete_response_headers_policy
Deletes a response headers policy
delete_streaming_distribution
Delete a streaming distribution
describe_function
Gets configuration information and metadata about a CloudFront function, but not the function's code
describe_key_value_store
Specifies the Key Value Store and its configuration
get_cache_policy
Gets a cache policy, including the following metadata:
get_cache_policy_config
Gets a cache policy configuration
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_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_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
get_invalidation
Get the information about an invalidation
get_key_group
Gets a key group, including the date and time when the key group was last modified
get_key_group_config
Gets a key group configuration
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:
get_origin_request_policy_config
Gets an origin request policy configuration
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
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)
get_response_headers_policy_config
Gets a response headers policy configuration
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
list_cache_policies
Gets a list of cache policies
list_cloud_front_origin_access_identities
Lists origin access identities
list_conflicting_aliases
Gets a list of aliases (also called CNAMEs or alternate domain names) that conflict or overlap with the provided alias, and the associated CloudFront distributions and Amazon Web Services accounts for each conflicting alias
list_continuous_deployment_policies
Gets a list of the continuous deployment policies in your Amazon Web Services account
list_distributions
List CloudFront distributions
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
list_distributions_by_key_group
Gets a list of distribution IDs for distributions that have a cache behavior that references the specified key group
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
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
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
list_distributions_by_web_acl_id
List the distributions that are associated with a specified WAF web ACL
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
list_invalidations
Lists invalidation batches
list_key_groups
Gets a list of key groups
list_key_value_stores
Specifies the Key Value Stores to list
list_origin_access_controls
Gets the list of CloudFront origin access controls in this Amazon Web Services account
list_origin_request_policies
Gets a list of origin request policies
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
list_response_headers_policies
Gets a list of response headers policies
list_streaming_distributions
List streaming distributions
list_tags_for_resource
List tags for a CloudFront resource
publish_function
Publishes a CloudFront function by copying the function code from the DEVELOPMENT stage to LIVE
tag_resource
Add tags to a CloudFront resource
test_function
Tests a CloudFront function
untag_resource
Remove tags from a CloudFront resource
update_cache_policy
Updates a cache policy configuration
update_cloud_front_origin_access_identity
Update an origin access identity
update_continuous_deployment_policy
Updates a continuous deployment policy
update_distribution
Updates the configuration for a CloudFront distribution
update_distribution_with_staging_config
Copies the staging distribution's configuration to its corresponding primary distribution
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
update_key_group
Updates a key group
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
update_public_key
Update public key information
update_realtime_log_config
Updates a real-time log configuration
update_response_headers_policy
Updates a response headers policy
update_streaming_distribution
Update a streaming distribution

Examples

## Not run: 
svc <- cloudfront()
# Use the following command to create a function.
svc$create_function(
  FunctionCode = "function-code.js",
  FunctionConfig = list(
    Comment = "my-function-comment",
    KeyValueStoreAssociations = list(
      Items = list(
        list(
          KeyValueStoreARN = "arn:aws:cloudfront::123456789012:key-value-st..."
        )
      ),
      Quantity = 1L
    ),
    Runtime = "cloudfront-js-2.0"
  ),
  Name = "my-function-name"
)

## End(Not run)