Skip to main content

component_policies

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

Overview

Namecomponent_policies
TypeResource
Idaws.imagebuilder.component_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policystringThe component policy.
request_idstringThe request ID that uniquely identifies this request.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_component_policyselectcomponentArn, regionGets a component policy.
put_component_policyreplaceregion, componentArn, policyApplies 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.

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

SELECT examples

Gets a component policy.

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

REPLACE examples

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;