tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.cloudfront.tags |
Fields
The following fields are returned by SELECT queries:
- list_tags_for_resource
| Name | Datatype | Description |
|---|---|---|
items | string | A complex type that contains Tag elements. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tags_for_resource | select | Resource, region | List tags for a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide. | |
create_distribution_with_tags | insert | region, DistributionConfigWithTags | Create a new distribution with tags. This API operation requires the following IAM permissions: CreateDistribution TagResource | |
create_streaming_distribution_with_tags | insert | region, StreamingDistributionConfigWithTags | 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. | |
untag_resource | update | Resource, region, TagKeys | Remove tags from a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide. | |
tag_resource | update | Resource, region | Add tags to a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
Resource | string | An ARN of a CloudFront resource. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_tags_for_resource
List tags for a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide.
SELECT
items
FROM aws.cloudfront.tags
WHERE Resource = '{{ Resource }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_distribution_with_tags
- create_streaming_distribution_with_tags
- Manifest
Create a new distribution with tags. This API operation requires the following IAM permissions: CreateDistribution TagResource
INSERT INTO aws.cloudfront.tags (
DistributionConfigWithTags,
region
)
SELECT
'{{ DistributionConfigWithTags }}' /* required */,
'{{ region }}'
RETURNING
distribution,
e_tag,
location
;
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.
INSERT INTO aws.cloudfront.tags (
StreamingDistributionConfigWithTags,
region
)
SELECT
'{{ StreamingDistributionConfigWithTags }}' /* required */,
'{{ region }}'
RETURNING
e_tag,
location,
streaming_distribution
;
# Description fields are for documentation purposes
- name: tags
props:
- name: region
value: "{{ region }}"
description: Required parameter for the tags resource.
- name: DistributionConfigWithTags
description: |
A distribution Configuration and a list of tags to be associated with the distribution.
value:
DistributionConfig:
CallerReference: "{{ CallerReference }}"
Aliases:
Quantity: {{ Quantity }}
Items:
- "{{ Items }}"
DefaultRootObject: "{{ DefaultRootObject }}"
Origins:
Quantity: {{ Quantity }}
Items:
- Id: "{{ Id }}"
DomainName: "{{ DomainName }}"
OriginPath: "{{ OriginPath }}"
CustomHeaders:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
S3OriginConfig:
OriginAccessIdentity: "{{ OriginAccessIdentity }}"
OriginReadTimeout: {{ OriginReadTimeout }}
CustomOriginConfig:
HTTPPort: {{ HTTPPort }}
HTTPSPort: {{ HTTPSPort }}
OriginProtocolPolicy: "{{ OriginProtocolPolicy }}"
OriginSslProtocols: "{{ OriginSslProtocols }}"
OriginReadTimeout: {{ OriginReadTimeout }}
OriginKeepaliveTimeout: {{ OriginKeepaliveTimeout }}
IpAddressType: "{{ IpAddressType }}"
OriginMtlsConfig: "{{ OriginMtlsConfig }}"
VpcOriginConfig:
VpcOriginId: "{{ VpcOriginId }}"
OwnerAccountId: "{{ OwnerAccountId }}"
OriginReadTimeout: {{ OriginReadTimeout }}
OriginKeepaliveTimeout: {{ OriginKeepaliveTimeout }}
ConnectionAttempts: {{ ConnectionAttempts }}
ConnectionTimeout: {{ ConnectionTimeout }}
ResponseCompletionTimeout: {{ ResponseCompletionTimeout }}
OriginShield:
Enabled: {{ Enabled }}
OriginShieldRegion: "{{ OriginShieldRegion }}"
OriginAccessControlId: "{{ OriginAccessControlId }}"
OriginGroups:
Quantity: {{ Quantity }}
Items:
- Id: "{{ Id }}"
FailoverCriteria:
StatusCodes: "{{ StatusCodes }}"
Members:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
SelectionCriteria: "{{ SelectionCriteria }}"
DefaultCacheBehavior:
TargetOriginId: "{{ TargetOriginId }}"
TrustedSigners:
Enabled: {{ Enabled }}
Quantity: {{ Quantity }}
Items:
- "{{ Items }}"
TrustedKeyGroups:
Enabled: {{ Enabled }}
Quantity: {{ Quantity }}
Items:
- "{{ Items }}"
ViewerProtocolPolicy: "{{ ViewerProtocolPolicy }}"
AllowedMethods:
Quantity: {{ Quantity }}
Items:
- "{{ Items }}"
CachedMethods:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
SmoothStreaming: {{ SmoothStreaming }}
Compress: {{ Compress }}
LambdaFunctionAssociations:
Quantity: {{ Quantity }}
Items:
- LambdaFunctionARN: "{{ LambdaFunctionARN }}"
EventType: "{{ EventType }}"
IncludeBody: {{ IncludeBody }}
FunctionAssociations:
Quantity: {{ Quantity }}
Items:
- FunctionARN: "{{ FunctionARN }}"
EventType: "{{ EventType }}"
FieldLevelEncryptionId: "{{ FieldLevelEncryptionId }}"
RealtimeLogConfigArn: "{{ RealtimeLogConfigArn }}"
CachePolicyId: "{{ CachePolicyId }}"
OriginRequestPolicyId: "{{ OriginRequestPolicyId }}"
ResponseHeadersPolicyId: "{{ ResponseHeadersPolicyId }}"
GrpcConfig:
Enabled: {{ Enabled }}
ForwardedValues:
QueryString: {{ QueryString }}
Cookies:
Forward: "{{ Forward }}"
WhitelistedNames: "{{ WhitelistedNames }}"
Headers:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
QueryStringCacheKeys:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
MinTTL: {{ MinTTL }}
DefaultTTL: {{ DefaultTTL }}
MaxTTL: {{ MaxTTL }}
CacheBehaviors:
Quantity: {{ Quantity }}
Items:
- PathPattern: "{{ PathPattern }}"
TargetOriginId: "{{ TargetOriginId }}"
TrustedSigners:
Enabled: {{ Enabled }}
Quantity: {{ Quantity }}
Items: "{{ Items }}"
TrustedKeyGroups:
Enabled: {{ Enabled }}
Quantity: {{ Quantity }}
Items: "{{ Items }}"
ViewerProtocolPolicy: "{{ ViewerProtocolPolicy }}"
AllowedMethods:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
CachedMethods: "{{ CachedMethods }}"
SmoothStreaming: {{ SmoothStreaming }}
Compress: {{ Compress }}
LambdaFunctionAssociations:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
FunctionAssociations:
Quantity: {{ Quantity }}
Items: "{{ Items }}"
FieldLevelEncryptionId: "{{ FieldLevelEncryptionId }}"
RealtimeLogConfigArn: "{{ RealtimeLogConfigArn }}"
CachePolicyId: "{{ CachePolicyId }}"
OriginRequestPolicyId: "{{ OriginRequestPolicyId }}"
ResponseHeadersPolicyId: "{{ ResponseHeadersPolicyId }}"
GrpcConfig:
Enabled: {{ Enabled }}
ForwardedValues:
QueryString: {{ QueryString }}
Cookies: "{{ Cookies }}"
Headers: "{{ Headers }}"
QueryStringCacheKeys: "{{ QueryStringCacheKeys }}"
MinTTL: {{ MinTTL }}
DefaultTTL: {{ DefaultTTL }}
MaxTTL: {{ MaxTTL }}
CustomErrorResponses:
Quantity: {{ Quantity }}
Items:
- ErrorCode: {{ ErrorCode }}
ResponsePagePath: "{{ ResponsePagePath }}"
ResponseCode: "{{ ResponseCode }}"
ErrorCachingMinTTL: {{ ErrorCachingMinTTL }}
Comment: "{{ Comment }}"
Logging:
Enabled: {{ Enabled }}
IncludeCookies: {{ IncludeCookies }}
Bucket: "{{ Bucket }}"
Prefix: "{{ Prefix }}"
PriceClass: "{{ PriceClass }}"
Enabled: {{ Enabled }}
ViewerCertificate:
CloudFrontDefaultCertificate: {{ CloudFrontDefaultCertificate }}
IAMCertificateId: "{{ IAMCertificateId }}"
ACMCertificateArn: "{{ ACMCertificateArn }}"
SSLSupportMethod: "{{ SSLSupportMethod }}"
MinimumProtocolVersion: "{{ MinimumProtocolVersion }}"
Certificate: "{{ Certificate }}"
CertificateSource: "{{ CertificateSource }}"
Restrictions:
GeoRestriction:
RestrictionType: "{{ RestrictionType }}"
Quantity: {{ Quantity }}
Items:
- "{{ Items }}"
WebACLId: "{{ WebACLId }}"
HttpVersion: "{{ HttpVersion }}"
IsIPV6Enabled: {{ IsIPV6Enabled }}
ContinuousDeploymentPolicyId: "{{ ContinuousDeploymentPolicyId }}"
Staging: {{ Staging }}
AnycastIpListId: "{{ AnycastIpListId }}"
TenantConfig:
ParameterDefinitions:
- Name: "{{ Name }}"
Definition:
StringSchema: "{{ StringSchema }}"
ConnectionMode: "{{ ConnectionMode }}"
ViewerMtlsConfig:
Mode: "{{ Mode }}"
TrustStoreConfig:
TrustStoreId: "{{ TrustStoreId }}"
AdvertiseTrustStoreCaNames: {{ AdvertiseTrustStoreCaNames }}
IgnoreCertificateExpiry: {{ IgnoreCertificateExpiry }}
ConnectionFunctionAssociation:
Id: "{{ Id }}"
CacheTagConfig:
HeaderName: "{{ HeaderName }}"
Tags:
Items:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: StreamingDistributionConfigWithTags
description: |
A streaming distribution Configuration and a list of tags to be associated with the streaming distribution.
value:
StreamingDistributionConfig:
CallerReference: "{{ CallerReference }}"
S3Origin:
DomainName: "{{ DomainName }}"
OriginAccessIdentity: "{{ OriginAccessIdentity }}"
Aliases:
Quantity: {{ Quantity }}
Items:
- "{{ Items }}"
Comment: "{{ Comment }}"
Logging:
Enabled: {{ Enabled }}
Bucket: "{{ Bucket }}"
Prefix: "{{ Prefix }}"
TrustedSigners:
Enabled: {{ Enabled }}
Quantity: {{ Quantity }}
Items:
- "{{ Items }}"
PriceClass: "{{ PriceClass }}"
Enabled: {{ Enabled }}
Tags:
Items:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- untag_resource
- tag_resource
Remove tags from a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide.
UPDATE aws.cloudfront.tags
SET
TagKeys = '{{ TagKeys }}'
WHERE
Resource = '{{ Resource }}' --required
AND region = '{{ region }}' --required
AND TagKeys = '{{ TagKeys }}' --required;
Add tags to a CloudFront resource. For more information, see Tagging a distribution in the Amazon CloudFront Developer Guide.
UPDATE aws.cloudfront.tags
SET
Tags = '{{ Tags }}'
WHERE
Resource = '{{ Resource }}' --required
AND region = '{{ region }}' --required;