distribution_configurations
Creates, updates, deletes or gets a distribution_configuration resource or lists distribution_configurations in a region
Overview
| Name | distribution_configurations |
| Type | Resource |
| Description | Resource schema for AWS::ImageBuilder::DistributionConfiguration |
| Id | awscc.imagebuilder.distribution_configurations |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the distribution configuration. |
name | string | The name of the distribution configuration. |
description | string | The description of the distribution configuration. |
distributions | array | The distributions of the distribution configuration. |
tags | object | The tags associated with the component. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the distribution configuration. |
region | string | AWS region. |
For more information, see AWS::ImageBuilder::DistributionConfiguration.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | distribution_configurations | INSERT | Name, Distributions, region |
delete_resource | distribution_configurations | DELETE | Identifier, region |
update_resource | distribution_configurations | UPDATE | Identifier, PatchDocument, region |
list_resources | distribution_configurations_list_only | SELECT | region |
get_resource | distribution_configurations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual distribution_configuration.
SELECT
region,
arn,
name,
description,
distributions,
tags
FROM awscc.imagebuilder.distribution_configurations
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all distribution_configurations in a region.
SELECT
region,
arn
FROM awscc.imagebuilder.distribution_configurations_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new distribution_configuration resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.imagebuilder.distribution_configurations (
Name,
Distributions,
region
)
SELECT
'{{ name }}',
'{{ distributions }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.imagebuilder.distribution_configurations (
Name,
Description,
Distributions,
Tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ distributions }}',
'{{ tags }}',
'{{ 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_configuration
props:
- name: name
value: '{{ name }}'
- name: description
value: '{{ description }}'
- name: distributions
value:
- region: '{{ region }}'
ami_distribution_configuration:
name: '{{ name }}'
kms_key_id: '{{ kms_key_id }}'
description: '{{ description }}'
ami_tags: {}
target_account_ids:
- '{{ target_account_ids[0] }}'
launch_permission_configuration:
user_ids:
- '{{ user_ids[0] }}'
user_groups:
- '{{ user_groups[0] }}'
organization_arns:
- '{{ organization_arns[0] }}'
organizational_unit_arns:
- '{{ organizational_unit_arns[0] }}'
container_distribution_configuration:
description: '{{ description }}'
container_tags:
- '{{ container_tags[0] }}'
target_repository:
service: '{{ service }}'
repository_name: '{{ repository_name }}'
license_configuration_arns:
- '{{ license_configuration_arns[0] }}'
launch_template_configurations:
- launch_template_id: '{{ launch_template_id }}'
account_id: '{{ account_id }}'
set_default_version: '{{ set_default_version }}'
fast_launch_configurations:
- account_id: '{{ account_id }}'
enabled: '{{ enabled }}'
launch_template:
launch_template_id: '{{ launch_template_id }}'
launch_template_name: '{{ launch_template_name }}'
launch_template_version: '{{ launch_template_version }}'
max_parallel_launches: '{{ max_parallel_launches }}'
snapshot_configuration:
target_resource_count: '{{ target_resource_count }}'
ssm_parameter_configurations:
- ami_account_id: '{{ ami_account_id }}'
parameter_name: '{{ parameter_name }}'
data_type: '{{ data_type }}'
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a distribution_configuration resource, using stack-deploy.
/*+ update */
UPDATE awscc.imagebuilder.distribution_configurations
SET PatchDocument = string('{{ {
"Description": description,
"Distributions": distributions,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.imagebuilder.distribution_configurations
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
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_configurations resource, the following permissions are required:
- Create
- Update
- Read
- Delete
- List
iam:GetRole,
iam:CreateServiceLinkedRole,
ec2:DescribeLaunchTemplates,
ec2:CreateLaunchTemplateVersion,
ec2:ModifyLaunchTemplate,
ssm:GetParameter,
imagebuilder:TagResource,
imagebuilder:GetDistributionConfiguration,
imagebuilder:CreateDistributionConfiguration
ec2:DescribeLaunchTemplates,
ec2:CreateLaunchTemplateVersion,
ec2:ModifyLaunchTemplate,
ssm:GetParameter,
imagebuilder:GetDistributionConfiguration,
imagebuilder:UpdateDistributionConfiguration,
imagebuilder:TagResource,
imagebuilder:UntagResource
imagebuilder:GetDistributionConfiguration
imagebuilder:GetDistributionConfiguration,
imagebuilder:UntagResource,
imagebuilder:DeleteDistributionConfiguration
imagebuilder:ListDistributionConfigurations