Skip to main content

resource_policies

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

Overview

Nameresource_policies
TypeResource
Idaws.vpc_lattice.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policystringAn IAM policy. (pattern: <code>.\S.</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_policyselectresource_arn, regionRetrieves information about the specified resource policy. The resource policy is an IAM policy created on behalf of the resource owner when they share a resource.
put_resource_policyreplaceresource_arn, region, policyAttaches a resource-based permission policy to a service or service network. The policy must contain the same actions and condition statements as the Amazon Web Services Resource Access Manager permission for sharing services and service networks.
delete_resource_policydeleteresource_arn, regionDeletes the specified resource policy.

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
regionstringAWS region (default: us-east-1)
resource_arnstringThe Amazon Resource Name (ARN) of the resource.

SELECT examples

Retrieves information about the specified resource policy. The resource policy is an IAM policy created on behalf of the resource owner when they share a resource.

SELECT
policy
FROM aws.vpc_lattice.resource_policies
WHERE resource_arn = '{{ resource_arn }}' -- required
AND region = '{{ region }}' -- required
;

REPLACE examples

Attaches a resource-based permission policy to a service or service network. The policy must contain the same actions and condition statements as the Amazon Web Services Resource Access Manager permission for sharing services and service networks.

REPLACE aws.vpc_lattice.resource_policies
SET
policy = '{{ policy }}'
WHERE
resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required
AND policy = '{{ policy }}' --required;

DELETE examples

Deletes the specified resource policy.

DELETE FROM aws.vpc_lattice.resource_policies
WHERE resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required
;