Skip to main content

permission_versions

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

Overview

Namepermission_versions
TypeResource
Idaws.ram.permission_versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
next_tokenstringIf 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.
permissionsarrayAn array of objects that contain details for each of the available versions.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_permission_versionsselectregionLists 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_versioninsertregion, permissionArn, policyTemplateCreates 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_versionupdateregion, permissionArn, permissionVersionDesignates 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_versiondeletepermissionArn, permissionVersion, regionclientTokenDeletes 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.

NameDatatypeDescription
permissionArnstringSpecifies the Amazon Resource Name (ARN) of the permission with the version you want to delete.
permissionVersionintegerSpecifies 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.
regionstringAWS region (default: us-east-1)
clientTokenstringSpecifies 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

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

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
;

UPDATE examples

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

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 }}'
;