resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.mpa.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get_resource_policy
- list_resource_policies
| Name | Datatype | Description |
|---|---|---|
policy_document | string | Document that contains the contents for the policy. |
policy_name | string | Name of the policy. |
policy_type | string | The type of policy (AWS_MANAGED, AWS_RAM) |
policy_version_arn | string | Amazon Resource Name (ARN) for the policy version. |
resource_arn | string | Amazon Resource Name (ARN) for the resource. |
| Name | Datatype | Description |
|---|---|---|
policy_arn | string | Amazon Resource Name (ARN) for policy. |
policy_name | string | Name of the policy. |
policy_type | string | The type of policy. (AWS_MANAGED, AWS_RAM) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_policy | select | region | Returns details about a policy for a resource. | |
list_resource_policies | select | resource_arn, region | MaxResults, NextToken | Returns a list of policies for a 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
resource_arn | string | Amazon Resource Name (ARN) for the resource. |
MaxResults | integer | The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results. |
NextToken | string | If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a next call to the operation to get more output. You can repeat this until the NextToken response element returns null. |
SELECT examples
- get_resource_policy
- list_resource_policies
Returns details about a policy for a resource.
SELECT
policy_document,
policy_name,
policy_type,
policy_version_arn,
resource_arn
FROM aws.mpa.resource_policies
WHERE region = '{{ region }}' -- required
;
Returns a list of policies for a resource.
SELECT
policy_arn,
policy_name,
policy_type
FROM aws.mpa.resource_policies
WHERE resource_arn = '{{ resource_arn }}' -- required
AND region = '{{ region }}' -- required
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;