Skip to main content

impersonation_roles

Creates, updates, deletes, gets or lists an impersonation_roles resource.

Overview

Nameimpersonation_roles
TypeResource
Idaws.workmail.impersonation_roles

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
date_createdstring (date-time)The date when the impersonation role was created.
date_modifiedstring (date-time)The date when the impersonation role was last modified.
descriptionstringThe impersonation role description. (pattern: <code>[^\x00-\x09\x0B\x0C\x0E-\x1F\x7F\x3C\x3E\x5C]+</code>)
impersonation_role_idstringThe impersonation role ID. (pattern: <code>[a-zA-Z0-9_-]+</code>)
namestringThe impersonation role name. (pattern: <code>[^\x00-\x1F\x7F\x3C\x3E\x5C]+</code>)
rulesarrayThe list of rules for the given impersonation role.
typestringThe impersonation role type. (FULL_ACCESS, READ_ONLY)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_impersonation_roleselectregionGets the impersonation role details for the given WorkMail organization.
list_impersonation_rolesselectregionLists all the impersonation roles for the given WorkMail organization.
create_impersonation_roleinsertregion, OrganizationIdCreates an impersonation role for the given WorkMail organization. Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries also complete successfully without performing any further actions.
update_impersonation_roleupdateregion, OrganizationId, ImpersonationRoleIdUpdates an impersonation role for the given WorkMail organization.
delete_impersonation_roledeleteregionDeletes an impersonation role for the given WorkMail organization.
assume_impersonation_roleexecregion, OrganizationId, ImpersonationRoleIdAssumes an impersonation role for the given WorkMail organization. This method returns an authentication token you can use to make impersonated calls.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Gets the impersonation role details for the given WorkMail organization.

SELECT
date_created,
date_modified,
description,
impersonation_role_id,
name,
rules,
type
FROM aws.workmail.impersonation_roles
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an impersonation role for the given WorkMail organization. Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries also complete successfully without performing any further actions.

INSERT INTO aws.workmail.impersonation_roles (
ClientToken,
OrganizationId,
Name,
Type,
Description,
Rules,
region
)
SELECT
'{{ ClientToken }}',
'{{ OrganizationId }}' /* required */,
'{{ Name }}',
'{{ Type }}',
'{{ Description }}',
'{{ Rules }}',
'{{ region }}'
RETURNING
impersonation_role_id
;

UPDATE examples

Updates an impersonation role for the given WorkMail organization.

UPDATE aws.workmail.impersonation_roles
SET
OrganizationId = '{{ OrganizationId }}',
ImpersonationRoleId = '{{ ImpersonationRoleId }}',
Name = '{{ Name }}',
Type = '{{ Type }}',
Description = '{{ Description }}',
Rules = '{{ Rules }}'
WHERE
region = '{{ region }}' --required
AND OrganizationId = '{{ OrganizationId }}' --required
AND ImpersonationRoleId = '{{ ImpersonationRoleId }}' --required;

DELETE examples

Deletes an impersonation role for the given WorkMail organization.

DELETE FROM aws.workmail.impersonation_roles
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Assumes an impersonation role for the given WorkMail organization. This method returns an authentication token you can use to make impersonated calls.

EXEC aws.workmail.impersonation_roles.assume_impersonation_role
@region='{{ region }}' --required
@@json=
'{
"OrganizationId": "{{ OrganizationId }}",
"ImpersonationRoleId": "{{ ImpersonationRoleId }}"
}'
;