image_policies
Creates, updates, deletes, gets or lists an image_policies resource.
Overview
| Name | image_policies |
| Type | Resource |
| Id | aws.imagebuilder.image_policies |
Fields
The following fields are returned by SELECT queries:
- get_image_policy
| Name | Datatype | Description |
|---|---|---|
policy | string | The image policy object. |
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_image_policy | select | imageArn, region | Gets an image policy. | |
put_image_policy | replace | region, imageArn, policy | Applies a policy to an image. We recommend that you call the RAM API CreateResourceShare to share resources. If you call the Image Builder API PutImagePolicy, 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 |
|---|---|---|
imageArn | string | The Amazon Resource Name (ARN) of the image whose policy you want to retrieve. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_image_policy
Gets an image policy.
SELECT
policy,
request_id
FROM aws.imagebuilder.image_policies
WHERE imageArn = '{{ imageArn }}' -- required
AND region = '{{ region }}' -- required
;
REPLACE examples
- put_image_policy
Applies a policy to an image. We recommend that you call the RAM API CreateResourceShare to share resources. If you call the Image Builder API PutImagePolicy, 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.image_policies
SET
imageArn = '{{ imageArn }}',
policy = '{{ policy }}'
WHERE
region = '{{ region }}' --required
AND imageArn = '{{ imageArn }}' --required
AND policy = '{{ policy }}' --required
RETURNING
image_arn,
request_id;