permission_versions
Creates, updates, deletes, gets or lists a permission_versions resource.
Overview
| Name | permission_versions |
| Type | Resource |
| Id | aws.ram.permission_versions |
Fields
The following fields are returned by SELECT queries:
- list_permission_versions
| Name | Datatype | Description |
|---|---|---|
next_token | string | If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null. This indicates that this is the last page of results. |
permissions | array | An array of objects that contain details for each of the available versions. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_permission_versions | select | region | Lists the available versions of the specified RAM permission. Always check the NextToken response parameter for a null value when calling a paginated operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken response parameter value is null only when there are no more results to display. | |
create_permission_version | insert | region, permissionArn, policyTemplate | Creates a new version of the specified customer managed permission. The new version is automatically set as the default version of the customer managed permission. New resource shares automatically use the default permission. Existing resource shares continue to use their original permission versions, but you can use ReplacePermissionAssociations to update them. If the specified customer managed permission already has the maximum of 5 versions, then you must delete one of the existing versions before you can create a new one. | |
set_default_permission_version | update | region, permissionArn, permissionVersion | Designates the specified version number as the default version for the specified customer managed permission. New resource shares automatically use this new default permission. Existing resource shares continue to use their original permission version, but you can use ReplacePermissionAssociations to update them. | |
delete_permission_version | delete | permissionArn, permissionVersion, region | clientToken | Deletes one version of a customer managed permission. The version you specify must not be attached to any resource share and must not be the default version for the permission. If a customer managed permission has the maximum of 5 versions, then you must delete at least one version before you can create another. |
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 |
|---|---|---|
permissionArn | string | Specifies the Amazon Resource Name (ARN) of the permission with the version you want to delete. |
permissionVersion | integer | Specifies the version number to delete. You can't delete the default version for a customer managed permission. You can't delete a version if it's the only version of the permission. You must either first create another version, or delete the permission completely. You can't delete a version if it is attached to any resource shares. If the version is the default, you must first use SetDefaultPermissionVersion to set a different version as the default for the customer managed permission, and then use AssociateResourceSharePermission to update your resource shares to use the new default version. |
region | string | AWS region (default: us-east-1) |
clientToken | string | Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.. If you don't provide this value, then Amazon Web Services generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotentParameterMismatch error. |
SELECT examples
- list_permission_versions
Lists the available versions of the specified RAM permission. Always check the NextToken response parameter for a null value when calling a paginated operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken response parameter value is null only when there are no more results to display.
SELECT
next_token,
permissions
FROM aws.ram.permission_versions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_permission_version
- Manifest
Creates a new version of the specified customer managed permission. The new version is automatically set as the default version of the customer managed permission. New resource shares automatically use the default permission. Existing resource shares continue to use their original permission versions, but you can use ReplacePermissionAssociations to update them. If the specified customer managed permission already has the maximum of 5 versions, then you must delete one of the existing versions before you can create a new one.
INSERT INTO aws.ram.permission_versions (
permissionArn,
policyTemplate,
clientToken,
region
)
SELECT
'{{ permissionArn }}' /* required */,
'{{ policyTemplate }}' /* required */,
'{{ clientToken }}',
'{{ region }}'
RETURNING
client_token,
permission
;
# Description fields are for documentation purposes
- name: permission_versions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the permission_versions resource.
- name: permissionArn
value: "{{ permissionArn }}"
- name: policyTemplate
value: "{{ policyTemplate }}"
- name: clientToken
value: "{{ clientToken }}"
UPDATE examples
- set_default_permission_version
Designates the specified version number as the default version for the specified customer managed permission. New resource shares automatically use this new default permission. Existing resource shares continue to use their original permission version, but you can use ReplacePermissionAssociations to update them.
UPDATE aws.ram.permission_versions
SET
permissionArn = '{{ permissionArn }}',
permissionVersion = {{ permissionVersion }},
clientToken = '{{ clientToken }}'
WHERE
region = '{{ region }}' --required
AND permissionArn = '{{ permissionArn }}' --required
AND permissionVersion = '{{ permissionVersion }}' --required
RETURNING
client_token,
return_value;
DELETE examples
- delete_permission_version
Deletes one version of a customer managed permission. The version you specify must not be attached to any resource share and must not be the default version for the permission. If a customer managed permission has the maximum of 5 versions, then you must delete at least one version before you can create another.
DELETE FROM aws.ram.permission_versions
WHERE permissionArn = '{{ permissionArn }}' --required
AND permissionVersion = '{{ permissionVersion }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
;