component_policies
Creates, updates, deletes, gets or lists a component_policies resource.
Overview
| Name | component_policies |
| Type | Resource |
| Id | aws.imagebuilder.component_policies |
Fields
The following fields are returned by SELECT queries:
- get_component_policy
| Name | Datatype | Description |
|---|---|---|
policy | string | The component policy. |
request_id | string | The request ID that uniquely identifies this request. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_component_policy | select | componentArn, region | Gets a component policy. | |
put_component_policy | replace | region, componentArn, policy | Applies a policy to a component. We recommend that you call the RAM API CreateResourceShare to share resources. If you call the Image Builder API PutComponentPolicy, you must also call the RAM API PromoteResourceShareCreatedFromPolicy in order for the resource to be visible to all principals with whom the resource is shared. |
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 |
|---|---|---|
componentArn | string | The Amazon Resource Name (ARN) of the component whose policy you want to retrieve. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_component_policy
Gets a component policy.
SELECT
policy,
request_id
FROM aws.imagebuilder.component_policies
WHERE componentArn = '{{ componentArn }}' -- required
AND region = '{{ region }}' -- required
;
REPLACE examples
- put_component_policy
Applies a policy to a component. We recommend that you call the RAM API CreateResourceShare to share resources. If you call the Image Builder API PutComponentPolicy, you must also call the RAM API PromoteResourceShareCreatedFromPolicy in order for the resource to be visible to all principals with whom the resource is shared.
REPLACE aws.imagebuilder.component_policies
SET
componentArn = '{{ componentArn }}',
policy = '{{ policy }}'
WHERE
region = '{{ region }}' --required
AND componentArn = '{{ componentArn }}' --required
AND policy = '{{ policy }}' --required
RETURNING
component_arn,
request_id;