components
Creates, updates, deletes or gets a component resource or lists components in a region
Overview
| Name | components |
| Type | Resource |
| Description | Resource schema for AWS::ImageBuilder::Component |
| Id | awscc.imagebuilder.components |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the component. |
name | string | The name of the component. |
version | string | The version of the component. |
description | string | The description of the component. |
change_description | string | The change description of the component. |
type | string | The type of the component denotes whether the component is used to build the image or only to test it. |
platform | string | The platform of the component. |
data | string | The data of the component. |
kms_key_id | string | The KMS key identifier used to encrypt the component. |
encrypted | boolean | The encryption status of the component. |
tags | object | The tags associated with the component. |
uri | string | The uri of the component. |
supported_os_versions | array | The operating system (OS) version supported by the component. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the component. |
region | string | AWS region. |
For more information, see AWS::ImageBuilder::Component.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | components | INSERT | Name, Platform, Version, region |
delete_resource | components | DELETE | Identifier, region |
update_resource | components | UPDATE | Identifier, PatchDocument, region |
list_resources | components_list_only | SELECT | region |
get_resource | components | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual component.
SELECT
region,
arn,
name,
version,
description,
change_description,
type,
platform,
data,
kms_key_id,
encrypted,
tags,
uri,
supported_os_versions
FROM awscc.imagebuilder.components
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all components in a region.
SELECT
region,
arn
FROM awscc.imagebuilder.components_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new component resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.imagebuilder.components (
Name,
Version,
Platform,
region
)
SELECT
'{{ name }}',
'{{ version }}',
'{{ platform }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.imagebuilder.components (
Name,
Version,
Description,
ChangeDescription,
Platform,
Data,
KmsKeyId,
Tags,
Uri,
SupportedOsVersions,
region
)
SELECT
'{{ name }}',
'{{ version }}',
'{{ description }}',
'{{ change_description }}',
'{{ platform }}',
'{{ data }}',
'{{ kms_key_id }}',
'{{ tags }}',
'{{ uri }}',
'{{ supported_os_versions }}',
'{{ 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: component
props:
- name: name
value: '{{ name }}'
- name: version
value: '{{ version }}'
- name: description
value: '{{ description }}'
- name: change_description
value: '{{ change_description }}'
- name: platform
value: '{{ platform }}'
- name: data
value: '{{ data }}'
- name: kms_key_id
value: '{{ kms_key_id }}'
- name: tags
value: {}
- name: uri
value: '{{ uri }}'
- name: supported_os_versions
value:
- '{{ supported_os_versions[0] }}'
UPDATE example
Use the following StackQL query and manifest file to update a component resource, using stack-deploy.
/*+ update */
UPDATE awscc.imagebuilder.components
SET PatchDocument = string('{{ {
"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.components
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 components resource, the following permissions are required:
- Create
- Update
- Read
- Delete
- List
iam:CreateServiceLinkedRole,
iam:GetRole,
kms:GenerateDataKey,
kms:GenerateDataKeyPair,
kms:GenerateDataKeyPairWithoutPlaintext,
kms:GenerateDataKeyWithoutPlaintext,
kms:Encrypt,
kms:Decrypt,
s3:GetObject,
s3:HeadBucket,
s3:GetBucketLocation,
imagebuilder:TagResource,
imagebuilder:GetComponent,
imagebuilder:CreateComponent
imagebuilder:TagResource,
imagebuilder:UntagResource
imagebuilder:GetComponent,
kms:Decrypt
imagebuilder:GetComponent,
imagebuilder:UntagResource,
imagebuilder:DeleteComponent
imagebuilder:ListComponents,
imagebuilder:ListComponentBuildVersions