resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.networkmanager.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get_resource_policy
| Name | Datatype | Description |
|---|---|---|
policy_document | string | The resource policy document. (pattern: <code>[\s\S]*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_policy | select | resource_arn, region | Returns information about a resource policy. | |
put_resource_policy | replace | resource_arn, region, PolicyDocument | Creates or updates a resource policy. | |
delete_resource_policy | delete | resource_arn, region | Deletes a resource policy for the specified resource. This revokes the access of the principals specified in the 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
resource_arn | string | The ARN of the policy to delete. |
SELECT examples
- get_resource_policy
Returns information about a resource policy.
SELECT
policy_document
FROM aws.networkmanager.resource_policies
WHERE resource_arn = '{{ resource_arn }}' -- required
AND region = '{{ region }}' -- required
;
REPLACE examples
- put_resource_policy
Creates or updates a resource policy.
REPLACE aws.networkmanager.resource_policies
SET
PolicyDocument = '{{ PolicyDocument }}'
WHERE
resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required
AND PolicyDocument = '{{ PolicyDocument }}' --required;
DELETE examples
- delete_resource_policy
Deletes a resource policy for the specified resource. This revokes the access of the principals specified in the resource policy.
DELETE FROM aws.networkmanager.resource_policies
WHERE resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required
;