Class: Aws::CloudFront::Client

Inherits:
Seahorse::Client::Base show all
Includes:
Aws::ClientStubs
Defined in:
gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb

Overview

An API client for CloudFront. To construct a client, you need to configure a :region and :credentials.

client = Aws::CloudFront::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

See #initialize for a full list of supported configuration options.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from Aws::ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []]

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, :session_token, and :account_id options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'], ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentials or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP)

    Normally you should not configure the :endpoint option directly. This is normally constructed from the :region option. Configuring :endpoint is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array)

    A list of regions that should be signed with SigV4a signing. When not passed, a default :sigv4a_signing_region_set is searched for in the following locations:

    • Aws.config[:sigv4a_signing_region_set]
    • ENV['AWS_SIGV4A_SIGNING_REGION_SET']
    • ~/.aws/config
  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling Aws::ClientStubs#stub_responses. See Aws::ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses NoOpTelemetryProvider which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the opentelemetry-sdk gem and then, pass in an instance of a Aws::Telemetry::OTelProvider for telemetry provider.
  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::CloudFront::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::CloudFront::EndpointParameters.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :on_chunk_received (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a content-length).

  • :on_chunk_sent (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_store (String)

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate)

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey)

    Sets a client key when creating http connections.

  • :ssl_timeout (Float)

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.



444
445
446
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 444

def initialize(*args)
  super
end

Instance Method Details

#associate_alias(params = {}) ⇒ Struct

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

With this operation you can move an alias that's already in use on a CloudFront distribution to a different distribution in one step. This prevents the downtime that could occur if you first remove the alias from one distribution and then separately add the alias to another distribution.

To use this operation to associate an alias with a distribution, you provide the alias and the ID of the target distribution for the alias. For more information, including how to set up the target distribution, prerequisites that you must complete, and other restrictions, see Moving an alternate domain name to a different distribution in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.associate_alias({
  target_distribution_id: "string", # required
  alias: "string", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :target_distribution_id (required, String)

    The ID of the distribution that you're associating the alias with.

  • :alias (required, String)

    The alias (also known as a CNAME) to add to the target distribution.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



489
490
491
492
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 489

def associate_alias(params = {}, options = {})
  req = build_request(:associate_alias, params)
  req.send_request(options)
end

#copy_distribution(params = {}) ⇒ Types::CopyDistributionResult

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 UpdateDistribution to modify the staging distribution's configuration. Then you can use CreateContinuousDeploymentPolicy to incrementally move traffic to the staging distribution.

This API operation requires the following IAM permissions:

Examples:

Request syntax with placeholder values


resp = client.copy_distribution({
  primary_distribution_id: "string", # required
  staging: false,
  if_match: "string",
  caller_reference: "string", # required
  enabled: false,
})

Response structure


resp.distribution.id #=> String
resp.distribution.arn #=> String
resp.distribution.status #=> String
resp.distribution.last_modified_time #=> Time
resp.distribution.in_progress_invalidation_batches #=> Integer
resp.distribution.domain_name #=> String
resp.distribution.active_trusted_signers.enabled #=> Boolean
resp.distribution.active_trusted_signers.quantity #=> Integer
resp.distribution.active_trusted_signers.items #=> Array
resp.distribution.active_trusted_signers.items[0]. #=> String
resp.distribution.active_trusted_signers.items[0].key_pair_ids.quantity #=> Integer
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items #=> Array
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items[0] #=> String
resp.distribution.active_trusted_key_groups.enabled #=> Boolean
resp.distribution.active_trusted_key_groups.quantity #=> Integer
resp.distribution.active_trusted_key_groups.items #=> Array
resp.distribution.active_trusted_key_groups.items[0].key_group_id #=> String
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.quantity #=> Integer
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.items #=> Array
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.items[0] #=> String
resp.distribution.distribution_config.caller_reference #=> String
resp.distribution.distribution_config.aliases.quantity #=> Integer
resp.distribution.distribution_config.aliases.items #=> Array
resp.distribution.distribution_config.aliases.items[0] #=> String
resp.distribution.distribution_config.default_root_object #=> String
resp.distribution.distribution_config.origins.quantity #=> Integer
resp.distribution.distribution_config.origins.items #=> Array
resp.distribution.distribution_config.origins.items[0].id #=> String
resp.distribution.distribution_config.origins.items[0].domain_name #=> String
resp.distribution.distribution_config.origins.items[0].origin_path #=> String
resp.distribution.distribution_config.origins.items[0].custom_headers.quantity #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_headers.items #=> Array
resp.distribution.distribution_config.origins.items[0].custom_headers.items[0].header_name #=> String
resp.distribution.distribution_config.origins.items[0].custom_headers.items[0].header_value #=> String
resp.distribution.distribution_config.origins.items[0].s3_origin_config.origin_access_identity #=> String
resp.distribution.distribution_config.origins.items[0].custom_origin_config.http_port #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.https_port #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_protocol_policy #=> String, one of "http-only", "match-viewer", "https-only"
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.quantity #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.items #=> Array
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.items[0] #=> String, one of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_read_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_keepalive_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].connection_attempts #=> Integer
resp.distribution.distribution_config.origins.items[0].connection_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].origin_shield.enabled #=> Boolean
resp.distribution.distribution_config.origins.items[0].origin_shield.origin_shield_region #=> String
resp.distribution.distribution_config.origins.items[0].origin_access_control_id #=> String
resp.distribution.distribution_config.origin_groups.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].id #=> String
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.items[0] #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].members.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].members.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].members.items[0].origin_id #=> String
resp.distribution.distribution_config.default_cache_behavior.target_origin_id #=> String
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.enabled #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.enabled #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.viewer_protocol_policy #=> String, one of "allow-all", "https-only", "redirect-to-https"
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.default_cache_behavior.smooth_streaming #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.compress #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.function_associations.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.default_cache_behavior.field_level_encryption_id #=> String
resp.distribution.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.cache_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.origin_request_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.response_headers_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.forward #=> String, one of "none", "whitelist", "all"
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.min_ttl #=> Integer
resp.distribution.distribution_config.default_cache_behavior.default_ttl #=> Integer
resp.distribution.distribution_config.default_cache_behavior.max_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].path_pattern #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].target_origin_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.enabled #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.enabled #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].viewer_protocol_policy #=> String, one of "allow-all", "https-only", "redirect-to-https"
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.cache_behaviors.items[0].smooth_streaming #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].compress #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].response_headers_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.forward #=> String, one of "none", "whitelist", "all"
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].min_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].default_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].max_ttl #=> Integer
resp.distribution.distribution_config.custom_error_responses.quantity #=> Integer
resp.distribution.distribution_config.custom_error_responses.items #=> Array
resp.distribution.distribution_config.custom_error_responses.items[0].error_code #=> Integer
resp.distribution.distribution_config.custom_error_responses.items[0].response_page_path #=> String
resp.distribution.distribution_config.custom_error_responses.items[0].response_code #=> String
resp.distribution.distribution_config.custom_error_responses.items[0].error_caching_min_ttl #=> Integer
resp.distribution.distribution_config.comment #=> String
resp.distribution.distribution_config.logging.enabled #=> Boolean
resp.distribution.distribution_config.logging.include_cookies #=> Boolean
resp.distribution.distribution_config.logging.bucket #=> String
resp.distribution.distribution_config.logging.prefix #=> String
resp.distribution.distribution_config.price_class #=> String, one of "PriceClass_100", "PriceClass_200", "PriceClass_All"
resp.distribution.distribution_config.enabled #=> Boolean
resp.distribution.distribution_config.viewer_certificate.cloud_front_default_certificate #=> Boolean
resp.distribution.distribution_config.viewer_certificate.iam_certificate_id #=> String
resp.distribution.distribution_config.viewer_certificate.acm_certificate_arn #=> String
resp.distribution.distribution_config.viewer_certificate.ssl_support_method #=> String, one of "sni-only", "vip", "static-ip"
resp.distribution.distribution_config.viewer_certificate.minimum_protocol_version #=> String, one of "SSLv3", "TLSv1", "TLSv1_2016", "TLSv1.1_2016", "TLSv1.2_2018", "TLSv1.2_2019", "TLSv1.2_2021"
resp.distribution.distribution_config.viewer_certificate.certificate #=> String
resp.distribution.distribution_config.viewer_certificate.certificate_source #=> String, one of "cloudfront", "iam", "acm"
resp.distribution.distribution_config.restrictions.geo_restriction.restriction_type #=> String, one of "blacklist", "whitelist", "none"
resp.distribution.distribution_config.restrictions.geo_restriction.quantity #=> Integer
resp.distribution.distribution_config.restrictions.geo_restriction.items #=> Array
resp.distribution.distribution_config.restrictions.geo_restriction.items[0] #=> String
resp.distribution.distribution_config.web_acl_id #=> String
resp.distribution.distribution_config.http_version #=> String, one of "http1.1", "http2", "http3", "http2and3"
resp.distribution.distribution_config.is_ipv6_enabled #=> Boolean
resp.distribution.distribution_config.continuous_deployment_policy_id #=> String
resp.distribution.distribution_config.staging #=> Boolean
resp.distribution.alias_icp_recordals #=> Array
resp.distribution.alias_icp_recordals[0].cname #=> String
resp.distribution.alias_icp_recordals[0].icp_recordal_status #=> String, one of "APPROVED", "SUSPENDED", "PENDING"
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :primary_distribution_id (required, String)

    The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use ListDistributions.

  • :staging (Boolean)

    The type of distribution that your primary distribution will be copied to. The only valid value is True, indicating that you are copying to a staging distribution.

  • :if_match (String)

    The version identifier of the primary distribution whose configuration you are copying. This is the ETag value returned in the response to GetDistribution and GetDistributionConfig.

  • :caller_reference (required, String)

    A value that uniquely identifies a request to create a resource. This helps to prevent CloudFront from creating a duplicate resource if you accidentally resubmit an identical request.

  • :enabled (Boolean)

    A Boolean flag to specify the state of the staging distribution when it's created. When you set this value to True, the staging distribution is enabled. When you set this value to False, the staging distribution is disabled.

    If you omit this field, the default value is True.

Returns:

See Also:



754
755
756
757
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 754

def copy_distribution(params = {}, options = {})
  req = build_request(:copy_distribution, params)
  req.send_request(options)
end

#create_cache_policy(params = {}) ⇒ Types::CreateCachePolicyResult

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 URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer.

  • The default, minimum, and maximum time to live (TTL) values that you want objects to stay in the CloudFront cache.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find an object in its cache that matches the request's cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy.

For more information about cache policies, see Controlling the cache key in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_cache_policy({
  cache_policy_config: { # required
    comment: "string",
    name: "string", # required
    default_ttl: 1,
    max_ttl: 1,
    min_ttl: 1, # required
    parameters_in_cache_key_and_forwarded_to_origin: {
      enable_accept_encoding_gzip: false, # required
      enable_accept_encoding_brotli: false,
      headers_config: { # required
        header_behavior: "none", # required, accepts none, whitelist
        headers: {
          quantity: 1, # required
          items: ["string"],
        },
      },
      cookies_config: { # required
        cookie_behavior: "none", # required, accepts none, whitelist, allExcept, all
        cookies: {
          quantity: 1, # required
          items: ["string"],
        },
      },
      query_strings_config: { # required
        query_string_behavior: "none", # required, accepts none, whitelist, allExcept, all
        query_strings: {
          quantity: 1, # required
          items: ["string"],
        },
      },
    },
  },
})

Response structure


resp.cache_policy.id #=> String
resp.cache_policy.last_modified_time #=> Time
resp.cache_policy.cache_policy_config.comment #=> String
resp.cache_policy.cache_policy_config.name #=> String
resp.cache_policy.cache_policy_config.default_ttl #=> Integer
resp.cache_policy.cache_policy_config.max_ttl #=> Integer
resp.cache_policy.cache_policy_config.min_ttl #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.enable_accept_encoding_gzip #=> Boolean
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.enable_accept_encoding_brotli #=> Boolean
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.header_behavior #=> String, one of "none", "whitelist"
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.quantity #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.items #=> Array
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.items[0] #=> String
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookie_behavior #=> String, one of "none", "whitelist", "allExcept", "all"
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.quantity #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.items #=> Array
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.items[0] #=> String
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_string_behavior #=> String, one of "none", "whitelist", "allExcept", "all"
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.quantity #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.items #=> Array
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.items[0] #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



863
864
865
866
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 863

def create_cache_policy(params = {}, options = {})
  req = build_request(:create_cache_policy, params)
  req.send_request(options)
end

#create_cloud_front_origin_access_identity(params = {}) ⇒ Types::CreateCloudFrontOriginAccessIdentityResult

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 Content through CloudFront in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_cloud_front_origin_access_identity({
  cloud_front_origin_access_identity_config: { # required
    caller_reference: "string", # required
    comment: "string", # required
  },
})

Response structure


resp.cloud_front_origin_access_identity.id #=> String
resp.cloud_front_origin_access_identity.s3_canonical_user_id #=> String
resp.cloud_front_origin_access_identity.cloud_front_origin_access_identity_config.caller_reference #=> String
resp.cloud_front_origin_access_identity.cloud_front_origin_access_identity_config.comment #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



910
911
912
913
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 910

def create_cloud_front_origin_access_identity(params = {}, options = {})
  req = build_request(:create_cloud_front_origin_access_identity, params)
  req.send_request(options)
end

#create_continuous_deployment_policy(params = {}) ⇒ Types::CreateContinuousDeploymentPolicyResult

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 configuration.

After you create and update a staging distribution, you can use a continuous deployment policy to incrementally move traffic to the staging distribution. This workflow enables you to test changes to a distribution's configuration before moving all of your domain's production traffic to the new configuration.

Examples:

Request syntax with placeholder values


resp = client.create_continuous_deployment_policy({
  continuous_deployment_policy_config: { # required
    staging_distribution_dns_names: { # required
      quantity: 1, # required
      items: ["string"],
    },
    enabled: false, # required
    traffic_config: {
      single_weight_config: {
        weight: 1.0, # required
        session_stickiness_config: {
          idle_ttl: 1, # required
          maximum_ttl: 1, # required
        },
      },
      single_header_config: {
        header: "string", # required
        value: "string", # required
      },
      type: "SingleWeight", # required, accepts SingleWeight, SingleHeader
    },
  },
})

Response structure


resp.continuous_deployment_policy.id #=> String
resp.continuous_deployment_policy.last_modified_time #=> Time
resp.continuous_deployment_policy.continuous_deployment_policy_config.staging_distribution_dns_names.quantity #=> Integer
resp.continuous_deployment_policy.continuous_deployment_policy_config.staging_distribution_dns_names.items #=> Array
resp.continuous_deployment_policy.continuous_deployment_policy_config.staging_distribution_dns_names.items[0] #=> String
resp.continuous_deployment_policy.continuous_deployment_policy_config.enabled #=> Boolean
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_weight_config.weight #=> Float
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_weight_config.session_stickiness_config.idle_ttl #=> Integer
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_weight_config.session_stickiness_config.maximum_ttl #=> Integer
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_header_config.header #=> String
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_header_config.value #=> String
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.type #=> String, one of "SingleWeight", "SingleHeader"
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



984
985
986
987
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 984

def create_continuous_deployment_policy(params = {}, options = {})
  req = build_request(:create_continuous_deployment_policy, params)
  req.send_request(options)
end

#create_distribution(params = {}) ⇒ Types::CreateDistributionResult

Creates a CloudFront distribution.

Examples:

Request syntax with placeholder values


resp = client.create_distribution({
  distribution_config: { # required
    caller_reference: "string", # required
    aliases: {
      quantity: 1, # required
      items: ["string"],
    },
    default_root_object: "string",
    origins: { # required
      quantity: 1, # required
      items: [ # required
        {
          id: "string", # required
          domain_name: "string", # required
          origin_path: "string",
          custom_headers: {
            quantity: 1, # required
            items: [
              {
                header_name: "string", # required
                header_value: "sensitiveStringType", # required
              },
            ],
          },
          s3_origin_config: {
            origin_access_identity: "string", # required
          },
          custom_origin_config: {
            http_port: 1, # required
            https_port: 1, # required
            origin_protocol_policy: "http-only", # required, accepts http-only, match-viewer, https-only
            origin_ssl_protocols: {
              quantity: 1, # required
              items: ["SSLv3"], # required, accepts SSLv3, TLSv1, TLSv1.1, TLSv1.2
            },
            origin_read_timeout: 1,
            origin_keepalive_timeout: 1,
          },
          connection_attempts: 1,
          connection_timeout: 1,
          origin_shield: {
            enabled: false, # required
            origin_shield_region: "OriginShieldRegion",
          },
          origin_access_control_id: "string",
        },
      ],
    },
    origin_groups: {
      quantity: 1, # required
      items: [
        {
          id: "string", # required
          failover_criteria: { # required
            status_codes: { # required
              quantity: 1, # required
              items: [1], # required
            },
          },
          members: { # required
            quantity: 1, # required
            items: [ # required
              {
                origin_id: "string", # required
              },
            ],
          },
        },
      ],
    },
    default_cache_behavior: { # required
      target_origin_id: "string", # required
      trusted_signers: {
        enabled: false, # required
        quantity: 1, # required
        items: ["string"],
      },
      trusted_key_groups: {
        enabled: false, # required
        quantity: 1, # required
        items: ["string"],
      },
      viewer_protocol_policy: "allow-all", # required, accepts allow-all, https-only, redirect-to-https
      allowed_methods: {
        quantity: 1, # required
        items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
        cached_methods: {
          quantity: 1, # required
          items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
        },
      },
      smooth_streaming: false,
      compress: false,
      lambda_function_associations: {
        quantity: 1, # required
        items: [
          {
            lambda_function_arn: "LambdaFunctionARN", # required
            event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
            include_body: false,
          },
        ],
      },
      function_associations: {
        quantity: 1, # required
        items: [
          {
            function_arn: "FunctionARN", # required
            event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
          },
        ],
      },
      field_level_encryption_id: "string",
      realtime_log_config_arn: "string",
      cache_policy_id: "string",
      origin_request_policy_id: "string",
      response_headers_policy_id: "string",
      forwarded_values: {
        query_string: false, # required
        cookies: { # required
          forward: "none", # required, accepts none, whitelist, all
          whitelisted_names: {
            quantity: 1, # required
            items: ["string"],
          },
        },
        headers: {
          quantity: 1, # required
          items: ["string"],
        },
        query_string_cache_keys: {
          quantity: 1, # required
          items: ["string"],
        },
      },
      min_ttl: 1,
      default_ttl: 1,
      max_ttl: 1,
    },
    cache_behaviors: {
      quantity: 1, # required
      items: [
        {
          path_pattern: "string", # required
          target_origin_id: "string", # required
          trusted_signers: {
            enabled: false, # required
            quantity: 1, # required
            items: ["string"],
          },
          trusted_key_groups: {
            enabled: false, # required
            quantity: 1, # required
            items: ["string"],
          },
          viewer_protocol_policy: "allow-all", # required, accepts allow-all, https-only, redirect-to-https
          allowed_methods: {
            quantity: 1, # required
            items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
            cached_methods: {
              quantity: 1, # required
              items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
            },
          },
          smooth_streaming: false,
          compress: false,
          lambda_function_associations: {
            quantity: 1, # required
            items: [
              {
                lambda_function_arn: "LambdaFunctionARN", # required
                event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
                include_body: false,
              },
            ],
          },
          function_associations: {
            quantity: 1, # required
            items: [
              {
                function_arn: "FunctionARN", # required
                event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
              },
            ],
          },
          field_level_encryption_id: "string",
          realtime_log_config_arn: "string",
          cache_policy_id: "string",
          origin_request_policy_id: "string",
          response_headers_policy_id: "string",
          forwarded_values: {
            query_string: false, # required
            cookies: { # required
              forward: "none", # required, accepts none, whitelist, all
              whitelisted_names: {
                quantity: 1, # required
                items: ["string"],
              },
            },
            headers: {
              quantity: 1, # required
              items: ["string"],
            },
            query_string_cache_keys: {
              quantity: 1, # required
              items: ["string"],
            },
          },
          min_ttl: 1,
          default_ttl: 1,
          max_ttl: 1,
        },
      ],
    },
    custom_error_responses: {
      quantity: 1, # required
      items: [
        {
          error_code: 1, # required
          response_page_path: "string",
          response_code: "string",
          error_caching_min_ttl: 1,
        },
      ],
    },
    comment: "CommentType", # required
    logging: {
      enabled: false, # required
      include_cookies: false, # required
      bucket: "string", # required
      prefix: "string", # required
    },
    price_class: "PriceClass_100", # accepts PriceClass_100, PriceClass_200, PriceClass_All
    enabled: false, # required
    viewer_certificate: {
      cloud_front_default_certificate: false,
      iam_certificate_id: "string",
      acm_certificate_arn: "string",
      ssl_support_method: "sni-only", # accepts sni-only, vip, static-ip
      minimum_protocol_version: "SSLv3", # accepts SSLv3, TLSv1, TLSv1_2016, TLSv1.1_2016, TLSv1.2_2018, TLSv1.2_2019, TLSv1.2_2021
      certificate: "string",
      certificate_source: "cloudfront", # accepts cloudfront, iam, acm
    },
    restrictions: {
      geo_restriction: { # required
        restriction_type: "blacklist", # required, accepts blacklist, whitelist, none
        quantity: 1, # required
        items: ["string"],
      },
    },
    web_acl_id: "string",
    http_version: "http1.1", # accepts http1.1, http2, http3, http2and3
    is_ipv6_enabled: false,
    continuous_deployment_policy_id: "string",
    staging: false,
  },
})

Response structure


resp.distribution.id #=> String
resp.distribution.arn #=> String
resp.distribution.status #=> String
resp.distribution.last_modified_time #=> Time
resp.distribution.in_progress_invalidation_batches #=> Integer
resp.distribution.domain_name #=> String
resp.distribution.active_trusted_signers.enabled #=> Boolean
resp.distribution.active_trusted_signers.quantity #=> Integer
resp.distribution.active_trusted_signers.items #=> Array
resp.distribution.active_trusted_signers.items[0]. #=> String
resp.distribution.active_trusted_signers.items[0].key_pair_ids.quantity #=> Integer
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items #=> Array
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items[0] #=> String
resp.distribution.active_trusted_key_groups.enabled #=> Boolean
resp.distribution.active_trusted_key_groups.quantity #=> Integer
resp.distribution.active_trusted_key_groups.items #=> Array
resp.distribution.active_trusted_key_groups.items[0].key_group_id #=> String
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.quantity #=> Integer
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.items #=> Array
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.items[0] #=> String
resp.distribution.distribution_config.caller_reference #=> String
resp.distribution.distribution_config.aliases.quantity #=> Integer
resp.distribution.distribution_config.aliases.items #=> Array
resp.distribution.distribution_config.aliases.items[0] #=> String
resp.distribution.distribution_config.default_root_object #=> String
resp.distribution.distribution_config.origins.quantity #=> Integer
resp.distribution.distribution_config.origins.items #=> Array
resp.distribution.distribution_config.origins.items[0].id #=> String
resp.distribution.distribution_config.origins.items[0].domain_name #=> String
resp.distribution.distribution_config.origins.items[0].origin_path #=> String
resp.distribution.distribution_config.origins.items[0].custom_headers.quantity #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_headers.items #=> Array
resp.distribution.distribution_config.origins.items[0].custom_headers.items[0].header_name #=> String
resp.distribution.distribution_config.origins.items[0].custom_headers.items[0].header_value #=> String
resp.distribution.distribution_config.origins.items[0].s3_origin_config.origin_access_identity #=> String
resp.distribution.distribution_config.origins.items[0].custom_origin_config.http_port #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.https_port #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_protocol_policy #=> String, one of "http-only", "match-viewer", "https-only"
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.quantity #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.items #=> Array
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.items[0] #=> String, one of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_read_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_keepalive_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].connection_attempts #=> Integer
resp.distribution.distribution_config.origins.items[0].connection_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].origin_shield.enabled #=> Boolean
resp.distribution.distribution_config.origins.items[0].origin_shield.origin_shield_region #=> String
resp.distribution.distribution_config.origins.items[0].origin_access_control_id #=> String
resp.distribution.distribution_config.origin_groups.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].id #=> String
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.items[0] #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].members.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].members.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].members.items[0].origin_id #=> String
resp.distribution.distribution_config.default_cache_behavior.target_origin_id #=> String
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.enabled #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.enabled #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.viewer_protocol_policy #=> String, one of "allow-all", "https-only", "redirect-to-https"
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.default_cache_behavior.smooth_streaming #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.compress #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.function_associations.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.default_cache_behavior.field_level_encryption_id #=> String
resp.distribution.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.cache_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.origin_request_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.response_headers_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.forward #=> String, one of "none", "whitelist", "all"
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.min_ttl #=> Integer
resp.distribution.distribution_config.default_cache_behavior.default_ttl #=> Integer
resp.distribution.distribution_config.default_cache_behavior.max_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].path_pattern #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].target_origin_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.enabled #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.enabled #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].viewer_protocol_policy #=> String, one of "allow-all", "https-only", "redirect-to-https"
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.cache_behaviors.items[0].smooth_streaming #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].compress #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].response_headers_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.forward #=> String, one of "none", "whitelist", "all"
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].min_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].default_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].max_ttl #=> Integer
resp.distribution.distribution_config.custom_error_responses.quantity #=> Integer
resp.distribution.distribution_config.custom_error_responses.items #=> Array
resp.distribution.distribution_config.custom_error_responses.items[0].error_code #=> Integer
resp.distribution.distribution_config.custom_error_responses.items[0].response_page_path #=> String
resp.distribution.distribution_config.custom_error_responses.items[0].response_code #=> String
resp.distribution.distribution_config.custom_error_responses.items[0].error_caching_min_ttl #=> Integer
resp.distribution.distribution_config.comment #=> String
resp.distribution.distribution_config.logging.enabled #=> Boolean
resp.distribution.distribution_config.logging.include_cookies #=> Boolean
resp.distribution.distribution_config.logging.bucket #=> String
resp.distribution.distribution_config.logging.prefix #=> String
resp.distribution.distribution_config.price_class #=> String, one of "PriceClass_100", "PriceClass_200", "PriceClass_All"
resp.distribution.distribution_config.enabled #=> Boolean
resp.distribution.distribution_config.viewer_certificate.cloud_front_default_certificate #=> Boolean
resp.distribution.distribution_config.viewer_certificate.iam_certificate_id #=> String
resp.distribution.distribution_config.viewer_certificate.acm_certificate_arn #=> String
resp.distribution.distribution_config.viewer_certificate.ssl_support_method #=> String, one of "sni-only", "vip", "static-ip"
resp.distribution.distribution_config.viewer_certificate.minimum_protocol_version #=> String, one of "SSLv3", "TLSv1", "TLSv1_2016", "TLSv1.1_2016", "TLSv1.2_2018", "TLSv1.2_2019", "TLSv1.2_2021"
resp.distribution.distribution_config.viewer_certificate.certificate #=> String
resp.distribution.distribution_config.viewer_certificate.certificate_source #=> String, one of "cloudfront", "iam", "acm"
resp.distribution.distribution_config.restrictions.geo_restriction.restriction_type #=> String, one of "blacklist", "whitelist", "none"
resp.distribution.distribution_config.restrictions.geo_restriction.quantity #=> Integer
resp.distribution.distribution_config.restrictions.geo_restriction.items #=> Array
resp.distribution.distribution_config.restrictions.geo_restriction.items[0] #=> String
resp.distribution.distribution_config.web_acl_id #=> String
resp.distribution.distribution_config.http_version #=> String, one of "http1.1", "http2", "http3", "http2and3"
resp.distribution.distribution_config.is_ipv6_enabled #=> Boolean
resp.distribution.distribution_config.continuous_deployment_policy_id #=> String
resp.distribution.distribution_config.staging #=> Boolean
resp.distribution.alias_icp_recordals #=> Array
resp.distribution.alias_icp_recordals[0].cname #=> String
resp.distribution.alias_icp_recordals[0].icp_recordal_status #=> String, one of "APPROVED", "SUSPENDED", "PENDING"
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



1453
1454
1455
1456
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 1453

def create_distribution(params = {}, options = {})
  req = build_request(:create_distribution, params)
  req.send_request(options)
end

#create_distribution_with_tags(params = {}) ⇒ Types::CreateDistributionWithTagsResult

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

Examples:

Request syntax with placeholder values


resp = client.create_distribution_with_tags({
  distribution_config_with_tags: { # required
    distribution_config: { # required
      caller_reference: "string", # required
      aliases: {
        quantity: 1, # required
        items: ["string"],
      },
      default_root_object: "string",
      origins: { # required
        quantity: 1, # required
        items: [ # required
          {
            id: "string", # required
            domain_name: "string", # required
            origin_path: "string",
            custom_headers: {
              quantity: 1, # required
              items: [
                {
                  header_name: "string", # required
                  header_value: "sensitiveStringType", # required
                },
              ],
            },
            s3_origin_config: {
              origin_access_identity: "string", # required
            },
            custom_origin_config: {
              http_port: 1, # required
              https_port: 1, # required
              origin_protocol_policy: "http-only", # required, accepts http-only, match-viewer, https-only
              origin_ssl_protocols: {
                quantity: 1, # required
                items: ["SSLv3"], # required, accepts SSLv3, TLSv1, TLSv1.1, TLSv1.2
              },
              origin_read_timeout: 1,
              origin_keepalive_timeout: 1,
            },
            connection_attempts: 1,
            connection_timeout: 1,
            origin_shield: {
              enabled: false, # required
              origin_shield_region: "OriginShieldRegion",
            },
            origin_access_control_id: "string",
          },
        ],
      },
      origin_groups: {
        quantity: 1, # required
        items: [
          {
            id: "string", # required
            failover_criteria: { # required
              status_codes: { # required
                quantity: 1, # required
                items: [1], # required
              },
            },
            members: { # required
              quantity: 1, # required
              items: [ # required
                {
                  origin_id: "string", # required
                },
              ],
            },
          },
        ],
      },
      default_cache_behavior: { # required
        target_origin_id: "string", # required
        trusted_signers: {
          enabled: false, # required
          quantity: 1, # required
          items: ["string"],
        },
        trusted_key_groups: {
          enabled: false, # required
          quantity: 1, # required
          items: ["string"],
        },
        viewer_protocol_policy: "allow-all", # required, accepts allow-all, https-only, redirect-to-https
        allowed_methods: {
          quantity: 1, # required
          items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
          cached_methods: {
            quantity: 1, # required
            items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
          },
        },
        smooth_streaming: false,
        compress: false,
        lambda_function_associations: {
          quantity: 1, # required
          items: [
            {
              lambda_function_arn: "LambdaFunctionARN", # required
              event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
              include_body: false,
            },
          ],
        },
        function_associations: {
          quantity: 1, # required
          items: [
            {
              function_arn: "FunctionARN", # required
              event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
            },
          ],
        },
        field_level_encryption_id: "string",
        realtime_log_config_arn: "string",
        cache_policy_id: "string",
        origin_request_policy_id: "string",
        response_headers_policy_id: "string",
        forwarded_values: {
          query_string: false, # required
          cookies: { # required
            forward: "none", # required, accepts none, whitelist, all
            whitelisted_names: {
              quantity: 1, # required
              items: ["string"],
            },
          },
          headers: {
            quantity: 1, # required
            items: ["string"],
          },
          query_string_cache_keys: {
            quantity: 1, # required
            items: ["string"],
          },
        },
        min_ttl: 1,
        default_ttl: 1,
        max_ttl: 1,
      },
      cache_behaviors: {
        quantity: 1, # required
        items: [
          {
            path_pattern: "string", # required
            target_origin_id: "string", # required
            trusted_signers: {
              enabled: false, # required
              quantity: 1, # required
              items: ["string"],
            },
            trusted_key_groups: {
              enabled: false, # required
              quantity: 1, # required
              items: ["string"],
            },
            viewer_protocol_policy: "allow-all", # required, accepts allow-all, https-only, redirect-to-https
            allowed_methods: {
              quantity: 1, # required
              items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
              cached_methods: {
                quantity: 1, # required
                items: ["GET"], # required, accepts GET, HEAD, POST, PUT, PATCH, OPTIONS, DELETE
              },
            },
            smooth_streaming: false,
            compress: false,
            lambda_function_associations: {
              quantity: 1, # required
              items: [
                {
                  lambda_function_arn: "LambdaFunctionARN", # required
                  event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
                  include_body: false,
                },
              ],
            },
            function_associations: {
              quantity: 1, # required
              items: [
                {
                  function_arn: "FunctionARN", # required
                  event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response
                },
              ],
            },
            field_level_encryption_id: "string",
            realtime_log_config_arn: "string",
            cache_policy_id: "string",
            origin_request_policy_id: "string",
            response_headers_policy_id: "string",
            forwarded_values: {
              query_string: false, # required
              cookies: { # required
                forward: "none", # required, accepts none, whitelist, all
                whitelisted_names: {
                  quantity: 1, # required
                  items: ["string"],
                },
              },
              headers: {
                quantity: 1, # required
                items: ["string"],
              },
              query_string_cache_keys: {
                quantity: 1, # required
                items: ["string"],
              },
            },
            min_ttl: 1,
            default_ttl: 1,
            max_ttl: 1,
          },
        ],
      },
      custom_error_responses: {
        quantity: 1, # required
        items: [
          {
            error_code: 1, # required
            response_page_path: "string",
            response_code: "string",
            error_caching_min_ttl: 1,
          },
        ],
      },
      comment: "CommentType", # required
      logging: {
        enabled: false, # required
        include_cookies: false, # required
        bucket: "string", # required
        prefix: "string", # required
      },
      price_class: "PriceClass_100", # accepts PriceClass_100, PriceClass_200, PriceClass_All
      enabled: false, # required
      viewer_certificate: {
        cloud_front_default_certificate: false,
        iam_certificate_id: "string",
        acm_certificate_arn: "string",
        ssl_support_method: "sni-only", # accepts sni-only, vip, static-ip
        minimum_protocol_version: "SSLv3", # accepts SSLv3, TLSv1, TLSv1_2016, TLSv1.1_2016, TLSv1.2_2018, TLSv1.2_2019, TLSv1.2_2021
        certificate: "string",
        certificate_source: "cloudfront", # accepts cloudfront, iam, acm
      },
      restrictions: {
        geo_restriction: { # required
          restriction_type: "blacklist", # required, accepts blacklist, whitelist, none
          quantity: 1, # required
          items: ["string"],
        },
      },
      web_acl_id: "string",
      http_version: "http1.1", # accepts http1.1, http2, http3, http2and3
      is_ipv6_enabled: false,
      continuous_deployment_policy_id: "string",
      staging: false,
    },
    tags: { # required
      items: [
        {
          key: "TagKey", # required
          value: "TagValue",
        },
      ],
    },
  },
})

Response structure


resp.distribution.id #=> String
resp.distribution.arn #=> String
resp.distribution.status #=> String
resp.distribution.last_modified_time #=> Time
resp.distribution.in_progress_invalidation_batches #=> Integer
resp.distribution.domain_name #=> String
resp.distribution.active_trusted_signers.enabled #=> Boolean
resp.distribution.active_trusted_signers.quantity #=> Integer
resp.distribution.active_trusted_signers.items #=> Array
resp.distribution.active_trusted_signers.items[0]. #=> String
resp.distribution.active_trusted_signers.items[0].key_pair_ids.quantity #=> Integer
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items #=> Array
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items[0] #=> String
resp.distribution.active_trusted_key_groups.enabled #=> Boolean
resp.distribution.active_trusted_key_groups.quantity #=> Integer
resp.distribution.active_trusted_key_groups.items #=> Array
resp.distribution.active_trusted_key_groups.items[0].key_group_id #=> String
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.quantity #=> Integer
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.items #=> Array
resp.distribution.active_trusted_key_groups.items[0].key_pair_ids.items[0] #=> String
resp.distribution.distribution_config.caller_reference #=> String
resp.distribution.distribution_config.aliases.quantity #=> Integer
resp.distribution.distribution_config.aliases.items #=> Array
resp.distribution.distribution_config.aliases.items[0] #=> String
resp.distribution.distribution_config.default_root_object #=> String
resp.distribution.distribution_config.origins.quantity #=> Integer
resp.distribution.distribution_config.origins.items #=> Array
resp.distribution.distribution_config.origins.items[0].id #=> String
resp.distribution.distribution_config.origins.items[0].domain_name #=> String
resp.distribution.distribution_config.origins.items[0].origin_path #=> String
resp.distribution.distribution_config.origins.items[0].custom_headers.quantity #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_headers.items #=> Array
resp.distribution.distribution_config.origins.items[0].custom_headers.items[0].header_name #=> String
resp.distribution.distribution_config.origins.items[0].custom_headers.items[0].header_value #=> String
resp.distribution.distribution_config.origins.items[0].s3_origin_config.origin_access_identity #=> String
resp.distribution.distribution_config.origins.items[0].custom_origin_config.http_port #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.https_port #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_protocol_policy #=> String, one of "http-only", "match-viewer", "https-only"
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.quantity #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.items #=> Array
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_ssl_protocols.items[0] #=> String, one of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_read_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].custom_origin_config.origin_keepalive_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].connection_attempts #=> Integer
resp.distribution.distribution_config.origins.items[0].connection_timeout #=> Integer
resp.distribution.distribution_config.origins.items[0].origin_shield.enabled #=> Boolean
resp.distribution.distribution_config.origins.items[0].origin_shield.origin_shield_region #=> String
resp.distribution.distribution_config.origins.items[0].origin_access_control_id #=> String
resp.distribution.distribution_config.origin_groups.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].id #=> String
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].failover_criteria.status_codes.items[0] #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].members.quantity #=> Integer
resp.distribution.distribution_config.origin_groups.items[0].members.items #=> Array
resp.distribution.distribution_config.origin_groups.items[0].members.items[0].origin_id #=> String
resp.distribution.distribution_config.default_cache_behavior.target_origin_id #=> String
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.enabled #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.trusted_signers.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.enabled #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.trusted_key_groups.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.viewer_protocol_policy #=> String, one of "allow-all", "https-only", "redirect-to-https"
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.allowed_methods.cached_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.default_cache_behavior.smooth_streaming #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.compress #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.function_associations.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.default_cache_behavior.field_level_encryption_id #=> String
resp.distribution.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String
resp.distribution.distribution_config.default_cache_behavior.cache_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.origin_request_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.response_headers_policy_id #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.forward #=> String, one of "none", "whitelist", "all"
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.cookies.whitelisted_names.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.headers.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.quantity #=> Integer
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.items #=> Array
resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string_cache_keys.items[0] #=> String
resp.distribution.distribution_config.default_cache_behavior.min_ttl #=> Integer
resp.distribution.distribution_config.default_cache_behavior.default_ttl #=> Integer
resp.distribution.distribution_config.default_cache_behavior.max_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].path_pattern #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].target_origin_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.enabled #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_signers.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.enabled #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].trusted_key_groups.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].viewer_protocol_policy #=> String, one of "allow-all", "https-only", "redirect-to-https"
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].allowed_methods.cached_methods.items[0] #=> String, one of "GET", "HEAD", "POST", "PUT", "PATCH", "OPTIONS", "DELETE"
resp.distribution.distribution_config.cache_behaviors.items[0].smooth_streaming #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].compress #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response"
resp.distribution.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].response_headers_policy_id #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.forward #=> String, one of "none", "whitelist", "all"
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.cookies.whitelisted_names.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.headers.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.quantity #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.items #=> Array
resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string_cache_keys.items[0] #=> String
resp.distribution.distribution_config.cache_behaviors.items[0].min_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].default_ttl #=> Integer
resp.distribution.distribution_config.cache_behaviors.items[0].max_ttl #=> Integer
resp.distribution.distribution_config.custom_error_responses.quantity #=> Integer
resp.distribution.distribution_config.custom_error_responses.items #=> Array
resp.distribution.distribution_config.custom_error_responses.items[0].error_code #=> Integer
resp.distribution.distribution_config.custom_error_responses.items[0].response_page_path #=> String
resp.distribution.distribution_config.custom_error_responses.items[0].response_code #=> String
resp.distribution.distribution_config.custom_error_responses.items[0].error_caching_min_ttl #=> Integer
resp.distribution.distribution_config.comment #=> String
resp.distribution.distribution_config.logging.enabled #=> Boolean
resp.distribution.distribution_config.logging.include_cookies #=> Boolean
resp.distribution.distribution_config.logging.bucket #=> String
resp.distribution.distribution_config.logging.prefix #=> String
resp.distribution.distribution_config.price_class #=> String, one of "PriceClass_100", "PriceClass_200", "PriceClass_All"
resp.distribution.distribution_config.enabled #=> Boolean
resp.distribution.distribution_config.viewer_certificate.cloud_front_default_certificate #=> Boolean
resp.distribution.distribution_config.viewer_certificate.iam_certificate_id #=> String
resp.distribution.distribution_config.viewer_certificate.acm_certificate_arn #=> String
resp.distribution.distribution_config.viewer_certificate.ssl_support_method #=> String, one of "sni-only", "vip", "static-ip"
resp.distribution.distribution_config.viewer_certificate.minimum_protocol_version #=> String, one of "SSLv3", "TLSv1", "TLSv1_2016", "TLSv1.1_2016", "TLSv1.2_2018", "TLSv1.2_2019", "TLSv1.2_2021"
resp.distribution.distribution_config.viewer_certificate.certificate #=> String
resp.distribution.distribution_config.viewer_certificate.certificate_source #=> String, one of "cloudfront", "iam", "acm"
resp.distribution.distribution_config.restrictions.geo_restriction.restriction_type #=> String, one of "blacklist", "whitelist", "none"
resp.distribution.distribution_config.restrictions.geo_restriction.quantity #=> Integer
resp.distribution.distribution_config.restrictions.geo_restriction.items #=> Array
resp.distribution.distribution_config.restrictions.geo_restriction.items[0] #=> String
resp.distribution.distribution_config.web_acl_id #=> String
resp.distribution.distribution_config.http_version #=> String, one of "http1.1", "http2", "http3", "http2and3"
resp.distribution.distribution_config.is_ipv6_enabled #=> Boolean
resp.distribution.distribution_config.continuous_deployment_policy_id #=> String
resp.distribution.distribution_config.staging #=> Boolean
resp.distribution.alias_icp_recordals #=> Array
resp.distribution.alias_icp_recordals[0].cname #=> String
resp.distribution.alias_icp_recordals[0].icp_recordal_status #=> String, one of "APPROVED", "SUSPENDED", "PENDING"
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



1942
1943
1944
1945
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 1942

def create_distribution_with_tags(params = {}, options = {})
  req = build_request(:create_distribution_with_tags, params)
  req.send_request(options)
end

#create_field_level_encryption_config(params = {}) ⇒ Types::CreateFieldLevelEncryptionConfigResult

Create a new field-level encryption configuration.

Examples:

Request syntax with placeholder values


resp = client.create_field_level_encryption_config({
  field_level_encryption_config: { # required
    caller_reference: "string", # required
    comment: "string",
    query_arg_profile_config: {
      forward_when_query_arg_profile_is_unknown: false, # required
      query_arg_profiles: {
        quantity: 1, # required
        items: [
          {
            query_arg: "string", # required
            profile_id: "string", # required
          },
        ],
      },
    },
    content_type_profile_config: {
      forward_when_content_type_is_unknown: false, # required
      content_type_profiles: {
        quantity: 1, # required
        items: [
          {
            format: "URLEncoded", # required, accepts URLEncoded
            profile_id: "string",
            content_type: "string", # required
          },
        ],
      },
    },
  },
})

Response structure


resp.field_level_encryption.id #=> String
resp.field_level_encryption.last_modified_time #=> Time
resp.field_level_encryption.field_level_encryption_config.caller_reference #=> String
resp.field_level_encryption.field_level_encryption_config.comment #=> String
resp.field_level_encryption.field_level_encryption_config.query_arg_profile_config.forward_when_query_arg_profile_is_unknown #=> Boolean
resp.field_level_encryption.field_level_encryption_config.query_arg_profile_config.query_arg_profiles.quantity #=> Integer
resp.field_level_encryption.field_level_encryption_config.query_arg_profile_config.query_arg_profiles.items #=> Array
resp.field_level_encryption.field_level_encryption_config.query_arg_profile_config.query_arg_profiles.items[0].query_arg #=> String
resp.field_level_encryption.field_level_encryption_config.query_arg_profile_config.query_arg_profiles.items[0].profile_id #=> String
resp.field_level_encryption.field_level_encryption_config.content_type_profile_config.forward_when_content_type_is_unknown #=> Boolean
resp.field_level_encryption.field_level_encryption_config.content_type_profile_config.content_type_profiles.quantity #=> Integer
resp.field_level_encryption.field_level_encryption_config.content_type_profile_config.content_type_profiles.items #=> Array
resp.field_level_encryption.field_level_encryption_config.content_type_profile_config.content_type_profiles.items[0].format #=> String, one of "URLEncoded"
resp.field_level_encryption.field_level_encryption_config.content_type_profile_config.content_type_profiles.items[0].profile_id #=> String
resp.field_level_encryption.field_level_encryption_config.content_type_profile_config.content_type_profiles.items[0].content_type #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



2016
2017
2018
2019
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2016

def create_field_level_encryption_config(params = {}, options = {})
  req = build_request(:create_field_level_encryption_config, params)
  req.send_request(options)
end

#create_field_level_encryption_profile(params = {}) ⇒ Types::CreateFieldLevelEncryptionProfileResult

Create a field-level encryption profile.

Examples:

Request syntax with placeholder values


resp = client.create_field_level_encryption_profile({
  field_level_encryption_profile_config: { # required
    name: "string", # required
    caller_reference: "string", # required
    comment: "string",
    encryption_entities: { # required
      quantity: 1, # required
      items: [
        {
          public_key_id: "string", # required
          provider_id: "string", # required
          field_patterns: { # required
            quantity: 1, # required
            items: ["string"],
          },
        },
      ],
    },
  },
})

Response structure


resp.field_level_encryption_profile.id #=> String
resp.field_level_encryption_profile.last_modified_time #=> Time
resp.field_level_encryption_profile.field_level_encryption_profile_config.name #=> String
resp.field_level_encryption_profile.field_level_encryption_profile_config.caller_reference #=> String
resp.field_level_encryption_profile.field_level_encryption_profile_config.comment #=> String
resp.field_level_encryption_profile.field_level_encryption_profile_config.encryption_entities.quantity #=> Integer
resp.field_level_encryption_profile.field_level_encryption_profile_config.encryption_entities.items #=> Array
resp.field_level_encryption_profile.field_level_encryption_profile_config.encryption_entities.items[0].public_key_id #=> String
resp.field_level_encryption_profile.field_level_encryption_profile_config.encryption_entities.items[0].provider_id #=> String
resp.field_level_encryption_profile.field_level_encryption_profile_config.encryption_entities.items[0].field_patterns.quantity #=> Integer
resp.field_level_encryption_profile.field_level_encryption_profile_config.encryption_entities.items[0].field_patterns.items #=> Array
resp.field_level_encryption_profile.field_level_encryption_profile_config.encryption_entities.items[0].field_patterns.items[0] #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



2076
2077
2078
2079
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2076

def create_field_level_encryption_profile(params = {}, options = {})
  req = build_request(:create_field_level_encryption_profile, params)
  req.send_request(options)
end

#create_function(params = {}) ⇒ Types::CreateFunctionResult

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 stage, you can test the function with TestFunction, and update it with UpdateFunction.

When you're ready to use your function with a CloudFront distribution, use PublishFunction to copy the function from the DEVELOPMENT stage to LIVE. When it's live, you can attach the function to a distribution's cache behavior, using the function's ARN.

Examples:

Example: To create a function


# Use the following command to create a function.

resp = client.create_function({
  function_code: "function-code.js", 
  function_config: {
    comment: "my-function-comment", 
    key_value_store_associations: {
      items: [
        {
          key_value_store_arn: "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", 
        }, 
      ], 
      quantity: 1, 
    }, 
    runtime: "cloudfront-js-2.0", 
  }, 
  name: "my-function-name", 
})

resp.to_h outputs the following:
{
  etag: "ETVPDKIKX0DER", 
  function_summary: {
    function_config: {
      comment: "my-function-comment", 
      key_value_store_associations: {
        items: [
          {
            key_value_store_arn: "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", 
          }, 
        ], 
        quantity: 1, 
      }, 
      runtime: "cloudfront-js-2.0", 
    }, 
    function_metadata: {
      created_time: Time.parse("2023-11-07T19:53:50.334Z"), 
      function_arn: "arn:aws:cloudfront::123456789012:function/my-function-name", 
      last_modified_time: Time.parse("2023-11-07T19:53:50.334Z"), 
      stage: "DEVELOPMENT", 
    }, 
    name: "my-function-name", 
    status: "UNPUBLISHED", 
  }, 
  location: "https://cloudfront.amazonaws.com/2020-05-31/function/arn:aws:cloudfront::123456789012:function/my-function-name", 
}

Request syntax with placeholder values


resp = client.create_function({
  name: "FunctionName", # required
  function_config: { # required
    comment: "string", # required
    runtime: "cloudfront-js-1.0", # required, accepts cloudfront-js-1.0, cloudfront-js-2.0
    key_value_store_associations: {
      quantity: 1, # required
      items: [
        {
          key_value_store_arn: "KeyValueStoreARN", # required
        },
      ],
    },
  },
  function_code: "data", # required
})

Response structure


resp.function_summary.name #=> String
resp.function_summary.status #=> String
resp.function_summary.function_config.comment #=> String
resp.function_summary.function_config.runtime #=> String, one of "cloudfront-js-1.0", "cloudfront-js-2.0"
resp.function_summary.function_config.key_value_store_associations.quantity #=> Integer
resp.function_summary.function_config.key_value_store_associations.items #=> Array
resp.function_summary.function_config.key_value_store_associations.items[0].key_value_store_arn #=> String
resp.function_summary..function_arn #=> String
resp.function_summary..stage #=> String, one of "DEVELOPMENT", "LIVE"
resp.function_summary..created_time #=> Time
resp.function_summary..last_modified_time #=> Time
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    A name to identify the function.

  • :function_config (required, Types::FunctionConfig)

    Configuration information about the function, including an optional comment and the function's runtime.

  • :function_code (required, String, StringIO, File)

    The function code. For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide.

Returns:

See Also:



2208
2209
2210
2211
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2208

def create_function(params = {}, options = {})
  req = build_request(:create_function, params)
  req.send_request(options)
end

#create_invalidation(params = {}) ⇒ Types::CreateInvalidationResult

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

Examples:

Request syntax with placeholder values


resp = client.create_invalidation({
  distribution_id: "string", # required
  invalidation_batch: { # required
    paths: { # required
      quantity: 1, # required
      items: ["string"],
    },
    caller_reference: "string", # required
  },
})

Response structure


resp.location #=> String
resp.invalidation.id #=> String
resp.invalidation.status #=> String
resp.invalidation.create_time #=> Time
resp.invalidation.invalidation_batch.paths.quantity #=> Integer
resp.invalidation.invalidation_batch.paths.items #=> Array
resp.invalidation.invalidation_batch.paths.items[0] #=> String
resp.invalidation.invalidation_batch.caller_reference #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :distribution_id (required, String)

    The distribution's id.

  • :invalidation_batch (required, Types::InvalidationBatch)

    The batch information for the invalidation.

Returns:

See Also:



2259
2260
2261
2262
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2259

def create_invalidation(params = {}, options = {})
  req = build_request(:create_invalidation, params)
  req.send_request(options)
end

#create_key_group(params = {}) ⇒ Types::CreateKeyGroupResult

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 behavior, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose corresponding public key is in the key group. The signed URL or cookie contains information about which public key CloudFront should use to verify the signature. For more information, see Serving private content in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_key_group({
  key_group_config: { # required
    name: "string", # required
    items: ["string"], # required
    comment: "string",
  },
})

Response structure


resp.key_group.id #=> String
resp.key_group.last_modified_time #=> Time
resp.key_group.key_group_config.name #=> String
resp.key_group.key_group_config.items #=> Array
resp.key_group.key_group_config.items[0] #=> String
resp.key_group.key_group_config.comment #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



2316
2317
2318
2319
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2316

def create_key_group(params = {}, options = {})
  req = build_request(:create_key_group, params)
  req.send_request(options)
end

#create_key_value_store(params = {}) ⇒ Types::CreateKeyValueStoreResult

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.

Examples:

Example: To create a KeyValueStore


# Use the following command to create a KeyValueStore.

resp = client.create_key_value_store({
  comment: "my-key-valuestore-comment", 
  import_source: {
    source_arn: "arn:aws:s3:::my-bucket/validJSON.json", 
    source_type: "S3", 
  }, 
  name: "my-keyvaluestore-name", 
})

resp.to_h outputs the following:
{
  etag: "ETVPDKIKX0DER", 
  key_value_store: {
    arn: "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", 
    comment: "my-key-valuestore-comment", 
    id: "54947df8-0e9e-4471-a2f9-9af509fb5889", 
    last_modified_time: Time.parse("2023-11-07T18:15:52.042Z"), 
    name: "my-keyvaluestore-name", 
    status: "PROVISIONING", 
  }, 
  location: "https://cloudfront.amazonaws.com/2020-05-31/key-value-store/arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", 
}

Request syntax with placeholder values


resp = client.create_key_value_store({
  name: "KeyValueStoreName", # required
  comment: "KeyValueStoreComment",
  import_source: {
    source_type: "S3", # required, accepts S3
    source_arn: "string", # required
  },
})

Response structure


resp.key_value_store.name #=> String
resp.key_value_store.id #=> String
resp.key_value_store.comment #=> String
resp.key_value_store.arn #=> String
resp.key_value_store.status #=> String
resp.key_value_store.last_modified_time #=> Time
resp.etag #=> String
resp.location #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the key value store. The minimum length is 1 character and the maximum length is 64 characters.

  • :comment (String)

    The comment of the key value store.

  • :import_source (Types::ImportSource)

    The S3 bucket that provides the source for the import. The source must be in a valid JSON format.

Returns:

See Also:



2397
2398
2399
2400
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2397

def create_key_value_store(params = {}, options = {})
  req = build_request(:create_key_value_store, params)
  req.send_request(options)
end

#create_monitoring_subscription(params = {}) ⇒ Types::CreateMonitoringSubscriptionResult

Enables additional 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.

Examples:

Request syntax with placeholder values


resp = client.create_monitoring_subscription({
  distribution_id: "string", # required
  monitoring_subscription: { # required
    realtime_metrics_subscription_config: {
      realtime_metrics_subscription_status: "Enabled", # required, accepts Enabled, Disabled
    },
  },
})

Response structure


resp.monitoring_subscription.realtime_metrics_subscription_config.realtime_metrics_subscription_status #=> String, one of "Enabled", "Disabled"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :distribution_id (required, String)

    The ID of the distribution that you are enabling metrics for.

  • :monitoring_subscription (required, Types::MonitoringSubscription)

    A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

Returns:

See Also:



2443
2444
2445
2446
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2443

def create_monitoring_subscription(params = {}, options = {})
  req = build_request(:create_monitoring_subscription, params)
  req.send_request(options)
end

#create_origin_access_control(params = {}) ⇒ Types::CreateOriginAccessControlResult

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 (users) to access the origin's content only through CloudFront.

For more information about using a CloudFront origin access control, see Restricting access to an Amazon Web Services origin in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_origin_access_control({
  origin_access_control_config: { # required
    name: "string", # required
    description: "string",
    signing_protocol: "sigv4", # required, accepts sigv4
    signing_behavior: "never", # required, accepts never, always, no-override
    origin_access_control_origin_type: "s3", # required, accepts s3, mediastore, mediapackagev2, lambda
  },
})

Response structure


resp.origin_access_control.id #=> String
resp.origin_access_control.origin_access_control_config.name #=> String
resp.origin_access_control.origin_access_control_config.description #=> String
resp.origin_access_control.origin_access_control_config.signing_protocol #=> String, one of "sigv4"
resp.origin_access_control.origin_access_control_config.signing_behavior #=> String, one of "never", "always", "no-override"
resp.origin_access_control.origin_access_control_config.origin_access_control_origin_type #=> String, one of "s3", "mediastore", "mediapackagev2", "lambda"
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



2501
2502
2503
2504
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2501

def create_origin_access_control(params = {}, options = {})
  req = build_request(:create_origin_access_control, params)
  req.send_request(options)
end

#create_origin_request_policy(params = {}) ⇒ Types::CreateOriginRequestPolicyResult

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 CloudFront sends to the origin includes the following:

  • The request body and the URL path (without the domain name) from the viewer request.

  • The headers that CloudFront automatically includes in every origin request, including Host, User-Agent, and X-Amz-Cf-Id.

  • All HTTP headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.

CloudFront sends a request when it can't find a valid object in its cache that matches the request. If you want to send values to the origin and also include them in the cache key, use CachePolicy.

For more information about origin request policies, see Controlling origin requests in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_origin_request_policy({
  origin_request_policy_config: { # required
    comment: "string",
    name: "string", # required
    headers_config: { # required
      header_behavior: "none", # required, accepts none, whitelist, allViewer, allViewerAndWhitelistCloudFront, allExcept
      headers: {
        quantity: 1, # required
        items: ["string"],
      },
    },
    cookies_config: { # required
      cookie_behavior: "none", # required, accepts none, whitelist, all, allExcept
      cookies: {
        quantity: 1, # required
        items: ["string"],
      },
    },
    query_strings_config: { # required
      query_string_behavior: "none", # required, accepts none, whitelist, all, allExcept
      query_strings: {
        quantity: 1, # required
        items: ["string"],
      },
    },
  },
})

Response structure


resp.origin_request_policy.id #=> String
resp.origin_request_policy.last_modified_time #=> Time
resp.origin_request_policy.origin_request_policy_config.comment #=> String
resp.origin_request_policy.origin_request_policy_config.name #=> String
resp.origin_request_policy.origin_request_policy_config.headers_config.header_behavior #=> String, one of "none", "whitelist", "allViewer", "allViewerAndWhitelistCloudFront", "allExcept"
resp.origin_request_policy.origin_request_policy_config.headers_config.headers.quantity #=> Integer
resp.origin_request_policy.origin_request_policy_config.headers_config.headers.items #=> Array
resp.origin_request_policy.origin_request_policy_config.headers_config.headers.items[0] #=> String
resp.origin_request_policy.origin_request_policy_config.cookies_config.cookie_behavior #=> String, one of "none", "whitelist", "all", "allExcept"
resp.origin_request_policy.origin_request_policy_config.cookies_config.cookies.quantity #=> Integer
resp.origin_request_policy.origin_request_policy_config.cookies_config.cookies.items #=> Array
resp.origin_request_policy.origin_request_policy_config.cookies_config.cookies.items[0] #=> String
resp.origin_request_policy.origin_request_policy_config.query_strings_config.query_string_behavior #=> String, one of "none", "whitelist", "all", "allExcept"
resp.origin_request_policy.origin_request_policy_config.query_strings_config.query_strings.quantity #=> Integer
resp.origin_request_policy.origin_request_policy_config.query_strings_config.query_strings.items #=> Array
resp.origin_request_policy.origin_request_policy_config.query_strings_config.query_strings.items[0] #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



2600
2601
2602
2603
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2600

def create_origin_request_policy(params = {}, options = {})
  req = build_request(:create_origin_request_policy, params)
  req.send_request(options)
end

#create_public_key(params = {}) ⇒ Types::CreatePublicKeyResult

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

Examples:

Request syntax with placeholder values


resp = client.create_public_key({
  public_key_config: { # required
    caller_reference: "string", # required
    name: "string", # required
    encoded_key: "string", # required
    comment: "string",
  },
})

Response structure


resp.public_key.id #=> String
resp.public_key.created_time #=> Time
resp.public_key.public_key_config.caller_reference #=> String
resp.public_key.public_key_config.name #=> String
resp.public_key.public_key_config.encoded_key #=> String
resp.public_key.public_key_config.comment #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



2648
2649
2650
2651
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2648

def create_public_key(params = {}, options = {})
  req = build_request(:create_public_key, params)
  req.send_request(options)
end

#create_realtime_log_config(params = {}) ⇒ Types::CreateRealtimeLogConfigResult

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 CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_realtime_log_config({
  end_points: [ # required
    {
      stream_type: "string", # required
      kinesis_stream_config: {
        role_arn: "string", # required
        stream_arn: "string", # required
      },
    },
  ],
  fields: ["string"], # required
  name: "string", # required
  sampling_rate: 1, # required
})

Response structure


resp.realtime_log_config.arn #=> String
resp.realtime_log_config.name #=> String
resp.realtime_log_config.sampling_rate #=> Integer
resp.realtime_log_config.end_points #=> Array
resp.realtime_log_config.end_points[0].stream_type #=> String
resp.realtime_log_config.end_points[0].kinesis_stream_config.role_arn #=> String
resp.realtime_log_config.end_points[0].kinesis_stream_config.stream_arn #=> String
resp.realtime_log_config.fields #=> Array
resp.realtime_log_config.fields[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :end_points (required, Array<Types::EndPoint>)

    Contains information about the Amazon Kinesis data stream where you are sending real-time log data.

  • :fields (required, Array<String>)

    A list of fields to include in each real-time log record.

    For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.

  • :name (required, String)

    A unique name to identify this real-time log configuration.

  • :sampling_rate (required, Integer)

    The sampling rate for this real-time log configuration. You can specify a whole number between 1 and 100 (inclusive) to determine the percentage of viewer requests that are represented in the real-time log data.

Returns:

See Also:



2726
2727
2728
2729
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2726

def create_realtime_log_config(params = {}, options = {})
  req = build_request(:create_realtime_log_config, params)
  req.send_request(options)
end

#create_response_headers_policy(params = {}) ⇒ Types::CreateResponseHeadersPolicyResult

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 its ID to attach it to one or more cache behaviors in a CloudFront distribution. When it's attached to a cache behavior, the response headers policy affects the HTTP headers that CloudFront includes in HTTP responses to requests that match the cache behavior. CloudFront adds or removes response headers according to the configuration of the response headers policy.

For more information, see Adding or removing HTTP headers in CloudFront responses in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_response_headers_policy({
  response_headers_policy_config: { # required
    comment: "string",
    name: "string", # required
    cors_config: {
      access_control_allow_origins: { # required
        quantity: 1, # required
        items: ["string"], # required
      },
      access_control_allow_headers: { # required
        quantity: 1, # required
        items: ["string"], # required
      },
      access_control_allow_methods: { # required
        quantity: 1, # required
        items: ["GET"], # required, accepts GET, POST, OPTIONS, PUT, DELETE, PATCH, HEAD, ALL
      },
      access_control_allow_credentials: false, # required
      access_control_expose_headers: {
        quantity: 1, # required
        items: ["string"],
      },
      access_control_max_age_sec: 1,
      origin_override: false, # required
    },
    security_headers_config: {
      xss_protection: {
        override: false, # required
        protection: false, # required
        mode_block: false,
        report_uri: "string",
      },
      frame_options: {
        override: false, # required
        frame_option: "DENY", # required, accepts DENY, SAMEORIGIN
      },
      referrer_policy: {
        override: false, # required
        referrer_policy: "no-referrer", # required, accepts no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
      },
      content_security_policy: {
        override: false, # required
        content_security_policy: "string", # required
      },
      content_type_options: {
        override: false, # required
      },
      strict_transport_security: {
        override: false, # required
        include_subdomains: false,
        preload: false,
        access_control_max_age_sec: 1, # required
      },
    },
    server_timing_headers_config: {
      enabled: false, # required
      sampling_rate: 1.0,
    },
    custom_headers_config: {
      quantity: 1, # required
      items: [
        {
          header: "string", # required
          value: "string", # required
          override: false, # required
        },
      ],
    },
    remove_headers_config: {
      quantity: 1, # required
      items: [
        {
          header: "string", # required
        },
      ],
    },
  },
})

Response structure


resp.response_headers_policy.id #=> String
resp.response_headers_policy.last_modified_time #=> Time
resp.response_headers_policy.response_headers_policy_config.comment #=> String
resp.response_headers_policy.response_headers_policy_config.name #=> String
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_origins.quantity #=> Integer
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_origins.items #=> Array
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_origins.items[0] #=> String
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_headers.quantity #=> Integer
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_headers.items #=> Array
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_headers.items[0] #=> String
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_methods.quantity #=> Integer
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_methods.items #=> Array
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_methods.items[0] #=> String, one of "GET", "POST", "OPTIONS", "PUT", "DELETE", "PATCH", "HEAD", "ALL"
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_allow_credentials #=> Boolean
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_expose_headers.quantity #=> Integer
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_expose_headers.items #=> Array
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_expose_headers.items[0] #=> String
resp.response_headers_policy.response_headers_policy_config.cors_config.access_control_max_age_sec #=> Integer
resp.response_headers_policy.response_headers_policy_config.cors_config.origin_override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.xss_protection.override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.xss_protection.protection #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.xss_protection.mode_block #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.xss_protection.report_uri #=> String
resp.response_headers_policy.response_headers_policy_config.security_headers_config.frame_options.override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.frame_options.frame_option #=> String, one of "DENY", "SAMEORIGIN"
resp.response_headers_policy.response_headers_policy_config.security_headers_config.referrer_policy.override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.referrer_policy.referrer_policy #=> String, one of "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin", "unsafe-url"
resp.response_headers_policy.response_headers_policy_config.security_headers_config.content_security_policy.override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.content_security_policy.content_security_policy #=> String
resp.response_headers_policy.response_headers_policy_config.security_headers_config.content_type_options.override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.strict_transport_security.override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.strict_transport_security.include_subdomains #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.strict_transport_security.preload #=> Boolean
resp.response_headers_policy.response_headers_policy_config.security_headers_config.strict_transport_security.access_control_max_age_sec #=> Integer
resp.response_headers_policy.response_headers_policy_config.server_timing_headers_config.enabled #=> Boolean
resp.response_headers_policy.response_headers_policy_config.server_timing_headers_config.sampling_rate #=> Float
resp.response_headers_policy.response_headers_policy_config.custom_headers_config.quantity #=> Integer
resp.response_headers_policy.response_headers_policy_config.custom_headers_config.items #=> Array
resp.response_headers_policy.response_headers_policy_config.custom_headers_config.items[0].header #=> String
resp.response_headers_policy.response_headers_policy_config.custom_headers_config.items[0].value #=> String
resp.response_headers_policy.response_headers_policy_config.custom_headers_config.items[0].override #=> Boolean
resp.response_headers_policy.response_headers_policy_config.remove_headers_config.quantity #=> Integer
resp.response_headers_policy.response_headers_policy_config.remove_headers_config.items #=> Array
resp.response_headers_policy.response_headers_policy_config.remove_headers_config.items[0].header #=> String
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :response_headers_policy_config (required, Types::ResponseHeadersPolicyConfig)

    Contains metadata about the response headers policy, and a set of configurations that specify the HTTP headers.

Returns:

See Also:



2897
2898
2899
2900
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2897

def create_response_headers_policy(params = {}, options = {})
  req = build_request(:create_response_headers_policy, params)
  req.send_request(options)
end

#create_streaming_distribution(params = {}) ⇒ Types::CreateStreamingDistributionResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_streaming_distribution({
  streaming_distribution_config: { # required
    caller_reference: "string", # required
    s3_origin: { # required
      domain_name: "string", # required
      origin_access_identity: "string", # required
    },
    aliases: {
      quantity: 1, # required
      items: ["string"],
    },
    comment: "string", # required
    logging: {
      enabled: false, # required
      bucket: "string", # required
      prefix: "string", # required
    },
    trusted_signers: { # required
      enabled: false, # required
      quantity: 1, # required
      items: ["string"],
    },
    price_class: "PriceClass_100", # accepts PriceClass_100, PriceClass_200, PriceClass_All
    enabled: false, # required
  },
})

Response structure


resp.streaming_distribution.id #=> String
resp.streaming_distribution.arn #=> String
resp.streaming_distribution.status #=> String
resp.streaming_distribution.last_modified_time #=> Time
resp.streaming_distribution.domain_name #=> String
resp.streaming_distribution.active_trusted_signers.enabled #=> Boolean
resp.streaming_distribution.active_trusted_signers.quantity #=> Integer
resp.streaming_distribution.active_trusted_signers.items #=> Array
resp.streaming_distribution.active_trusted_signers.items[0]. #=> String
resp.streaming_distribution.active_trusted_signers.items[0].key_pair_ids.quantity #=> Integer
resp.streaming_distribution.active_trusted_signers.items[0].key_pair_ids.items #=> Array
resp.streaming_distribution.active_trusted_signers.items[0].key_pair_ids.items[0] #=> String
resp.streaming_distribution.streaming_distribution_config.caller_reference #=> String
resp.streaming_distribution.streaming_distribution_config.s3_origin.domain_name #=> String
resp.streaming_distribution.streaming_distribution_config.s3_origin.origin_access_identity #=> String
resp.streaming_distribution.streaming_distribution_config.aliases.quantity #=> Integer
resp.streaming_distribution.streaming_distribution_config.aliases.items #=> Array
resp.streaming_distribution.streaming_distribution_config.aliases.items[0] #=> String
resp.streaming_distribution.streaming_distribution_config.comment #=> String
resp.streaming_distribution.streaming_distribution_config.logging.enabled #=> Boolean
resp.streaming_distribution.streaming_distribution_config.logging.bucket #=> String
resp.streaming_distribution.streaming_distribution_config.logging.prefix #=> String
resp.streaming_distribution.streaming_distribution_config.trusted_signers.enabled #=> Boolean
resp.streaming_distribution.streaming_distribution_config.trusted_signers.quantity #=> Integer
resp.streaming_distribution.streaming_distribution_config.trusted_signers.items #=> Array
resp.streaming_distribution.streaming_distribution_config.trusted_signers.items[0] #=> String
resp.streaming_distribution.streaming_distribution_config.price_class #=> String, one of "PriceClass_100", "PriceClass_200", "PriceClass_All"
resp.streaming_distribution.streaming_distribution_config.enabled #=> Boolean
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



2986
2987
2988
2989
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 2986

def create_streaming_distribution(params = {}, options = {})
  req = build_request(:create_streaming_distribution, params)
  req.send_request(options)
end

#create_streaming_distribution_with_tags(params = {}) ⇒ Types::CreateStreamingDistributionWithTagsResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_streaming_distribution_with_tags({
  streaming_distribution_config_with_tags: { # required
    streaming_distribution_config: { # required
      caller_reference: "string", # required
      s3_origin: { # required
        domain_name: "string", # required
        origin_access_identity: "string", # required
      },
      aliases: {
        quantity: 1, # required
        items: ["string"],
      },
      comment: "string", # required
      logging: {
        enabled: false, # required
        bucket: "string", # required
        prefix: "string", # required
      },
      trusted_signers: { # required
        enabled: false, # required
        quantity: 1, # required
        items: ["string"],
      },
      price_class: "PriceClass_100", # accepts PriceClass_100, PriceClass_200, PriceClass_All
      enabled: false, # required
    },
    tags: { # required
      items: [
        {
          key: "TagKey", # required
          value: "TagValue",
        },
      ],
    },
  },
})

Response structure


resp.streaming_distribution.id #=> String
resp.streaming_distribution.arn #=> String
resp.streaming_distribution.status #=> String
resp.streaming_distribution.last_modified_time #=> Time
resp.streaming_distribution.domain_name #=> String
resp.streaming_distribution.active_trusted_signers.enabled #=> Boolean
resp.streaming_distribution.active_trusted_signers.quantity #=> Integer
resp.streaming_distribution.active_trusted_signers.items #=> Array
resp.streaming_distribution.active_trusted_signers.items[0]. #=> String
resp.streaming_distribution.active_trusted_signers.items[0].key_pair_ids.quantity #=> Integer
resp.streaming_distribution.active_trusted_signers.items[0].key_pair_ids.items #=> Array
resp.streaming_distribution.active_trusted_signers.items[0].key_pair_ids.items[0] #=> String
resp.streaming_distribution.streaming_distribution_config.caller_reference #=> String
resp.streaming_distribution.streaming_distribution_config.s3_origin.domain_name #=> String
resp.streaming_distribution.streaming_distribution_config.s3_origin.origin_access_identity #=> String
resp.streaming_distribution.streaming_distribution_config.aliases.quantity #=> Integer
resp.streaming_distribution.streaming_distribution_config.aliases.items #=> Array
resp.streaming_distribution.streaming_distribution_config.aliases.items[0] #=> String
resp.streaming_distribution.streaming_distribution_config.comment #=> String
resp.streaming_distribution.streaming_distribution_config.logging.enabled #=> Boolean
resp.streaming_distribution.streaming_distribution_config.logging.bucket #=> String
resp.streaming_distribution.streaming_distribution_config.logging.prefix #=> String
resp.streaming_distribution.streaming_distribution_config.trusted_signers.enabled #=> Boolean
resp.streaming_distribution.streaming_distribution_config.trusted_signers.quantity #=> Integer
resp.streaming_distribution.streaming_distribution_config.trusted_signers.items #=> Array
resp.streaming_distribution.streaming_distribution_config.trusted_signers.items[0] #=> String
resp.streaming_distribution.streaming_distribution_config.price_class #=> String, one of "PriceClass_100", "PriceClass_200", "PriceClass_All"
resp.streaming_distribution.streaming_distribution_config.enabled #=> Boolean
resp.location #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



3085
3086
3087
3088
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3085

def create_streaming_distribution_with_tags(params = {}, options = {})
  req = build_request(:create_streaming_distribution_with_tags, params)
  req.send_request(options)
end

#delete_cache_policy(params = {}) ⇒ Struct

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 these values, you can use ListCachePolicies or GetCachePolicy.

Examples:

Request syntax with placeholder values


resp = client.delete_cache_policy({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The unique identifier for the cache policy that you are deleting. To get the identifier, you can use ListCachePolicies.

  • :if_match (String)

    The version of the cache policy that you are deleting. The version is the cache policy's ETag value, which you can get using ListCachePolicies, GetCachePolicy, or GetCachePolicyConfig.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3122
3123
3124
3125
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3122

def delete_cache_policy(params = {}, options = {})
  req = build_request(:delete_cache_policy, params)
  req.send_request(options)
end

#delete_cloud_front_origin_access_identity(params = {}) ⇒ Struct

Delete an origin access identity.

Examples:

Request syntax with placeholder values


resp = client.delete_cloud_front_origin_access_identity({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The origin access identity's ID.

  • :if_match (String)

    The value of the ETag header you received from a previous GET or PUT request. For example: E2QWRUHAPOMQZL.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3149
3150
3151
3152
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3149

def delete_cloud_front_origin_access_identity(params = {}, options = {})
  req = build_request(:delete_cloud_front_origin_access_identity, params)
  req.send_request(options)
end

#delete_continuous_deployment_policy(params = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.delete_continuous_deployment_policy({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The identifier of the continuous deployment policy that you are deleting.

  • :if_match (String)

    The current version (ETag value) of the continuous deployment policy that you are deleting.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3181
3182
3183
3184
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3181

def delete_continuous_deployment_policy(params = {}, options = {})
  req = build_request(:delete_continuous_deployment_policy, params)
  req.send_request(options)
end

#delete_distribution(params = {}) ⇒ Struct

Delete a distribution.

Examples:

Request syntax with placeholder values


resp = client.delete_distribution({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The distribution ID.

  • :if_match (String)

    The value of the ETag header that you received when you disabled the distribution. For example: E2QWRUHAPOMQZL.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3208
3209
3210
3211
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3208

def delete_distribution(params = {}, options = {})
  req = build_request(:delete_distribution, params)
  req.send_request(options)
end

#delete_field_level_encryption_config(params = {}) ⇒ Struct

Remove a field-level encryption configuration.

Examples:

Request syntax with placeholder values


resp = client.delete_field_level_encryption_config({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The ID of the configuration you want to delete from CloudFront.

  • :if_match (String)

    The value of the ETag header that you received when retrieving the configuration identity to delete. For example: E2QWRUHAPOMQZL.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3235
3236
3237
3238
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3235

def delete_field_level_encryption_config(params = {}, options = {})
  req = build_request(:delete_field_level_encryption_config, params)
  req.send_request(options)
end

#delete_field_level_encryption_profile(params = {}) ⇒ Struct

Remove a field-level encryption profile.

Examples:

Request syntax with placeholder values


resp = client.delete_field_level_encryption_profile({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    Request the ID of the profile you want to delete from CloudFront.

  • :if_match (String)

    The value of the ETag header that you received when retrieving the profile to delete. For example: E2QWRUHAPOMQZL.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3262
3263
3264
3265
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3262

def delete_field_level_encryption_profile(params = {}, options = {})
  req = build_request(:delete_field_level_encryption_profile, params)
  req.send_request(options)
end

#delete_function(params = {}) ⇒ Struct

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 value). To get these values, you can use ListFunctions and DescribeFunction.

Examples:

Request syntax with placeholder values


resp = client.delete_function({
  name: "string", # required
  if_match: "string", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the function that you are deleting.

  • :if_match (required, String)

    The current version (ETag value) of the function that you are deleting, which you can get using DescribeFunction.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3297
3298
3299
3300
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3297

def delete_function(params = {}, options = {})
  req = build_request(:delete_function, params)
  req.send_request(options)
end

#delete_key_group(params = {}) ⇒ Struct

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, use ListKeyGroups followed by GetKeyGroup or GetKeyGroupConfig.

Examples:

Request syntax with placeholder values


resp = client.delete_key_group({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The identifier of the key group that you are deleting. To get the identifier, use ListKeyGroups.

  • :if_match (String)

    The version of the key group that you are deleting. The version is the key group's ETag value. To get the ETag, use GetKeyGroup or GetKeyGroupConfig.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3334
3335
3336
3337
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3334

def delete_key_group(params = {}, options = {})
  req = build_request(:delete_key_group, params)
  req.send_request(options)
end

#delete_key_value_store(params = {}) ⇒ Struct

Specifies the key value store to delete.

Examples:

Example: To delete a KeyValueStore


# Use the following command to delete a KeyValueStore.

resp = client.delete_key_value_store({
  if_match: "ETVPDKIKX0DER", 
  name: "my-keyvaluestore-name", 
})

Request syntax with placeholder values


resp = client.delete_key_value_store({
  name: "KeyValueStoreName", # required
  if_match: "string", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the key value store.

  • :if_match (required, String)

    The key value store to delete, if a match occurs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3370
3371
3372
3373
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3370

def delete_key_value_store(params = {}, options = {})
  req = build_request(:delete_key_value_store, params)
  req.send_request(options)
end

#delete_monitoring_subscription(params = {}) ⇒ Struct

Disables additional CloudWatch metrics for the specified CloudFront distribution.

Examples:

Request syntax with placeholder values


resp = client.delete_monitoring_subscription({
  distribution_id: "string", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :distribution_id (required, String)

    The ID of the distribution that you are disabling metrics for.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3393
3394
3395
3396
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3393

def delete_monitoring_subscription(params = {}, options = {})
  req = build_request(:delete_monitoring_subscription, params)
  req.send_request(options)
end

#delete_origin_access_control(params = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.delete_origin_access_control({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The unique identifier of the origin access control that you are deleting.

  • :if_match (String)

    The current version (ETag value) of the origin access control that you are deleting.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3425
3426
3427
3428
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3425

def delete_origin_access_control(params = {}, options = {})
  req = build_request(:delete_origin_access_control, params)
  req.send_request(options)
end

#delete_origin_request_policy(params = {}) ⇒ Struct

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 provide the policy's identifier and version. To get the identifier, you can use ListOriginRequestPolicies or GetOriginRequestPolicy.

Examples:

Request syntax with placeholder values


resp = client.delete_origin_request_policy({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The unique identifier for the origin request policy that you are deleting. To get the identifier, you can use ListOriginRequestPolicies.

  • :if_match (String)

    The version of the origin request policy that you are deleting. The version is the origin request policy's ETag value, which you can get using ListOriginRequestPolicies, GetOriginRequestPolicy, or GetOriginRequestPolicyConfig.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3465
3466
3467
3468
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3465

def delete_origin_request_policy(params = {}, options = {})
  req = build_request(:delete_origin_request_policy, params)
  req.send_request(options)
end

#delete_public_key(params = {}) ⇒ Struct

Remove a public key you previously added to CloudFront.

Examples:

Request syntax with placeholder values


resp = client.delete_public_key({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The ID of the public key you want to remove from CloudFront.

  • :if_match (String)

    The value of the ETag header that you received when retrieving the public key identity to delete. For example: E2QWRUHAPOMQZL.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3492
3493
3494
3495
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3492

def delete_public_key(params = {}, options = {})
  req = build_request(:delete_public_key, params)
  req.send_request(options)
end

#delete_realtime_log_config(params = {}) ⇒ Struct

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 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 delete.

Examples:

Request syntax with placeholder values


resp = client.delete_realtime_log_config({
  name: "string",
  arn: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (String)

    The name of the real-time log configuration to delete.

  • :arn (String)

    The Amazon Resource Name (ARN) of the real-time log configuration to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3529
3530
3531
3532
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3529

def delete_realtime_log_config(params = {}, options = {})
  req = build_request(:delete_realtime_log_config, params)
  req.send_request(options)
end

#delete_response_headers_policy(params = {}) ⇒ Struct

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 provide the policy's identifier and version. To get these values, you can use ListResponseHeadersPolicies or GetResponseHeadersPolicy.

Examples:

Request syntax with placeholder values


resp = client.delete_response_headers_policy({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The identifier for the response headers policy that you are deleting.

    To get the identifier, you can use ListResponseHeadersPolicies.

  • :if_match (String)

    The version of the response headers policy that you are deleting.

    The version is the response headers policy's ETag value, which you can get using ListResponseHeadersPolicies, GetResponseHeadersPolicy, or GetResponseHeadersPolicyConfig.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3570
3571
3572
3573
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3570

def delete_response_headers_policy(params = {}, options = {})
  req = build_request(:delete_response_headers_policy, params)
  req.send_request(options)
end

#delete_streaming_distribution(params = {}) ⇒ Struct

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:

  1. Disable the RTMP distribution.

  2. Submit a GET Streaming Distribution Config request to get the current configuration and the Etag header for the distribution.

  3. Update the XML document that was returned in the response to your GET Streaming Distribution Config request to change the value of Enabled to false.

  4. Submit a PUT Streaming Distribution Config request to update the configuration for your distribution. In the request body, include the XML document that you updated in Step 3. Then set the value of the HTTP If-Match header to the value of the ETag header that CloudFront returned when you submitted the GET Streaming Distribution Config request in Step 2.

  5. Review the response to the PUT Streaming Distribution Config request to confirm that the distribution was successfully disabled.

  6. Submit a GET Streaming Distribution Config request to confirm that your changes have propagated. When propagation is complete, the value of Status is Deployed.

  7. Submit a DELETE Streaming Distribution request. Set the value of the HTTP If-Match header to the value of the ETag header that CloudFront returned when you submitted the GET Streaming Distribution Config request in Step 2.

  8. Review the response to your DELETE Streaming Distribution request to confirm that the distribution was successfully deleted.

For information about deleting a distribution using the CloudFront console, see Deleting a Distribution in the Amazon CloudFront Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.delete_streaming_distribution({
  id: "string", # required
  if_match: "string",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The distribution ID.

  • :if_match (String)

    The value of the ETag header that you received when you disabled the streaming distribution. For example: E2QWRUHAPOMQZL.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3640
3641
3642
3643
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3640

def delete_streaming_distribution(params = {}, options = {})
  req = build_request(:delete_streaming_distribution, params)
  req.send_request(options)
end

#describe_function(params = {}) ⇒ Types::DescribeFunctionResult

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 ListFunctions.

Examples:

Request syntax with placeholder values


resp = client.describe_function({
  name: "string", # required
  stage: "DEVELOPMENT", # accepts DEVELOPMENT, LIVE
})

Response structure


resp.function_summary.name #=> String
resp.function_summary.status #=> String
resp.function_summary.function_config.comment #=> String
resp.function_summary.function_config.runtime #=> String, one of "cloudfront-js-1.0", "cloudfront-js-2.0"
resp.function_summary.function_config.key_value_store_associations.quantity #=> Integer
resp.function_summary.function_config.key_value_store_associations.items #=> Array
resp.function_summary.function_config.key_value_store_associations.items[0].key_value_store_arn #=> String
resp.function_summary..function_arn #=> String
resp.function_summary..stage #=> String, one of "DEVELOPMENT", "LIVE"
resp.function_summary..created_time #=> Time
resp.function_summary..last_modified_time #=> Time
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the function that you are getting information about.

  • :stage (String)

    The function's stage, either DEVELOPMENT or LIVE.

Returns:

See Also:



3690
3691
3692
3693
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3690

def describe_function(params = {}, options = {})
  req = build_request(:describe_function, params)
  req.send_request(options)
end

#describe_key_value_store(params = {}) ⇒ Types::DescribeKeyValueStoreResult

Specifies the key value store and its configuration.

Examples:

Example: To describe a KeyValueStore


# Use the following command to describe a KeyValueStore.

resp = client.describe_key_value_store({
  name: "my-keyvaluestore-name", 
})

resp.to_h outputs the following:
{
  etag: "ETVPDKIKX0DER", 
  key_value_store: {
    arn: "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", 
    comment: "my-key-valuestore-comment", 
    id: "54947df8-0e9e-4471-a2f9-9af509fb5889", 
    last_modified_time: Time.parse("2023-11-07T18:20:33.056Z"), 
    name: "my-keyvaluestore-name", 
    status: "READY", 
  }, 
}

Request syntax with placeholder values


resp = client.describe_key_value_store({
  name: "KeyValueStoreName", # required
})

Response structure


resp.key_value_store.name #=> String
resp.key_value_store.id #=> String
resp.key_value_store.comment #=> String
resp.key_value_store.arn #=> String
resp.key_value_store.status #=> String
resp.key_value_store.last_modified_time #=> Time
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the key value store.

Returns:

See Also:



3747
3748
3749
3750
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3747

def describe_key_value_store(params = {}, options = {})
  req = build_request(:describe_key_value_store, params)
  req.send_request(options)
end

#get_cache_policy(params = {}) ⇒ Types::GetCachePolicyResult

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 identifier using ListDistributions or GetDistribution. If the cache policy is not attached to a cache behavior, you can get the identifier using ListCachePolicies.

Examples:

Request syntax with placeholder values


resp = client.get_cache_policy({
  id: "string", # required
})

Response structure


resp.cache_policy.id #=> String
resp.cache_policy.last_modified_time #=> Time
resp.cache_policy.cache_policy_config.comment #=> String
resp.cache_policy.cache_policy_config.name #=> String
resp.cache_policy.cache_policy_config.default_ttl #=> Integer
resp.cache_policy.cache_policy_config.max_ttl #=> Integer
resp.cache_policy.cache_policy_config.min_ttl #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.enable_accept_encoding_gzip #=> Boolean
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.enable_accept_encoding_brotli #=> Boolean
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.header_behavior #=> String, one of "none", "whitelist"
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.quantity #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.items #=> Array
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.items[0] #=> String
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookie_behavior #=> String, one of "none", "whitelist", "allExcept", "all"
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.quantity #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.items #=> Array
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.items[0] #=> String
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_string_behavior #=> String, one of "none", "whitelist", "allExcept", "all"
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.quantity #=> Integer
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.items #=> Array
resp.cache_policy.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.items[0] #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The unique identifier for the cache policy. 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 a cache behavior, you can get the identifier using ListCachePolicies.

Returns:

See Also:



3811
3812
3813
3814
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3811

def get_cache_policy(params = {}, options = {})
  req = build_request(:get_cache_policy, params)
  req.send_request(options)
end

#get_cache_policy_config(params = {}) ⇒ Types::GetCachePolicyConfigResult

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 a cache behavior, you can get the identifier using ListCachePolicies.

Examples:

Request syntax with placeholder values


resp = client.get_cache_policy_config({
  id: "string", # required
})

Response structure


resp.cache_policy_config.comment #=> String
resp.cache_policy_config.name #=> String
resp.cache_policy_config.default_ttl #=> Integer
resp.cache_policy_config.max_ttl #=> Integer
resp.cache_policy_config.min_ttl #=> Integer
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.enable_accept_encoding_gzip #=> Boolean
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.enable_accept_encoding_brotli #=> Boolean
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.header_behavior #=> String, one of "none", "whitelist"
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.quantity #=> Integer
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.items #=> Array
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.items[0] #=> String
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookie_behavior #=> String, one of "none", "whitelist", "allExcept", "all"
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.quantity #=> Integer
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.items #=> Array
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.items[0] #=> String
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_string_behavior #=> String, one of "none", "whitelist", "allExcept", "all"
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.quantity #=> Integer
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.items #=> Array
resp.cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.items[0] #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The unique identifier for the cache policy. 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 a cache behavior, you can get the identifier using ListCachePolicies.

Returns:

See Also:



3870
3871
3872
3873
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3870

def get_cache_policy_config(params = {}, options = {})
  req = build_request(:get_cache_policy_config, params)
  req.send_request(options)
end

#get_cloud_front_origin_access_identity(params = {}) ⇒ Types::GetCloudFrontOriginAccessIdentityResult

Get the information about an origin access identity.

Examples:

Request syntax with placeholder values


resp = client.get_cloud_front_origin_access_identity({
  id: "string", # required
})

Response structure


resp.cloud_front_origin_access_identity.id #=> String
resp.cloud_front_origin_access_identity.s3_canonical_user_id #=> String
resp.cloud_front_origin_access_identity.cloud_front_origin_access_identity_config.caller_reference #=> String
resp.cloud_front_origin_access_identity.cloud_front_origin_access_identity_config.comment #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The identity's ID.

Returns:

See Also:



3903
3904
3905
3906
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3903

def get_cloud_front_origin_access_identity(params = {}, options = {})
  req = build_request(:get_cloud_front_origin_access_identity, params)
  req.send_request(options)
end

#get_cloud_front_origin_access_identity_config(params = {}) ⇒ Types::GetCloudFrontOriginAccessIdentityConfigResult

Get the configuration information about an origin access identity.

Examples:

Request syntax with placeholder values


resp = client.get_cloud_front_origin_access_identity_config({
  id: "string", # required
})

Response structure


resp.cloud_front_origin_access_identity_config.caller_reference #=> String
resp.cloud_front_origin_access_identity_config.comment #=> String
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The identity's ID.

Returns:

See Also:



3934
3935
3936
3937
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3934

def get_cloud_front_origin_access_identity_config(params = {}, options = {})
  req = build_request(:get_cloud_front_origin_access_identity_config, params)
  req.send_request(options)
end

#get_continuous_deployment_policy(params = {}) ⇒ Types::GetContinuousDeploymentPolicyResult

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

Examples:

Request syntax with placeholder values


resp = client.get_continuous_deployment_policy({
  id: "string", # required
})

Response structure


resp.continuous_deployment_policy.id #=> String
resp.continuous_deployment_policy.last_modified_time #=> Time
resp.continuous_deployment_policy.continuous_deployment_policy_config.staging_distribution_dns_names.quantity #=> Integer
resp.continuous_deployment_policy.continuous_deployment_policy_config.staging_distribution_dns_names.items #=> Array
resp.continuous_deployment_policy.continuous_deployment_policy_config.staging_distribution_dns_names.items[0] #=> String
resp.continuous_deployment_policy.continuous_deployment_policy_config.enabled #=> Boolean
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_weight_config.weight #=> Float
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_weight_config.session_stickiness_config.idle_ttl #=> Integer
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_weight_config.session_stickiness_config.maximum_ttl #=> Integer
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_header_config.header #=> String
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.single_header_config.value #=> String
resp.continuous_deployment_policy.continuous_deployment_policy_config.traffic_config.type #=> String, one of "SingleWeight", "SingleHeader"
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The identifier of the continuous deployment policy that you are getting.

Returns:

See Also:



3977
3978
3979
3980
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 3977

def get_continuous_deployment_policy(params = {}, options = {})
  req = build_request(:get_continuous_deployment_policy, params)
  req.send_request(options)
end

#get_continuous_deployment_policy_config(params = {}) ⇒ Types::GetContinuousDeploymentPolicyConfigResult

Gets configuration information about a continuous deployment policy.

Examples:

Request syntax with placeholder values


resp = client.get_continuous_deployment_policy_config({
  id: "string", # required
})

Response structure


resp.continuous_deployment_policy_config.staging_distribution_dns_names.quantity #=> Integer
resp.continuous_deployment_policy_config.staging_distribution_dns_names.items #=> Array
resp.continuous_deployment_policy_config.staging_distribution_dns_names.items[0] #=> String
resp.continuous_deployment_policy_config.enabled #=> Boolean
resp.continuous_deployment_policy_config.traffic_config.single_weight_config.weight #=> Float
resp.continuous_deployment_policy_config.traffic_config.single_weight_config.session_stickiness_config.idle_ttl #=> Integer
resp.continuous_deployment_policy_config.traffic_config.single_weight_config.session_stickiness_config.maximum_ttl #=> Integer
resp.continuous_deployment_policy_config.traffic_config.single_header_config.header #=> String
resp.continuous_deployment_policy_config.traffic_config.single_header_config.value #=> String
resp.continuous_deployment_policy_config.traffic_config.type #=> String, one of "SingleWeight", "SingleHeader"
resp.etag #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :id (required, String)

    The identifier of the continuous deployment policy whose configuration you are getting.

Returns:

See Also:



4017
4018
4019
4020
# File 'gems/aws-sdk-cloudfront/lib/aws-sdk-cloudfront/client.rb', line 4017

def get_continuous_deployment_policy_config(params = {}, options = {})
  req = build_request(:get_continuous_deployment_policy_config, params)
  req.send_request(options)
end

#get_distribution(params = {}) ⇒ Types::GetDistributionResult

Get the information about a distribution.

The following waiters are defined for this operation (see #wait_until for detailed usage):

  • distribution_deployed

Examples:

Request syntax with placeholder values


resp = client.get_distribution({
  id: "string", # required
})

Response structure


resp.distribution.id #=> String
resp.distribution.arn #=> String
resp.distribution.status #=> String
resp.distribution.last_modified_time #=> Time
resp.distribution.in_progress_invalidation_batches #=> Integer
resp.distribution.domain_name #=> String
resp.distribution.active_trusted_signers.enabled #=> Boolean
resp.distribution.active_trusted_signers.quantity #=> Integer
resp.distribution.active_trusted_signers.items #=> Array
resp.distribution.active_trusted_signers.items[0]. #=> String
resp.distribution.active_trusted_signers.items[0].key_pair_ids.quantity #=> Integer
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items #=> Array
resp.distribution.active_trusted_signers.items[0].key_pair_ids.items[0] #=> String
resp.