Skip to main content

resource_policies

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

Overview

Nameresource_policies
TypeResource
Idaws.redshift.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policystringThe content of a resource policy.
resource_arnstringThe resources that a policy is attached to.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_policyselectResourceArn, regionGet the resource policy for a specified resource.
put_resource_policyreplaceResourceArn, regionPolicyUpdates the resource policy for a specified resource.
delete_resource_policydeleteResourceArn, regionDeletes the resource policy for a specified resource.

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
ResourceArnstringThe Amazon Resource Name (ARN) of the resource of which its resource policy is deleted.
regionstringAWS region (default: us-east-1)
PolicystringThe content of the resource policy being updated.

SELECT examples

Get the resource policy for a specified resource.

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

REPLACE examples

Updates the resource policy for a specified resource.

REPLACE aws.redshift.resource_policies
SET
-- No updatable properties
WHERE
ResourceArn = '{{ ResourceArn }}' --required
AND region = '{{ region }}' --required
AND Policy = '{{ Policy}}'
RETURNING
policy,
resource_arn;

DELETE examples

Deletes the resource policy for a specified resource.

DELETE FROM aws.redshift.resource_policies
WHERE ResourceArn = '{{ ResourceArn }}' --required
AND region = '{{ region }}' --required
;