SSOAdmin / Client / create_account_assignment

create_account_assignment#

SSOAdmin.Client.create_account_assignment(**kwargs)#

Assigns access to a principal for a specified AWS account using a specified permission set.

Note

The term principal here refers to a user or group that is defined in IAM Identity Center.

Note

As part of a successful CreateAccountAssignment call, the specified permission set will automatically be provisioned to the account in the form of an IAM policy. That policy is attached to the IAM role created in IAM Identity Center. If the permission set is subsequently updated, the corresponding IAM policies attached to roles in your accounts will not be updated automatically. In this case, you must call ``ProvisionPermissionSet ``to make these updates.

Note

After a successful response, call DescribeAccountAssignmentCreationStatus to describe the status of an assignment creation request.

See also: AWS API Documentation

Request Syntax

response = client.create_account_assignment(
    InstanceArn='string',
    TargetId='string',
    TargetType='AWS_ACCOUNT',
    PermissionSetArn='string',
    PrincipalType='USER'|'GROUP',
    PrincipalId='string'
)
Parameters:
  • InstanceArn (string) –

    [REQUIRED]

    The ARN of the IAM Identity Center instance under which the operation will be executed. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

  • TargetId (string) –

    [REQUIRED]

    TargetID is an AWS account identifier, typically a 10-12 digit string (For example, 123456789012).

  • TargetType (string) –

    [REQUIRED]

    The entity type for which the assignment will be created.

  • PermissionSetArn (string) –

    [REQUIRED]

    The ARN of the permission set that the admin wants to grant the principal access to.

  • PrincipalType (string) –

    [REQUIRED]

    The entity type for which the assignment will be created.

  • PrincipalId (string) –

    [REQUIRED]

    An identifier for an object in IAM Identity Center, such as a user or group. PrincipalIds are GUIDs (For example, f81d4fae-7dec-11d0-a765-00a0c91e6bf6). For more information about PrincipalIds in IAM Identity Center, see the IAM Identity Center Identity Store API Reference.

Return type:

dict

Returns:

Response Syntax

{
    'AccountAssignmentCreationStatus': {
        'Status': 'IN_PROGRESS'|'FAILED'|'SUCCEEDED',
        'RequestId': 'string',
        'FailureReason': 'string',
        'TargetId': 'string',
        'TargetType': 'AWS_ACCOUNT',
        'PermissionSetArn': 'string',
        'PrincipalType': 'USER'|'GROUP',
        'PrincipalId': 'string',
        'CreatedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    • AccountAssignmentCreationStatus (dict) –

      The status object for the account assignment creation operation.

      • Status (string) –

        The status of the permission set provisioning process.

      • RequestId (string) –

        The identifier for tracking the request operation that is generated by the universally unique identifier (UUID) workflow.

      • FailureReason (string) –

        The message that contains an error or exception in case of an operation failure.

      • TargetId (string) –

        TargetID is an AWS account identifier, typically a 10-12 digit string (For example, 123456789012).

      • TargetType (string) –

        The entity type for which the assignment will be created.

      • PermissionSetArn (string) –

        The ARN of the permission set. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

      • PrincipalType (string) –

        The entity type for which the assignment will be created.

      • PrincipalId (string) –

        An identifier for an object in IAM Identity Center, such as a user or group. PrincipalIds are GUIDs (For example, f81d4fae-7dec-11d0-a765-00a0c91e6bf6). For more information about PrincipalIds in IAM Identity Center, see the IAM Identity Center Identity Store API Reference.

      • CreatedDate (datetime) –

        The date that the permission set was created.

Exceptions

  • SSOAdmin.Client.exceptions.ResourceNotFoundException

  • SSOAdmin.Client.exceptions.InternalServerException

  • SSOAdmin.Client.exceptions.ServiceQuotaExceededException

  • SSOAdmin.Client.exceptions.ThrottlingException

  • SSOAdmin.Client.exceptions.ValidationException

  • SSOAdmin.Client.exceptions.AccessDeniedException

  • SSOAdmin.Client.exceptions.ConflictException