Skip to main content

profiles

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

Overview

Nameprofiles
TypeResource
Idaws.rolesanywhere.profiles

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the profile. (pattern: <code>[ a-zA-Z0-9-_]*</code>)
accept_role_session_namebooleanUsed to determine if a custom role session name will be accepted in a temporary credential request.
attribute_mappingsarrayA mapping applied to the authenticating end-entity certificate.
created_atstring (date-time)The ISO-8601 timestamp when the profile was created.
created_bystringThe Amazon Web Services account that created the profile.
duration_secondsintegerUsed to determine how long sessions vended using this profile are valid for. See the Expiration section of the CreateSession API documentation page for more details. In requests, if this value is not provided, the default value will be 3600.
enabledbooleanIndicates whether the profile is enabled.
managed_policy_arnsarrayA list of managed policy ARNs that apply to the vended session credentials.
profile_arnstringThe ARN of the profile. (pattern: <code>arn:aws(-[^:]+)?:rolesanywhere(:.){2}(:profile.)</code>)
profile_idstringThe unique identifier of the profile. (pattern: <code>.[a-f0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}.</code>)
require_instance_propertiesbooleanUnused, saved for future use. Will likely specify whether instance properties are required in temporary credential requests with this profile.
role_arnsarrayA list of IAM roles that this profile can assume in a temporary credential request.
session_policystringA session policy that applies to the trust boundary of the vended session credentials.
updated_atstring (date-time)The ISO-8601 timestamp when the profile was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_profileselectprofile_id, regionGets a profile. Required permissions: rolesanywhere:GetProfile.
list_profilesselectregionnextToken, pageSizeLists all profiles in the authenticated account and Amazon Web Services Region. Required permissions: rolesanywhere:ListProfiles.
create_profileinsertregion, name, roleArnsCreates a profile, a list of the roles that Roles Anywhere service is trusted to assume. You use profiles to intersect permissions with IAM managed policies. Required permissions: rolesanywhere:CreateProfile.
update_profileupdateprofile_id, regionUpdates a profile, a list of the roles that IAM Roles Anywhere service is trusted to assume. You use profiles to intersect permissions with IAM managed policies. Required permissions: rolesanywhere:UpdateProfile.
put_attribute_mappingreplaceprofile_id, region, certificateField, mappingRulesPut an entry in the attribute mapping rules that will be enforced by a given profile. A mapping specifies a certificate field and one or more specifiers that have contextual meanings.
delete_attribute_mappingdeleteprofile_id, certificateField, regionspecifiersDelete an entry from the attribute mapping rules enforced by a given profile.
delete_profiledeleteprofile_id, regionDeletes a profile. Required permissions: rolesanywhere:DeleteProfile.
disable_profileexecprofile_id, regionDisables a profile. When disabled, temporary credential requests with this profile fail. Required permissions: rolesanywhere:DisableProfile.
enable_profileexecprofile_id, regionEnables temporary credential requests for a profile. Required permissions: rolesanywhere:EnableProfile.

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
certificateFieldstringFields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
profile_idstringThe unique identifier of the profile.
regionstringAWS region (default: us-east-1)
nextTokenstringA token that indicates where the output should continue from, if a previous request did not show all results. To get the next results, make the request again with this value.
pageSizeintegerThe number of resources in the paginated list.
specifiersarrayA list of specifiers of a certificate field; for example, CN, OU, UID from a Subject.

SELECT examples

Gets a profile. Required permissions: rolesanywhere:GetProfile.

SELECT
name,
accept_role_session_name,
attribute_mappings,
created_at,
created_by,
duration_seconds,
enabled,
managed_policy_arns,
profile_arn,
profile_id,
require_instance_properties,
role_arns,
session_policy,
updated_at
FROM aws.rolesanywhere.profiles
WHERE profile_id = '{{ profile_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a profile, a list of the roles that Roles Anywhere service is trusted to assume. You use profiles to intersect permissions with IAM managed policies. Required permissions: rolesanywhere:CreateProfile.

INSERT INTO aws.rolesanywhere.profiles (
name,
requireInstanceProperties,
sessionPolicy,
roleArns,
managedPolicyArns,
durationSeconds,
enabled,
tags,
acceptRoleSessionName,
region
)
SELECT
'{{ name }}' /* required */,
{{ requireInstanceProperties }},
'{{ sessionPolicy }}',
'{{ roleArns }}' /* required */,
'{{ managedPolicyArns }}',
{{ durationSeconds }},
{{ enabled }},
'{{ tags }}',
{{ acceptRoleSessionName }},
'{{ region }}'
RETURNING
profile
;

UPDATE examples

Updates a profile, a list of the roles that IAM Roles Anywhere service is trusted to assume. You use profiles to intersect permissions with IAM managed policies. Required permissions: rolesanywhere:UpdateProfile.

UPDATE aws.rolesanywhere.profiles
SET
name = '{{ name }}',
sessionPolicy = '{{ sessionPolicy }}',
roleArns = '{{ roleArns }}',
managedPolicyArns = '{{ managedPolicyArns }}',
durationSeconds = {{ durationSeconds }},
acceptRoleSessionName = {{ acceptRoleSessionName }}
WHERE
profile_id = '{{ profile_id }}' --required
AND region = '{{ region }}' --required
RETURNING
profile;

REPLACE examples

Put an entry in the attribute mapping rules that will be enforced by a given profile. A mapping specifies a certificate field and one or more specifiers that have contextual meanings.

REPLACE aws.rolesanywhere.profiles
SET
certificateField = '{{ certificateField }}',
mappingRules = '{{ mappingRules }}'
WHERE
profile_id = '{{ profile_id }}' --required
AND region = '{{ region }}' --required
AND certificateField = '{{ certificateField }}' --required
AND mappingRules = '{{ mappingRules }}' --required
RETURNING
profile;

DELETE examples

Delete an entry from the attribute mapping rules enforced by a given profile.

DELETE FROM aws.rolesanywhere.profiles
WHERE profile_id = '{{ profile_id }}' --required
AND certificateField = '{{ certificateField }}' --required
AND region = '{{ region }}' --required
AND specifiers = '{{ specifiers }}'
;

Lifecycle Methods

Disables a profile. When disabled, temporary credential requests with this profile fail. Required permissions: rolesanywhere:DisableProfile.

EXEC aws.rolesanywhere.profiles.disable_profile
@profile_id='{{ profile_id }}' --required,
@region='{{ region }}' --required
;