distribution_tenants
Creates, updates, deletes or gets a distribution_tenant resource or lists distribution_tenants in a region
Overview
| Name | distribution_tenants |
| Type | Resource |
| Description | The distribution tenant. |
| Id | awscc.cloudfront.distribution_tenants |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | |
distribution_id | string | The ID of the multi-tenant distribution. |
name | string | The name of the distribution tenant. |
arn | string | |
domain_results | array | |
tags | array | A complex type that contains zero or more Tag elements. |
customizations | object | Customizations for the distribution tenant. For each distribution tenant, you can specify the geographic restrictions, and the Amazon Resource Names (ARNs) for the ACM certificate and WAF web ACL. These are specific values that you can override or disable from the multi-tenant distribution that was used to create the distribution tenant. |
parameters | array | A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution. |
connection_group_id | string | The ID of the connection group for the distribution tenant. If you don't specify a connection group, CloudFront uses the default connection group. |
created_time | string | |
last_modified_time | string | |
enabled | boolean | Indicates whether the distribution tenant is in an enabled state. If disabled, the distribution tenant won't serve traffic. |
status | string | |
e_tag | string | |
domains | array | The domains associated with the distribution tenant. |
managed_certificate_request | object | An object that represents the request for the Amazon CloudFront managed ACM certificate. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::CloudFront::DistributionTenant.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | distribution_tenants | INSERT | DistributionId, Name, Domains, region |
delete_resource | distribution_tenants | DELETE | Identifier, region |
update_resource | distribution_tenants | UPDATE | Identifier, PatchDocument, region |
list_resources | distribution_tenants_list_only | SELECT | region |
get_resource | distribution_tenants | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual distribution_tenant.
SELECT
region,
id,
distribution_id,
name,
arn,
domain_results,
tags,
customizations,
parameters,
connection_group_id,
created_time,
last_modified_time,
enabled,
status,
e_tag,
domains,
managed_certificate_request
FROM awscc.cloudfront.distribution_tenants
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all distribution_tenants in a region.
SELECT
region,
id
FROM awscc.cloudfront.distribution_tenants_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new distribution_tenant resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.cloudfront.distribution_tenants (
DistributionId,
Name,
Domains,
region
)
SELECT
'{{ distribution_id }}',
'{{ name }}',
'{{ domains }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.cloudfront.distribution_tenants (
DistributionId,
Name,
Tags,
Customizations,
Parameters,
ConnectionGroupId,
Enabled,
Domains,
ManagedCertificateRequest,
region
)
SELECT
'{{ distribution_id }}',
'{{ name }}',
'{{ tags }}',
'{{ customizations }}',
'{{ parameters }}',
'{{ connection_group_id }}',
'{{ enabled }}',
'{{ domains }}',
'{{ managed_certificate_request }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: distribution_tenant
props:
- name: distribution_id
value: '{{ distribution_id }}'
- name: name
value: '{{ name }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: customizations
value:
web_acl:
action: '{{ action }}'
arn: '{{ arn }}'
certificate:
arn: '{{ arn }}'
geo_restrictions:
restriction_type: '{{ restriction_type }}'
locations:
- '{{ locations[0] }}'
- name: parameters
value:
- name: '{{ name }}'
value: '{{ value }}'
- name: connection_group_id
value: '{{ connection_group_id }}'
- name: enabled
value: '{{ enabled }}'
- name: domains
value:
- '{{ domains[0] }}'
- name: managed_certificate_request
value:
validation_token_host: '{{ validation_token_host }}'
primary_domain_name: '{{ primary_domain_name }}'
certificate_transparency_logging_preference: '{{ certificate_transparency_logging_preference }}'
UPDATE example
Use the following StackQL query and manifest file to update a distribution_tenant resource, using stack-deploy.
/*+ update */
UPDATE awscc.cloudfront.distribution_tenants
SET PatchDocument = string('{{ {
"DistributionId": distribution_id,
"Tags": tags,
"Customizations": customizations,
"Parameters": parameters,
"ConnectionGroupId": connection_group_id,
"Enabled": enabled,
"Domains": domains,
"ManagedCertificateRequest": managed_certificate_request
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.cloudfront.distribution_tenants
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the distribution_tenants resource, the following permissions are required:
- Create
- Delete
- List
- Read
- Update
acm:DescribeCertificate,
acm:RequestCertificate,
cloudfront:CreateDistributionTenant,
cloudfront:GetDistributionTenant,
cloudfront:GetManagedCertificateDetails,
cloudfront:TagResource,
cloudfront:VerifyDnsConfiguration,
wafv2:GetWebACL
cloudfront:DeleteDistributionTenant,
cloudfront:UpdateDistributionTenant,
cloudfront:GetDistributionTenant,
wafv2:GetWebACL
cloudfront:ListDistributionTenants,
cloudfront:ListTagsForResource
cloudfront:GetDistributionTenant,
cloudfront:ListTagsForResource
acm:DescribeCertificate,
acm:RequestCertificate,
cloudfront:GetDistributionTenant,
cloudfront:GetManagedCertificateDetails,
cloudfront:UpdateDistributionTenant,
cloudfront:ListTagsForResource,
cloudfront:TagResource,
cloudfront:UntagResource,
cloudfront:VerifyDnsConfiguration,
wafv2:GetWebACL