Skip to main content

image_policies

Creates, updates, deletes, gets or lists an image_policies resource.

Overview

Nameimage_policies
TypeResource
Idaws.imagebuilder.image_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policystringThe image policy object.
request_idstringThe request ID that uniquely identifies this request.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_image_policyselectimageArn, regionGets an image policy.
put_image_policyreplaceregion, imageArn, policyApplies 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.

NameDatatypeDescription
imageArnstringThe Amazon Resource Name (ARN) of the image whose policy you want to retrieve.
regionstringAWS region (default: us-east-1)

SELECT examples

Gets an image policy.

SELECT
policy,
request_id
FROM aws.imagebuilder.image_policies
WHERE imageArn = '{{ imageArn }}' -- required
AND region = '{{ region }}' -- required
;

REPLACE examples

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;