Skip to main content

assignments

Creates, updates, deletes or gets an assignment resource or lists assignments in a region

Overview

Nameassignments
TypeResource
DescriptionResource Type definition for SSO assignmet
Idaws.sso.assignments

Fields

NameDatatypeDescription
instance_arnstringThe sso instance that the permission set is owned.
target_idstringThe account id to be provisioned.
target_typestringThe type of resource to be provsioned to, only aws account now
permission_set_arnstringThe permission set that the assignemt will be assigned
principal_typestringThe assignee's type, user/group
principal_idstringThe assignee's identifier, user id/group id
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTInstanceArn, TargetId, TargetType, PermissionSetArn, PrincipalType, PrincipalId, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all assignments in a region.

SELECT
region,
instance_arn,
target_id,
target_type,
permission_set_arn,
principal_type,
principal_id
FROM aws.sso.assignments
WHERE region = 'us-east-1';

Gets all properties from an individual assignment.

SELECT
region,
instance_arn,
target_id,
target_type,
permission_set_arn,
principal_type,
principal_id
FROM aws.sso.assignments
WHERE region = 'us-east-1' AND data__Identifier = '<InstanceArn>|<TargetId>|<TargetType>|<PermissionSetArn>|<PrincipalType>|<PrincipalId>';

INSERT example

Use the following StackQL query and manifest file to create a new assignment resource, using stack-deploy.

/*+ create */
INSERT INTO aws.sso.assignments (
InstanceArn,
TargetId,
TargetType,
PermissionSetArn,
PrincipalType,
PrincipalId,
region
)
SELECT
'{{ InstanceArn }}',
'{{ TargetId }}',
'{{ TargetType }}',
'{{ PermissionSetArn }}',
'{{ PrincipalType }}',
'{{ PrincipalId }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.sso.assignments
WHERE data__Identifier = '<InstanceArn|TargetId|TargetType|PermissionSetArn|PrincipalType|PrincipalId>'
AND region = 'us-east-1';

Permissions

To operate on the assignments resource, the following permissions are required:

Create

sso:CreateAccountAssignment,
sso:DescribeAccountAssignmentCreationStatus,
sso:ListAccountAssignments,
iam:GetSAMLProvider,
iam:CreateSAMLProvider,
iam:AttachRolePolicy,
iam:PutRolePolicy,
iam:CreateRole,
iam:ListRolePolicies

Read

sso:ListAccountAssignments,
iam:GetSAMLProvider,
iam:ListRolePolicies

Delete

sso:ListAccountAssignments,
sso:DeleteAccountAssignment,
sso:DescribeAccountAssignmentDeletionStatus,
iam:GetSAMLProvider,
iam:ListRolePolicies

List

sso:ListAccountAssignments,
iam:ListRolePolicies