Skip to main content

container_recipe_policies

Creates, updates, deletes, gets or lists a container_recipe_policies resource.

Overview

Namecontainer_recipe_policies
TypeResource
Idaws.imagebuilder.container_recipe_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policystringThe container recipe policy object that is returned.
request_idstringThe request ID that uniquely identifies this request.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_container_recipe_policyselectcontainerRecipeArn, regionRetrieves the policy for a container recipe.
put_container_recipe_policyreplaceregion, containerRecipeArn, policyApplies a policy to a container image. We recommend that you call the RAM API CreateResourceShare (https:​//docs.aws.amazon.com//ram/latest/APIReference/API_CreateResourceShare.html) to share resources. If you call the Image Builder API PutContainerImagePolicy, you must also call the RAM API PromoteResourceShareCreatedFromPolicy (https:​//docs.aws.amazon.com//ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html) 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
containerRecipeArnstringThe Amazon Resource Name (ARN) of the container recipe for the policy being requested.
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves the policy for a container recipe.

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

REPLACE examples

Applies a policy to a container image. We recommend that you call the RAM API CreateResourceShare (https://docs.aws.amazon.com//ram/latest/APIReference/API_CreateResourceShare.html) to share resources. If you call the Image Builder API PutContainerImagePolicy, you must also call the RAM API PromoteResourceShareCreatedFromPolicy (https://docs.aws.amazon.com//ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html) in order for the resource to be visible to all principals with whom the resource is shared.

REPLACE aws.imagebuilder.container_recipe_policies
SET
containerRecipeArn = '{{ containerRecipeArn }}',
policy = '{{ policy }}'
WHERE
region = '{{ region }}' --required
AND containerRecipeArn = '{{ containerRecipeArn }}' --required
AND policy = '{{ policy }}' --required
RETURNING
container_recipe_arn,
request_id;