Skip to main content

cache_policies

Creates, updates, deletes or gets a cache_policy resource or lists cache_policies in a region

Overview

Namecache_policies
TypeResource
DescriptionResource Type definition for AWS::CloudFront::CachePolicy
Idaws.cloudfront.cache_policies

Fields

NameDatatypeDescription
cache_policy_configobject
idstring
last_modified_timestring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTCachePolicyConfig, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all cache_policies in a region.

SELECT
region,
cache_policy_config,
id,
last_modified_time
FROM aws.cloudfront.cache_policies
;

Gets all properties from an individual cache_policy.

SELECT
region,
cache_policy_config,
id,
last_modified_time
FROM aws.cloudfront.cache_policies
WHERE data__Identifier = '<Id>';

INSERT example

Use the following StackQL query and manifest file to create a new cache_policy resource, using stack-deploy.

/*+ create */
INSERT INTO aws.cloudfront.cache_policies (
CachePolicyConfig,
region
)
SELECT
'{{ CachePolicyConfig }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.cloudfront.cache_policies
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

To operate on the cache_policies resource, the following permissions are required:

Create

cloudfront:CreateCachePolicy

Delete

cloudfront:DeleteCachePolicy,
cloudfront:GetCachePolicy

List

cloudfront:ListCachePolicies

Read

cloudfront:GetCachePolicy

Update

cloudfront:UpdateCachePolicy,
cloudfront:GetCachePolicy