AWS Organizations

2025/11/20 - AWS Organizations - 6 new 21 updated api methods

Changes  Added new APIs for Billing Transfer, new policy type INSPECTOR_POLICY, and allow an account to transfer between organizations

UpdateResponsibilityTransfer (new) Link ¶

Updates a transfer. A transfer is the arrangement between two management accounts where one account designates the other with specified responsibilities for their organization.

You can update the name assigned to a transfer.

See also: AWS API Documentation

Request Syntax

client.update_responsibility_transfer(
    Id='string',
    Name='string'
)
type Id:

string

param Id:

[REQUIRED]

ID for the transfer.

type Name:

string

param Name:

[REQUIRED]

New name you want to assign to the transfer.

rtype:

dict

returns:

Response Syntax

{
    'ResponsibilityTransfer': {
        'Arn': 'string',
        'Name': 'string',
        'Id': 'string',
        'Type': 'BILLING',
        'Status': 'REQUESTED'|'DECLINED'|'CANCELED'|'EXPIRED'|'ACCEPTED'|'WITHDRAWN',
        'Source': {
            'ManagementAccountId': 'string',
            'ManagementAccountEmail': 'string'
        },
        'Target': {
            'ManagementAccountId': 'string',
            'ManagementAccountEmail': 'string'
        },
        'StartTimestamp': datetime(2015, 1, 1),
        'EndTimestamp': datetime(2015, 1, 1),
        'ActiveHandshakeId': 'string'
    }
}

Response Structure

  • (dict) --

    • ResponsibilityTransfer (dict) --

      Contains details for a transfer. A transfer is the arrangement between two management accounts where one account designates the other with specified responsibilities for their organization.

      • Arn (string) --

        Amazon Resource Name (ARN) for the transfer.

      • Name (string) --

        Name assigned to the transfer.

      • Id (string) --

        ID for the transfer.

      • Type (string) --

        The type of transfer. Currently, only BILLING is supported.

      • Status (string) --

        Status for the transfer.

      • Source (dict) --

        Account that allows another account external to its organization to manage the specified responsibilities for the organization.

        • ManagementAccountId (string) --

          ID for the management account.

        • ManagementAccountEmail (string) --

          Email address for the management account.

      • Target (dict) --

        Account that manages the specified responsibilities for another organization.

        • ManagementAccountId (string) --

          ID for the management account.

        • ManagementAccountEmail (string) --

          Email address for the management account.

      • StartTimestamp (datetime) --

        Timestamp when the transfer starts.

      • EndTimestamp (datetime) --

        Timestamp when the transfer ends.

      • ActiveHandshakeId (string) --

        ID for the handshake of the transfer.

ListInboundResponsibilityTransfers (new) Link ¶

Lists transfers that allow you to manage the specified responsibilities for another organization. This operation returns both transfer invitations and transfers.

See also: AWS API Documentation

Request Syntax

client.list_inbound_responsibility_transfers(
    Type='BILLING',
    Id='string',
    NextToken='string',
    MaxResults=123
)
type Type:

string

param Type:

[REQUIRED]

The type of responsibility. Currently, only BILLING is supported.

type Id:

string

param Id:

ID for the transfer.

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'ResponsibilityTransfers': [
        {
            'Arn': 'string',
            'Name': 'string',
            'Id': 'string',
            'Type': 'BILLING',
            'Status': 'REQUESTED'|'DECLINED'|'CANCELED'|'EXPIRED'|'ACCEPTED'|'WITHDRAWN',
            'Source': {
                'ManagementAccountId': 'string',
                'ManagementAccountEmail': 'string'
            },
            'Target': {
                'ManagementAccountId': 'string',
                'ManagementAccountEmail': 'string'
            },
            'StartTimestamp': datetime(2015, 1, 1),
            'EndTimestamp': datetime(2015, 1, 1),
            'ActiveHandshakeId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ResponsibilityTransfers (list) --

      A ResponsibilityTransfers object. Contains details for a transfer.

      • (dict) --

        Contains details for a transfer. A transfer is the arrangement between two management accounts where one account designates the other with specified responsibilities for their organization.

        • Arn (string) --

          Amazon Resource Name (ARN) for the transfer.

        • Name (string) --

          Name assigned to the transfer.

        • Id (string) --

          ID for the transfer.

        • Type (string) --

          The type of transfer. Currently, only BILLING is supported.

        • Status (string) --

          Status for the transfer.

        • Source (dict) --

          Account that allows another account external to its organization to manage the specified responsibilities for the organization.

          • ManagementAccountId (string) --

            ID for the management account.

          • ManagementAccountEmail (string) --

            Email address for the management account.

        • Target (dict) --

          Account that manages the specified responsibilities for another organization.

          • ManagementAccountId (string) --

            ID for the management account.

          • ManagementAccountEmail (string) --

            Email address for the management account.

        • StartTimestamp (datetime) --

          Timestamp when the transfer starts.

        • EndTimestamp (datetime) --

          Timestamp when the transfer ends.

        • ActiveHandshakeId (string) --

          ID for the handshake of the transfer.

    • NextToken (string) --

      If present, 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.

ListOutboundResponsibilityTransfers (new) Link ¶

Lists transfers that allow an account outside your organization to manage the specified responsibilities for your organization. This operation returns both transfer invitations and transfers.

See also: AWS API Documentation

Request Syntax

client.list_outbound_responsibility_transfers(
    Type='BILLING',
    NextToken='string',
    MaxResults=123
)
type Type:

string

param Type:

[REQUIRED]

The type of responsibility. Currently, only BILLING is supported.

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'ResponsibilityTransfers': [
        {
            'Arn': 'string',
            'Name': 'string',
            'Id': 'string',
            'Type': 'BILLING',
            'Status': 'REQUESTED'|'DECLINED'|'CANCELED'|'EXPIRED'|'ACCEPTED'|'WITHDRAWN',
            'Source': {
                'ManagementAccountId': 'string',
                'ManagementAccountEmail': 'string'
            },
            'Target': {
                'ManagementAccountId': 'string',
                'ManagementAccountEmail': 'string'
            },
            'StartTimestamp': datetime(2015, 1, 1),
            'EndTimestamp': datetime(2015, 1, 1),
            'ActiveHandshakeId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ResponsibilityTransfers (list) --

      An array of ResponsibilityTransfer objects. Contains details for a transfer.

      • (dict) --

        Contains details for a transfer. A transfer is the arrangement between two management accounts where one account designates the other with specified responsibilities for their organization.

        • Arn (string) --

          Amazon Resource Name (ARN) for the transfer.

        • Name (string) --

          Name assigned to the transfer.

        • Id (string) --

          ID for the transfer.

        • Type (string) --

          The type of transfer. Currently, only BILLING is supported.

        • Status (string) --

          Status for the transfer.

        • Source (dict) --

          Account that allows another account external to its organization to manage the specified responsibilities for the organization.

          • ManagementAccountId (string) --

            ID for the management account.

          • ManagementAccountEmail (string) --

            Email address for the management account.

        • Target (dict) --

          Account that manages the specified responsibilities for another organization.

          • ManagementAccountId (string) --

            ID for the management account.

          • ManagementAccountEmail (string) --

            Email address for the management account.

        • StartTimestamp (datetime) --

          Timestamp when the transfer starts.

        • EndTimestamp (datetime) --

          Timestamp when the transfer ends.

        • ActiveHandshakeId (string) --

          ID for the handshake of the transfer.

    • NextToken (string) --

      If present, 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.

DescribeResponsibilityTransfer (new) Link ¶

Returns details for a transfer. A transfer is an arrangement between two management accounts where one account designates the other with specified responsibilities for their organization.

See also: AWS API Documentation

Request Syntax

client.describe_responsibility_transfer(
    Id='string'
)
type Id:

string

param Id:

[REQUIRED]

ID for the transfer.

rtype:

dict

returns:

Response Syntax

{
    'ResponsibilityTransfer': {
        'Arn': 'string',
        'Name': 'string',
        'Id': 'string',
        'Type': 'BILLING',
        'Status': 'REQUESTED'|'DECLINED'|'CANCELED'|'EXPIRED'|'ACCEPTED'|'WITHDRAWN',
        'Source': {
            'ManagementAccountId': 'string',
            'ManagementAccountEmail': 'string'
        },
        'Target': {
            'ManagementAccountId': 'string',
            'ManagementAccountEmail': 'string'
        },
        'StartTimestamp': datetime(2015, 1, 1),
        'EndTimestamp': datetime(2015, 1, 1),
        'ActiveHandshakeId': 'string'
    }
}

Response Structure

  • (dict) --

    • ResponsibilityTransfer (dict) --

      A ResponsibilityTransfer object. Contains details for a transfer.

      • Arn (string) --

        Amazon Resource Name (ARN) for the transfer.

      • Name (string) --

        Name assigned to the transfer.

      • Id (string) --

        ID for the transfer.

      • Type (string) --

        The type of transfer. Currently, only BILLING is supported.

      • Status (string) --

        Status for the transfer.

      • Source (dict) --

        Account that allows another account external to its organization to manage the specified responsibilities for the organization.

        • ManagementAccountId (string) --

          ID for the management account.

        • ManagementAccountEmail (string) --

          Email address for the management account.

      • Target (dict) --

        Account that manages the specified responsibilities for another organization.

        • ManagementAccountId (string) --

          ID for the management account.

        • ManagementAccountEmail (string) --

          Email address for the management account.

      • StartTimestamp (datetime) --

        Timestamp when the transfer starts.

      • EndTimestamp (datetime) --

        Timestamp when the transfer ends.

      • ActiveHandshakeId (string) --

        ID for the handshake of the transfer.

TerminateResponsibilityTransfer (new) Link ¶

Ends a transfer. A transfer is an arrangement between two management accounts where one account designates the other with specified responsibilities for their organization.

See also: AWS API Documentation

Request Syntax

client.terminate_responsibility_transfer(
    Id='string',
    EndTimestamp=datetime(2015, 1, 1)
)
type Id:

string

param Id:

[REQUIRED]

ID for the transfer.

type EndTimestamp:

datetime

param EndTimestamp:

Timestamp when the responsibility transfer is to end.

rtype:

dict

returns:

Response Syntax

{
    'ResponsibilityTransfer': {
        'Arn': 'string',
        'Name': 'string',
        'Id': 'string',
        'Type': 'BILLING',
        'Status': 'REQUESTED'|'DECLINED'|'CANCELED'|'EXPIRED'|'ACCEPTED'|'WITHDRAWN',
        'Source': {
            'ManagementAccountId': 'string',
            'ManagementAccountEmail': 'string'
        },
        'Target': {
            'ManagementAccountId': 'string',
            'ManagementAccountEmail': 'string'
        },
        'StartTimestamp': datetime(2015, 1, 1),
        'EndTimestamp': datetime(2015, 1, 1),
        'ActiveHandshakeId': 'string'
    }
}

Response Structure

  • (dict) --

    • ResponsibilityTransfer (dict) --

      A ResponsibilityTransfer object. Contains details for a transfer.

      • Arn (string) --

        Amazon Resource Name (ARN) for the transfer.

      • Name (string) --

        Name assigned to the transfer.

      • Id (string) --

        ID for the transfer.

      • Type (string) --

        The type of transfer. Currently, only BILLING is supported.

      • Status (string) --

        Status for the transfer.

      • Source (dict) --

        Account that allows another account external to its organization to manage the specified responsibilities for the organization.

        • ManagementAccountId (string) --

          ID for the management account.

        • ManagementAccountEmail (string) --

          Email address for the management account.

      • Target (dict) --

        Account that manages the specified responsibilities for another organization.

        • ManagementAccountId (string) --

          ID for the management account.

        • ManagementAccountEmail (string) --

          Email address for the management account.

      • StartTimestamp (datetime) --

        Timestamp when the transfer starts.

      • EndTimestamp (datetime) --

        Timestamp when the transfer ends.

      • ActiveHandshakeId (string) --

        ID for the handshake of the transfer.

InviteOrganizationToTransferResponsibility (new) Link ¶

Sends an invitation to another organization's management account to designate your account with the specified responsibilities for their organization. The invitation is implemented as a Handshake whose details are in the response.

You can only call this operation from the management account.

See also: AWS API Documentation

Request Syntax

client.invite_organization_to_transfer_responsibility(
    Type='BILLING',
    Target={
        'Id': 'string',
        'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
    },
    Notes='string',
    StartTimestamp=datetime(2015, 1, 1),
    SourceName='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Type:

string

param Type:

[REQUIRED]

The type of responsibility you want to designate to your organization. Currently, only BILLING is supported.

type Target:

dict

param Target:

[REQUIRED]

A HandshakeParty object. Contains details for the account you want to invite. Currently, only ACCOUNT and EMAIL are supported.

  • Id (string) -- [REQUIRED]

    ID for the participant: Acccount ID, organization ID, or email address.

    The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

  • Type (string) -- [REQUIRED]

    The type of ID for the participant.

type Notes:

string

param Notes:

Additional information that you want to include in the invitation.

type StartTimestamp:

datetime

param StartTimestamp:

[REQUIRED]

Timestamp when the recipient will begin managing the specified responsibilities.

type SourceName:

string

param SourceName:

[REQUIRED]

Name you want to assign to the transfer.

type Tags:

list

param Tags:

A list of tags that you want to attach to the transfer. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging Organizations resources in the Organizations User Guide.

  • (dict) --

    A custom key-value pair associated with a resource within your organization.

    You can attach tags to any of the following organization resources.

    • Amazon Web Services account

    • Organizational unit (OU)

    • Organization root

    • Policy

    • Key (string) -- [REQUIRED]

      The key identifier, or name, of the tag.

    • Value (string) -- [REQUIRED]

      The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

rtype:

dict

returns:

Response Syntax

{
    'Handshake': {
        'Id': 'string',
        'Arn': 'string',
        'Parties': [
            {
                'Id': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
            },
        ],
        'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'ExpirationTimestamp': datetime(2015, 1, 1),
        'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'Resources': [
            {
                'Value': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                'Resources': {'... recursive ...'}
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Handshake (dict) --

      Contains details for a handshake. A handshake is the secure exchange of information between two Amazon Web Services accounts: a sender and a recipient.

      Note: Handshakes that are CANCELED, ACCEPTED, DECLINED, or EXPIRED show up in lists for only 30 days after entering that state After that they are deleted.

      • Id (string) --

        ID for the handshake.

        The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

      • Arn (string) --

        Amazon Resource Name (ARN) for the handshake.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Parties (list) --

        An array of HandshakeParty objects. Contains details for participant in a handshake.

        • (dict) --

          Contains details for a participant in a handshake.

          • Id (string) --

            ID for the participant: Acccount ID, organization ID, or email address.

            The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

          • Type (string) --

            The type of ID for the participant.

      • State (string) --

        Current state for the handshake.

        • REQUESTED: Handshake awaiting a response from the recipient.

        • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

        • CANCELED: Handshake canceled by the sender.

        • ACCEPTED: Handshake accepted by the recipient.

        • DECLINED: Handshake declined by the recipient.

        • EXPIRED: Handshake has expired.

      • RequestedTimestamp (datetime) --

        Timestamp when the handshake request was made.

      • ExpirationTimestamp (datetime) --

        Timestamp when the handshake expires.

      • Action (string) --

        The type of handshake:

        • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

        • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

        • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

        • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

      • Resources (list) --

        An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

        • (dict) --

          Contains additional details for a handshake.

          • Value (string) --

            Additional information for the handshake. The format of the value string must match the requirements of the specified type.

          • Type (string) --

            The type of information being passed, specifying how the value is to be interpreted by the other party:

            • ACCOUNT: ID for an Amazon Web Services account.

            • ORGANIZATION: ID for an organization.

            • EMAIL: Email address for the recipient.

            • OWNER_EMAIL: Email address for the sender.

            • OWNER_NAME: Name of the sender.

            • NOTES: Additional text included by the sender for the recipient.

          • Resources (list) --

            An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

AcceptHandshake (updated) Link ¶
Changes (response)
{'Handshake': {'Action': {'TRANSFER_RESPONSIBILITY'},
               'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                      'MANAGEMENT_EMAIL',
                                      'MANAGEMENT_NAME',
                                      'RESPONSIBILITY_TRANSFER',
                                      'TRANSFER_START_TIMESTAMP',
                                      'TRANSFER_TYPE'}}}}

Accepts a handshake by sending an ACCEPTED response to the sender. You can view accepted handshakes in API responses for 30 days before they are deleted.

Only the management account can accept the following handshakes:

  • Enable all features final confirmation ( APPROVE_ALL_FEATURES)

  • Billing transfer ( TRANSFER_RESPONSIBILITY)

For more information, see Enabling all features and Responding to a billing transfer invitation in the Organizations User Guide.

Only a member account can accept the following handshakes:

  • Invitation to join ( INVITE)

  • Approve all features request ( ENABLE_ALL_FEATURES)

For more information, see Responding to invitations and Enabling all features in the Organizations User Guide.

See also: AWS API Documentation

Request Syntax

client.accept_handshake(
    HandshakeId='string'
)
type HandshakeId:

string

param HandshakeId:

[REQUIRED]

ID for the handshake that you want to accept.

The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

rtype:

dict

returns:

Response Syntax

{
    'Handshake': {
        'Id': 'string',
        'Arn': 'string',
        'Parties': [
            {
                'Id': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
            },
        ],
        'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'ExpirationTimestamp': datetime(2015, 1, 1),
        'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'Resources': [
            {
                'Value': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                'Resources': {'... recursive ...'}
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Handshake (dict) --

      A Handshake object. Contains details for the handshake.

      • Id (string) --

        ID for the handshake.

        The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

      • Arn (string) --

        Amazon Resource Name (ARN) for the handshake.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Parties (list) --

        An array of HandshakeParty objects. Contains details for participant in a handshake.

        • (dict) --

          Contains details for a participant in a handshake.

          • Id (string) --

            ID for the participant: Acccount ID, organization ID, or email address.

            The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

          • Type (string) --

            The type of ID for the participant.

      • State (string) --

        Current state for the handshake.

        • REQUESTED: Handshake awaiting a response from the recipient.

        • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

        • CANCELED: Handshake canceled by the sender.

        • ACCEPTED: Handshake accepted by the recipient.

        • DECLINED: Handshake declined by the recipient.

        • EXPIRED: Handshake has expired.

      • RequestedTimestamp (datetime) --

        Timestamp when the handshake request was made.

      • ExpirationTimestamp (datetime) --

        Timestamp when the handshake expires.

      • Action (string) --

        The type of handshake:

        • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

        • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

        • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

        • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

      • Resources (list) --

        An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

        • (dict) --

          Contains additional details for a handshake.

          • Value (string) --

            Additional information for the handshake. The format of the value string must match the requirements of the specified type.

          • Type (string) --

            The type of information being passed, specifying how the value is to be interpreted by the other party:

            • ACCOUNT: ID for an Amazon Web Services account.

            • ORGANIZATION: ID for an organization.

            • EMAIL: Email address for the recipient.

            • OWNER_EMAIL: Email address for the sender.

            • OWNER_NAME: Name of the sender.

            • NOTES: Additional text included by the sender for the recipient.

          • Resources (list) --

            An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

CancelHandshake (updated) Link ¶
Changes (response)
{'Handshake': {'Action': {'TRANSFER_RESPONSIBILITY'},
               'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                      'MANAGEMENT_EMAIL',
                                      'MANAGEMENT_NAME',
                                      'RESPONSIBILITY_TRANSFER',
                                      'TRANSFER_START_TIMESTAMP',
                                      'TRANSFER_TYPE'}}}}

Cancels a Handshake.

Only the account that sent a handshake can call this operation. The recipient of the handshake can't cancel it, but can use DeclineHandshake to decline. After a handshake is canceled, the recipient can no longer respond to the handshake.

You can view canceled handshakes in API responses for 30 days before they are deleted.

See also: AWS API Documentation

Request Syntax

client.cancel_handshake(
    HandshakeId='string'
)
type HandshakeId:

string

param HandshakeId:

[REQUIRED]

ID for the handshake that you want to cancel. You can get the ID from the ListHandshakesForOrganization operation.

The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

rtype:

dict

returns:

Response Syntax

{
    'Handshake': {
        'Id': 'string',
        'Arn': 'string',
        'Parties': [
            {
                'Id': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
            },
        ],
        'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'ExpirationTimestamp': datetime(2015, 1, 1),
        'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'Resources': [
            {
                'Value': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                'Resources': {'... recursive ...'}
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Handshake (dict) --

      A Handshake object. Contains for the handshake that you canceled.

      • Id (string) --

        ID for the handshake.

        The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

      • Arn (string) --

        Amazon Resource Name (ARN) for the handshake.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Parties (list) --

        An array of HandshakeParty objects. Contains details for participant in a handshake.

        • (dict) --

          Contains details for a participant in a handshake.

          • Id (string) --

            ID for the participant: Acccount ID, organization ID, or email address.

            The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

          • Type (string) --

            The type of ID for the participant.

      • State (string) --

        Current state for the handshake.

        • REQUESTED: Handshake awaiting a response from the recipient.

        • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

        • CANCELED: Handshake canceled by the sender.

        • ACCEPTED: Handshake accepted by the recipient.

        • DECLINED: Handshake declined by the recipient.

        • EXPIRED: Handshake has expired.

      • RequestedTimestamp (datetime) --

        Timestamp when the handshake request was made.

      • ExpirationTimestamp (datetime) --

        Timestamp when the handshake expires.

      • Action (string) --

        The type of handshake:

        • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

        • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

        • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

        • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

      • Resources (list) --

        An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

        • (dict) --

          Contains additional details for a handshake.

          • Value (string) --

            Additional information for the handshake. The format of the value string must match the requirements of the specified type.

          • Type (string) --

            The type of information being passed, specifying how the value is to be interpreted by the other party:

            • ACCOUNT: ID for an Amazon Web Services account.

            • ORGANIZATION: ID for an organization.

            • EMAIL: Email address for the recipient.

            • OWNER_EMAIL: Email address for the sender.

            • OWNER_NAME: Name of the sender.

            • NOTES: Additional text included by the sender for the recipient.

          • Resources (list) --

            An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

CreateOrganization (updated) Link ¶
Changes (response)
{'Organization': {'AvailablePolicyTypes': {'Type': {'INSPECTOR_POLICY'}}}}

Creates an Amazon Web Services organization. The account whose user is calling the CreateOrganization operation automatically becomes the management account of the new organization.

This operation must be called using credentials from the account that is to become the new organization's management account. The principal must also have the relevant IAM permissions.

By default (or if you set the FeatureSet parameter to ALL), the new organization is created with all features enabled and service control policies automatically enabled in the root. If you instead choose to create the organization supporting only the consolidated billing features by setting the FeatureSet parameter to CONSOLIDATED_BILLING, no policy types are enabled by default and you can't use organization policies.

See also: AWS API Documentation

Request Syntax

client.create_organization(
    FeatureSet='ALL'|'CONSOLIDATED_BILLING'
)
type FeatureSet:

string

param FeatureSet:

Specifies the feature set supported by the new organization. Each feature set supports different levels of functionality.

  • CONSOLIDATED_BILLING: All member accounts have their bills consolidated to and paid by the management account. For more information, see Consolidated billing in the Organizations User Guide. The consolidated billing feature subset isn't available for organizations in the Amazon Web Services GovCloud (US) Region.

  • ALL: In addition to all the features supported by the consolidated billing feature set, the management account can also apply any policy type to any member account in the organization. For more information, see All features in the Organizations User Guide.

rtype:

dict

returns:

Response Syntax

{
    'Organization': {
        'Id': 'string',
        'Arn': 'string',
        'FeatureSet': 'ALL'|'CONSOLIDATED_BILLING',
        'MasterAccountArn': 'string',
        'MasterAccountId': 'string',
        'MasterAccountEmail': 'string',
        'AvailablePolicyTypes': [
            {
                'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
                'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Organization (dict) --

      A structure that contains details about the newly created organization.

      • Id (string) --

        The unique identifier (ID) of an organization.

        The regex pattern for an organization ID string requires "o-" followed by from 10 to 32 lowercase letters or digits.

      • Arn (string) --

        The Amazon Resource Name (ARN) of an organization.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • FeatureSet (string) --

        Specifies the functionality that currently is available to the organization. If set to "ALL", then all features are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.

      • MasterAccountArn (string) --

        The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • MasterAccountId (string) --

        The unique identifier (ID) of the management account of an organization.

        The regex pattern for an account ID string requires exactly 12 digits.

      • MasterAccountEmail (string) --

        The email address that is associated with the Amazon Web Services account that is designated as the management account for the organization.

      • AvailablePolicyTypes (list) --

        To determine the policies that are enabled and available for use in your organization, use the ListRoots operation instead.

        • (dict) --

          Contains information about a policy type and its status in the associated root.

          • Type (string) --

            The name of the policy type.

          • Status (string) --

            The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.

CreatePolicy (updated) Link ¶
Changes (request, response)
Request
{'Type': {'INSPECTOR_POLICY'}}
Response
{'Policy': {'PolicySummary': {'Type': {'INSPECTOR_POLICY'}}}}

Creates a policy of a specified type that you can attach to a root, an organizational unit (OU), or an individual Amazon Web Services account.

For more information about policies and their use, see Managing Organizations policies.

If the request includes tags, then the requester must have the organizations:TagResource permission.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.create_policy(
    Content='string',
    Description='string',
    Name='string',
    Type='SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Content:

string

param Content:

[REQUIRED]

The policy text content to add to the new policy. The text that you supply must adhere to the rules of the policy type you specify in the Type parameter.

The maximum size of a policy document depends on the policy's type. For more information, see Maximum and minimum values in the Organizations User Guide.

type Description:

string

param Description:

[REQUIRED]

An optional description to assign to the policy.

type Name:

string

param Name:

[REQUIRED]

The friendly name to assign to the policy.

The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

type Type:

string

param Type:

[REQUIRED]

The type of policy to create. You can specify one of the following values:

type Tags:

list

param Tags:

A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging Organizations resources in the Organizations User Guide.

  • (dict) --

    A custom key-value pair associated with a resource within your organization.

    You can attach tags to any of the following organization resources.

    • Amazon Web Services account

    • Organizational unit (OU)

    • Organization root

    • Policy

    • Key (string) -- [REQUIRED]

      The key identifier, or name, of the tag.

    • Value (string) -- [REQUIRED]

      The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

rtype:

dict

returns:

Response Syntax

{
    'Policy': {
        'PolicySummary': {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
            'AwsManaged': True|False
        },
        'Content': 'string'
    }
}

Response Structure

  • (dict) --

    • Policy (dict) --

      A structure that contains details about the newly created policy.

      • PolicySummary (dict) --

        A structure that contains additional details about the policy.

        • Id (string) --

          The unique identifier (ID) of the policy.

          The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

        • Arn (string) --

          The Amazon Resource Name (ARN) of the policy.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Name (string) --

          The friendly name of the policy.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Description (string) --

          The description of the policy.

        • Type (string) --

          The type of policy.

        • AwsManaged (boolean) --

          A boolean value that indicates whether the specified policy is an Amazon Web Services managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.

      • Content (string) --

        The text content of the policy.

DeclineHandshake (updated) Link ¶
Changes (response)
{'Handshake': {'Action': {'TRANSFER_RESPONSIBILITY'},
               'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                      'MANAGEMENT_EMAIL',
                                      'MANAGEMENT_NAME',
                                      'RESPONSIBILITY_TRANSFER',
                                      'TRANSFER_START_TIMESTAMP',
                                      'TRANSFER_TYPE'}}}}

Declines a Handshake.

Only the account that receives a handshake can call this operation. The sender of the handshake can use CancelHandshake to cancel if the handshake hasn't yet been responded to.

You can view canceled handshakes in API responses for 30 days before they are deleted.

See also: AWS API Documentation

Request Syntax

client.decline_handshake(
    HandshakeId='string'
)
type HandshakeId:

string

param HandshakeId:

[REQUIRED]

ID for the handshake that you want to decline. You can get the ID from the ListHandshakesForAccount operation.

The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

rtype:

dict

returns:

Response Syntax

{
    'Handshake': {
        'Id': 'string',
        'Arn': 'string',
        'Parties': [
            {
                'Id': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
            },
        ],
        'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'ExpirationTimestamp': datetime(2015, 1, 1),
        'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'Resources': [
            {
                'Value': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                'Resources': {'... recursive ...'}
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Handshake (dict) --

      A Handshake object. Contains details for the declined handshake.

      • Id (string) --

        ID for the handshake.

        The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

      • Arn (string) --

        Amazon Resource Name (ARN) for the handshake.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Parties (list) --

        An array of HandshakeParty objects. Contains details for participant in a handshake.

        • (dict) --

          Contains details for a participant in a handshake.

          • Id (string) --

            ID for the participant: Acccount ID, organization ID, or email address.

            The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

          • Type (string) --

            The type of ID for the participant.

      • State (string) --

        Current state for the handshake.

        • REQUESTED: Handshake awaiting a response from the recipient.

        • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

        • CANCELED: Handshake canceled by the sender.

        • ACCEPTED: Handshake accepted by the recipient.

        • DECLINED: Handshake declined by the recipient.

        • EXPIRED: Handshake has expired.

      • RequestedTimestamp (datetime) --

        Timestamp when the handshake request was made.

      • ExpirationTimestamp (datetime) --

        Timestamp when the handshake expires.

      • Action (string) --

        The type of handshake:

        • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

        • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

        • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

        • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

      • Resources (list) --

        An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

        • (dict) --

          Contains additional details for a handshake.

          • Value (string) --

            Additional information for the handshake. The format of the value string must match the requirements of the specified type.

          • Type (string) --

            The type of information being passed, specifying how the value is to be interpreted by the other party:

            • ACCOUNT: ID for an Amazon Web Services account.

            • ORGANIZATION: ID for an organization.

            • EMAIL: Email address for the recipient.

            • OWNER_EMAIL: Email address for the sender.

            • OWNER_NAME: Name of the sender.

            • NOTES: Additional text included by the sender for the recipient.

          • Resources (list) --

            An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

DescribeEffectivePolicy (updated) Link ¶
Changes (request, response)
Request
{'PolicyType': {'INSPECTOR_POLICY'}}
Response
{'EffectivePolicy': {'PolicyType': {'INSPECTOR_POLICY'}}}

Returns the contents of the effective policy for specified policy type and account. The effective policy is the aggregation of any policies of the specified type that the account inherits, plus any policy of that type that is directly attached to the account.

This operation applies only to management policies. It does not apply to authorization policies: service control policies (SCPs) and resource control policies (RCPs).

For more information about policy inheritance, see Understanding management policy inheritance in the Organizations User Guide.

You can call this operation from any account in a organization.

See also: AWS API Documentation

Request Syntax

client.describe_effective_policy(
    PolicyType='TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    TargetId='string'
)
type PolicyType:

string

param PolicyType:

[REQUIRED]

The type of policy that you want information about. You can specify one of the following values:

type TargetId:

string

param TargetId:

When you're signed in as the management account, specify the ID of the account that you want details about. Specifying an organization root or organizational unit (OU) as the target is not supported.

rtype:

dict

returns:

Response Syntax

{
    'EffectivePolicy': {
        'PolicyContent': 'string',
        'LastUpdatedTimestamp': datetime(2015, 1, 1),
        'TargetId': 'string',
        'PolicyType': 'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY'
    }
}

Response Structure

  • (dict) --

    • EffectivePolicy (dict) --

      The contents of the effective policy.

      • PolicyContent (string) --

        The text content of the policy.

      • LastUpdatedTimestamp (datetime) --

        The time of the last update to this policy.

      • TargetId (string) --

        The account ID of the policy target.

      • PolicyType (string) --

        The policy type.

DescribeHandshake (updated) Link ¶
Changes (response)
{'Handshake': {'Action': {'TRANSFER_RESPONSIBILITY'},
               'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                      'MANAGEMENT_EMAIL',
                                      'MANAGEMENT_NAME',
                                      'RESPONSIBILITY_TRANSFER',
                                      'TRANSFER_START_TIMESTAMP',
                                      'TRANSFER_TYPE'}}}}

Returns details for a handshake. A handshake is the secure exchange of information between two Amazon Web Services accounts: a sender and a recipient.

You can view ACCEPTED, DECLINED, or CANCELED handshakes in API Responses for 30 days before they are deleted.

You can call this operation from any account in a organization.

See also: AWS API Documentation

Request Syntax

client.describe_handshake(
    HandshakeId='string'
)
type HandshakeId:

string

param HandshakeId:

[REQUIRED]

ID for the handshake that you want information about.

The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

rtype:

dict

returns:

Response Syntax

{
    'Handshake': {
        'Id': 'string',
        'Arn': 'string',
        'Parties': [
            {
                'Id': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
            },
        ],
        'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'ExpirationTimestamp': datetime(2015, 1, 1),
        'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'Resources': [
            {
                'Value': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                'Resources': {'... recursive ...'}
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Handshake (dict) --

      A Handshake object. Contains details for the handshake.

      • Id (string) --

        ID for the handshake.

        The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

      • Arn (string) --

        Amazon Resource Name (ARN) for the handshake.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Parties (list) --

        An array of HandshakeParty objects. Contains details for participant in a handshake.

        • (dict) --

          Contains details for a participant in a handshake.

          • Id (string) --

            ID for the participant: Acccount ID, organization ID, or email address.

            The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

          • Type (string) --

            The type of ID for the participant.

      • State (string) --

        Current state for the handshake.

        • REQUESTED: Handshake awaiting a response from the recipient.

        • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

        • CANCELED: Handshake canceled by the sender.

        • ACCEPTED: Handshake accepted by the recipient.

        • DECLINED: Handshake declined by the recipient.

        • EXPIRED: Handshake has expired.

      • RequestedTimestamp (datetime) --

        Timestamp when the handshake request was made.

      • ExpirationTimestamp (datetime) --

        Timestamp when the handshake expires.

      • Action (string) --

        The type of handshake:

        • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

        • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

        • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

        • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

      • Resources (list) --

        An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

        • (dict) --

          Contains additional details for a handshake.

          • Value (string) --

            Additional information for the handshake. The format of the value string must match the requirements of the specified type.

          • Type (string) --

            The type of information being passed, specifying how the value is to be interpreted by the other party:

            • ACCOUNT: ID for an Amazon Web Services account.

            • ORGANIZATION: ID for an organization.

            • EMAIL: Email address for the recipient.

            • OWNER_EMAIL: Email address for the sender.

            • OWNER_NAME: Name of the sender.

            • NOTES: Additional text included by the sender for the recipient.

          • Resources (list) --

            An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

DescribeOrganization (updated) Link ¶
Changes (response)
{'Organization': {'AvailablePolicyTypes': {'Type': {'INSPECTOR_POLICY'}}}}

Retrieves information about the organization that the user's account belongs to.

You can call this operation from any account in a organization.

See also: AWS API Documentation

Request Syntax

client.describe_organization()
rtype:

dict

returns:

Response Syntax

{
    'Organization': {
        'Id': 'string',
        'Arn': 'string',
        'FeatureSet': 'ALL'|'CONSOLIDATED_BILLING',
        'MasterAccountArn': 'string',
        'MasterAccountId': 'string',
        'MasterAccountEmail': 'string',
        'AvailablePolicyTypes': [
            {
                'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
                'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Organization (dict) --

      A structure that contains information about the organization.

      • Id (string) --

        The unique identifier (ID) of an organization.

        The regex pattern for an organization ID string requires "o-" followed by from 10 to 32 lowercase letters or digits.

      • Arn (string) --

        The Amazon Resource Name (ARN) of an organization.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • FeatureSet (string) --

        Specifies the functionality that currently is available to the organization. If set to "ALL", then all features are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.

      • MasterAccountArn (string) --

        The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • MasterAccountId (string) --

        The unique identifier (ID) of the management account of an organization.

        The regex pattern for an account ID string requires exactly 12 digits.

      • MasterAccountEmail (string) --

        The email address that is associated with the Amazon Web Services account that is designated as the management account for the organization.

      • AvailablePolicyTypes (list) --

        To determine the policies that are enabled and available for use in your organization, use the ListRoots operation instead.

        • (dict) --

          Contains information about a policy type and its status in the associated root.

          • Type (string) --

            The name of the policy type.

          • Status (string) --

            The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.

DescribePolicy (updated) Link ¶
Changes (response)
{'Policy': {'PolicySummary': {'Type': {'INSPECTOR_POLICY'}}}}

Retrieves information about a policy.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.describe_policy(
    PolicyId='string'
)
type PolicyId:

string

param PolicyId:

[REQUIRED]

ID for the policy that you want details about. You can get the ID from the ListPolicies or ListPoliciesForTarget operations.

The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

rtype:

dict

returns:

Response Syntax

{
    'Policy': {
        'PolicySummary': {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
            'AwsManaged': True|False
        },
        'Content': 'string'
    }
}

Response Structure

  • (dict) --

    • Policy (dict) --

      A structure that contains details about the specified policy.

      • PolicySummary (dict) --

        A structure that contains additional details about the policy.

        • Id (string) --

          The unique identifier (ID) of the policy.

          The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

        • Arn (string) --

          The Amazon Resource Name (ARN) of the policy.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Name (string) --

          The friendly name of the policy.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Description (string) --

          The description of the policy.

        • Type (string) --

          The type of policy.

        • AwsManaged (boolean) --

          A boolean value that indicates whether the specified policy is an Amazon Web Services managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.

      • Content (string) --

        The text content of the policy.

DisablePolicyType (updated) Link ¶
Changes (request, response)
Request
{'PolicyType': {'INSPECTOR_POLICY'}}
Response
{'Root': {'PolicyTypes': {'Type': {'INSPECTOR_POLICY'}}}}

Disables an organizational policy type in a root. A policy of a certain type can be attached to entities in a root only if that type is enabled in the root. After you perform this operation, you no longer can attach policies of the specified type to that root or to any organizational unit (OU) or account in that root. You can undo this by using the EnablePolicyType operation.

This is an asynchronous request that Amazon Web Services performs in the background. If you disable a policy type for a root, it still appears enabled for the organization if all features are enabled for the organization. Amazon Web Services recommends that you first use ListRoots to see the status of policy types for a specified root, and then use this operation.

You can only call this operation from the management account or a member account that is a delegated administrator.

To view the status of available policy types in the organization, use ListRoots.

See also: AWS API Documentation

Request Syntax

client.disable_policy_type(
    RootId='string',
    PolicyType='SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY'
)
type RootId:

string

param RootId:

[REQUIRED]

ID for the root in which you want to disable a policy type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or digits.

type PolicyType:

string

param PolicyType:

[REQUIRED]

The policy type that you want to disable in this root. You can specify one of the following values:

rtype:

dict

returns:

Response Syntax

{
    'Root': {
        'Id': 'string',
        'Arn': 'string',
        'Name': 'string',
        'PolicyTypes': [
            {
                'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
                'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Root (dict) --

      A structure that shows the root with the updated list of enabled policy types.

      • Id (string) --

        The unique identifier (ID) for the root. The ID is unique to the organization only.

        The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or digits.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the root.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Name (string) --

        The friendly name of the root.

        The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

      • PolicyTypes (list) --

        The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts.

        • (dict) --

          Contains information about a policy type and its status in the associated root.

          • Type (string) --

            The name of the policy type.

          • Status (string) --

            The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.

EnableAllFeatures (updated) Link ¶
Changes (response)
{'Handshake': {'Action': {'TRANSFER_RESPONSIBILITY'},
               'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                      'MANAGEMENT_EMAIL',
                                      'MANAGEMENT_NAME',
                                      'RESPONSIBILITY_TRANSFER',
                                      'TRANSFER_START_TIMESTAMP',
                                      'TRANSFER_TYPE'}}}}

Enables all features in an organization. This enables the use of organization policies that can restrict the services and actions that can be called in each account. Until you enable all features, you have access only to consolidated billing, and you can't use any of the advanced account administration features that Organizations supports. For more information, see Enabling all features in your organization in the Organizations User Guide.

After you enable all features, you can separately enable or disable individual policy types in a root using EnablePolicyType and DisablePolicyType. To see the status of policy types in a root, use ListRoots.

After all invited member accounts accept the handshake, you finalize the feature set change by accepting the handshake that contains "Action": "ENABLE_ALL_FEATURES". This completes the change.

After you enable all features in your organization, the management account in the organization can apply policies on all member accounts. These policies can restrict what users and even administrators in those accounts can do. The management account can apply policies that prevent accounts from leaving the organization. Ensure that your account administrators are aware of this.

You can only call this operation from the management account.

See also: AWS API Documentation

Request Syntax

client.enable_all_features()
rtype:

dict

returns:

Response Syntax

{
    'Handshake': {
        'Id': 'string',
        'Arn': 'string',
        'Parties': [
            {
                'Id': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
            },
        ],
        'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'ExpirationTimestamp': datetime(2015, 1, 1),
        'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'Resources': [
            {
                'Value': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                'Resources': {'... recursive ...'}
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Handshake (dict) --

      A structure that contains details about the handshake created to support this request to enable all features in the organization.

      • Id (string) --

        ID for the handshake.

        The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

      • Arn (string) --

        Amazon Resource Name (ARN) for the handshake.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Parties (list) --

        An array of HandshakeParty objects. Contains details for participant in a handshake.

        • (dict) --

          Contains details for a participant in a handshake.

          • Id (string) --

            ID for the participant: Acccount ID, organization ID, or email address.

            The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

          • Type (string) --

            The type of ID for the participant.

      • State (string) --

        Current state for the handshake.

        • REQUESTED: Handshake awaiting a response from the recipient.

        • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

        • CANCELED: Handshake canceled by the sender.

        • ACCEPTED: Handshake accepted by the recipient.

        • DECLINED: Handshake declined by the recipient.

        • EXPIRED: Handshake has expired.

      • RequestedTimestamp (datetime) --

        Timestamp when the handshake request was made.

      • ExpirationTimestamp (datetime) --

        Timestamp when the handshake expires.

      • Action (string) --

        The type of handshake:

        • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

        • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

        • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

        • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

      • Resources (list) --

        An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

        • (dict) --

          Contains additional details for a handshake.

          • Value (string) --

            Additional information for the handshake. The format of the value string must match the requirements of the specified type.

          • Type (string) --

            The type of information being passed, specifying how the value is to be interpreted by the other party:

            • ACCOUNT: ID for an Amazon Web Services account.

            • ORGANIZATION: ID for an organization.

            • EMAIL: Email address for the recipient.

            • OWNER_EMAIL: Email address for the sender.

            • OWNER_NAME: Name of the sender.

            • NOTES: Additional text included by the sender for the recipient.

          • Resources (list) --

            An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

EnablePolicyType (updated) Link ¶
Changes (request, response)
Request
{'PolicyType': {'INSPECTOR_POLICY'}}
Response
{'Root': {'PolicyTypes': {'Type': {'INSPECTOR_POLICY'}}}}

Enables a policy type in a root. After you enable a policy type in a root, you can attach policies of that type to the root, any organizational unit (OU), or account in that root. You can undo this by using the DisablePolicyType operation.

This is an asynchronous request that Amazon Web Services performs in the background. Amazon Web Services recommends that you first use ListRoots to see the status of policy types for a specified root, and then use this operation.

You can only call this operation from the management account or a member account that is a delegated administrator.

You can enable a policy type in a root only if that policy type is available in the organization. To view the status of available policy types in the organization, use ListRoots.

See also: AWS API Documentation

Request Syntax

client.enable_policy_type(
    RootId='string',
    PolicyType='SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY'
)
type RootId:

string

param RootId:

[REQUIRED]

ID for the root in which you want to enable a policy type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or digits.

type PolicyType:

string

param PolicyType:

[REQUIRED]

The policy type that you want to enable. You can specify one of the following values:

rtype:

dict

returns:

Response Syntax

{
    'Root': {
        'Id': 'string',
        'Arn': 'string',
        'Name': 'string',
        'PolicyTypes': [
            {
                'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
                'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Root (dict) --

      A structure that shows the root with the updated list of enabled policy types.

      • Id (string) --

        The unique identifier (ID) for the root. The ID is unique to the organization only.

        The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or digits.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the root.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Name (string) --

        The friendly name of the root.

        The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

      • PolicyTypes (list) --

        The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts.

        • (dict) --

          Contains information about a policy type and its status in the associated root.

          • Type (string) --

            The name of the policy type.

          • Status (string) --

            The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.

InviteAccountToOrganization (updated) Link ¶
Changes (response)
{'Handshake': {'Action': {'TRANSFER_RESPONSIBILITY'},
               'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                      'MANAGEMENT_EMAIL',
                                      'MANAGEMENT_NAME',
                                      'RESPONSIBILITY_TRANSFER',
                                      'TRANSFER_START_TIMESTAMP',
                                      'TRANSFER_TYPE'}}}}

Sends an invitation to another account to join your organization as a member account. Organizations sends email on your behalf to the email address that is associated with the other account's owner. The invitation is implemented as a Handshake whose details are in the response.

If the request includes tags, then the requester must have the organizations:TagResource permission.

You can only call this operation from the management account.

See also: AWS API Documentation

Request Syntax

client.invite_account_to_organization(
    Target={
        'Id': 'string',
        'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
    },
    Notes='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Target:

dict

param Target:

[REQUIRED]

The identifier (ID) of the Amazon Web Services account that you want to invite to join your organization. This is a JSON object that contains the following elements:

{ "Type": "ACCOUNT", "Id": "< **account id number** >" }

If you use the CLI, you can submit this as a single string, similar to the following example:

--target Id=123456789012,Type=ACCOUNT

If you specify "Type": "ACCOUNT", you must provide the Amazon Web Services account ID number as the Id. If you specify "Type": "EMAIL", you must specify the email address that is associated with the account.

--target Id=diego@example.com,Type=EMAIL

  • Id (string) -- [REQUIRED]

    ID for the participant: Acccount ID, organization ID, or email address.

    The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

  • Type (string) -- [REQUIRED]

    The type of ID for the participant.

type Notes:

string

param Notes:

Additional information that you want to include in the generated email to the recipient account owner.

type Tags:

list

param Tags:

A list of tags that you want to attach to the account when it becomes a member of the organization. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging Organizations resources in the Organizations User Guide.

  • (dict) --

    A custom key-value pair associated with a resource within your organization.

    You can attach tags to any of the following organization resources.

    • Amazon Web Services account

    • Organizational unit (OU)

    • Organization root

    • Policy

    • Key (string) -- [REQUIRED]

      The key identifier, or name, of the tag.

    • Value (string) -- [REQUIRED]

      The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

rtype:

dict

returns:

Response Syntax

{
    'Handshake': {
        'Id': 'string',
        'Arn': 'string',
        'Parties': [
            {
                'Id': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
            },
        ],
        'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'ExpirationTimestamp': datetime(2015, 1, 1),
        'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'Resources': [
            {
                'Value': 'string',
                'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                'Resources': {'... recursive ...'}
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Handshake (dict) --

      A structure that contains details about the handshake that is created to support this invitation request.

      • Id (string) --

        ID for the handshake.

        The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

      • Arn (string) --

        Amazon Resource Name (ARN) for the handshake.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Parties (list) --

        An array of HandshakeParty objects. Contains details for participant in a handshake.

        • (dict) --

          Contains details for a participant in a handshake.

          • Id (string) --

            ID for the participant: Acccount ID, organization ID, or email address.

            The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

          • Type (string) --

            The type of ID for the participant.

      • State (string) --

        Current state for the handshake.

        • REQUESTED: Handshake awaiting a response from the recipient.

        • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

        • CANCELED: Handshake canceled by the sender.

        • ACCEPTED: Handshake accepted by the recipient.

        • DECLINED: Handshake declined by the recipient.

        • EXPIRED: Handshake has expired.

      • RequestedTimestamp (datetime) --

        Timestamp when the handshake request was made.

      • ExpirationTimestamp (datetime) --

        Timestamp when the handshake expires.

      • Action (string) --

        The type of handshake:

        • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

        • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

        • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

        • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

      • Resources (list) --

        An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

        • (dict) --

          Contains additional details for a handshake.

          • Value (string) --

            Additional information for the handshake. The format of the value string must match the requirements of the specified type.

          • Type (string) --

            The type of information being passed, specifying how the value is to be interpreted by the other party:

            • ACCOUNT: ID for an Amazon Web Services account.

            • ORGANIZATION: ID for an organization.

            • EMAIL: Email address for the recipient.

            • OWNER_EMAIL: Email address for the sender.

            • OWNER_NAME: Name of the sender.

            • NOTES: Additional text included by the sender for the recipient.

          • Resources (list) --

            An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

ListAccountsWithInvalidEffectivePolicy (updated) Link ¶
Changes (both)
{'PolicyType': {'INSPECTOR_POLICY'}}

Lists all the accounts in an organization that have invalid effective policies. An invalid effective policy is an effective policy that fails validation checks, resulting in the effective policy not being fully enforced on all the intended accounts within an organization.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.list_accounts_with_invalid_effective_policy(
    PolicyType='TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    NextToken='string',
    MaxResults=123
)
type PolicyType:

string

param PolicyType:

[REQUIRED]

The type of policy that you want information about. You can specify one of the following values:

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'Accounts': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Email': 'string',
            'Name': 'string',
            'Status': 'ACTIVE'|'SUSPENDED'|'PENDING_CLOSURE',
            'State': 'PENDING_ACTIVATION'|'ACTIVE'|'SUSPENDED'|'PENDING_CLOSURE'|'CLOSED',
            'JoinedMethod': 'INVITED'|'CREATED',
            'JoinedTimestamp': datetime(2015, 1, 1)
        },
    ],
    'PolicyType': 'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Accounts (list) --

      The accounts in the organization which have an invalid effective policy for the specified policy type.

      • (dict) --

        Contains information about an Amazon Web Services account that is a member of an organization.

        • Id (string) --

          The unique identifier (ID) of the account.

          The regex pattern for an account ID string requires exactly 12 digits.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the account.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Email (string) --

          The email address associated with the Amazon Web Services account.

          The regex pattern for this parameter is a string of characters that represents a standard internet email address.

        • Name (string) --

          The friendly name of the account.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Status (string) --

          The status of the account in the organization.

        • State (string) --

          Each state represents a specific phase in the account lifecycle. Use this information to manage account access, automate workflows, or trigger actions based on account state changes.

          For more information about account states and their implications, see Monitor the state of your Amazon Web Services accounts in the Organizations User Guide.

        • JoinedMethod (string) --

          The method by which the account joined the organization.

        • JoinedTimestamp (datetime) --

          The date the account became a part of the organization.

    • PolicyType (string) --

      The specified policy type. One of the following values:

    • NextToken (string) --

      If present, 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.

ListEffectivePolicyValidationErrors (updated) Link ¶
Changes (both)
{'PolicyType': {'INSPECTOR_POLICY'}}

Lists all the validation errors on an effective policy for a specified account and policy type.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.list_effective_policy_validation_errors(
    AccountId='string',
    PolicyType='TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    NextToken='string',
    MaxResults=123
)
type AccountId:

string

param AccountId:

[REQUIRED]

The ID of the account that you want details about. Specifying an organization root or organizational unit (OU) as the target is not supported.

type PolicyType:

string

param PolicyType:

[REQUIRED]

The type of policy that you want information about. You can specify one of the following values:

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'AccountId': 'string',
    'PolicyType': 'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    'Path': 'string',
    'EvaluationTimestamp': datetime(2015, 1, 1),
    'NextToken': 'string',
    'EffectivePolicyValidationErrors': [
        {
            'ErrorCode': 'string',
            'ErrorMessage': 'string',
            'PathToError': 'string',
            'ContributingPolicies': [
                'string',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • AccountId (string) --

      The ID of the specified account.

    • PolicyType (string) --

      The specified policy type. One of the following values:

    • Path (string) --

      The path in the organization where the specified account exists.

    • EvaluationTimestamp (datetime) --

      The time when the latest effective policy was generated for the specified account.

    • NextToken (string) --

      If present, 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.

    • EffectivePolicyValidationErrors (list) --

      The EffectivePolicyValidationError object contains details about the validation errors that occurred when generating or enforcing an effective policy, such as which policies contributed to the error and location of the error.

      • (dict) --

        Contains details about the validation errors that occurred when generating or enforcing an effective policy, such as which policies contributed to the error and location of the error.

        • ErrorCode (string) --

          The error code for the validation error. For example, ELEMENTS_TOO_MANY.

        • ErrorMessage (string) --

          The error message for the validation error.

        • PathToError (string) --

          The path within the effective policy where the validation error occurred.

        • ContributingPolicies (list) --

          The individual policies inherited and attached to the account which contributed to the validation error.

          • (string) --

ListHandshakesForAccount (updated) Link ¶
Changes (request, response)
Request
{'Filter': {'ActionType': {'TRANSFER_RESPONSIBILITY'}}}
Response
{'Handshakes': {'Action': {'TRANSFER_RESPONSIBILITY'},
                'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                       'MANAGEMENT_EMAIL',
                                       'MANAGEMENT_NAME',
                                       'RESPONSIBILITY_TRANSFER',
                                       'TRANSFER_START_TIMESTAMP',
                                       'TRANSFER_TYPE'}}}}

Lists the recent handshakes that you have received.

You can view CANCELED, ACCEPTED, DECLINED, or EXPIRED handshakes in API responses for 30 days before they are deleted.

You can call this operation from any account in a organization.

See also: AWS API Documentation

Request Syntax

client.list_handshakes_for_account(
    Filter={
        'ActionType': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'ParentHandshakeId': 'string'
    },
    NextToken='string',
    MaxResults=123
)
type Filter:

dict

param Filter:

A HandshakeFilter object. Contains the filer used to select the handshakes for an operation.

  • ActionType (string) --

    The type of handshake.

    If you specify ActionType, you cannot also specify ParentHandshakeId.

  • ParentHandshakeId (string) --

    The parent handshake. Only used for handshake types that are a child of another type.

    If you specify ParentHandshakeId, you cannot also specify ActionType.

    The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'Handshakes': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Parties': [
                {
                    'Id': 'string',
                    'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
                },
            ],
            'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
            'RequestedTimestamp': datetime(2015, 1, 1),
            'ExpirationTimestamp': datetime(2015, 1, 1),
            'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
            'Resources': [
                {
                    'Value': 'string',
                    'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                    'Resources': {'... recursive ...'}
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Handshakes (list) --

      An array of ``Handshake``objects. Contains details for a handshake.

      • (dict) --

        Contains details for a handshake. A handshake is the secure exchange of information between two Amazon Web Services accounts: a sender and a recipient.

        Note: Handshakes that are CANCELED, ACCEPTED, DECLINED, or EXPIRED show up in lists for only 30 days after entering that state After that they are deleted.

        • Id (string) --

          ID for the handshake.

          The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

        • Arn (string) --

          Amazon Resource Name (ARN) for the handshake.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Parties (list) --

          An array of HandshakeParty objects. Contains details for participant in a handshake.

          • (dict) --

            Contains details for a participant in a handshake.

            • Id (string) --

              ID for the participant: Acccount ID, organization ID, or email address.

              The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

            • Type (string) --

              The type of ID for the participant.

        • State (string) --

          Current state for the handshake.

          • REQUESTED: Handshake awaiting a response from the recipient.

          • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

          • CANCELED: Handshake canceled by the sender.

          • ACCEPTED: Handshake accepted by the recipient.

          • DECLINED: Handshake declined by the recipient.

          • EXPIRED: Handshake has expired.

        • RequestedTimestamp (datetime) --

          Timestamp when the handshake request was made.

        • ExpirationTimestamp (datetime) --

          Timestamp when the handshake expires.

        • Action (string) --

          The type of handshake:

          • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

          • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

          • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

          • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

        • Resources (list) --

          An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

          • (dict) --

            Contains additional details for a handshake.

            • Value (string) --

              Additional information for the handshake. The format of the value string must match the requirements of the specified type.

            • Type (string) --

              The type of information being passed, specifying how the value is to be interpreted by the other party:

              • ACCOUNT: ID for an Amazon Web Services account.

              • ORGANIZATION: ID for an organization.

              • EMAIL: Email address for the recipient.

              • OWNER_EMAIL: Email address for the sender.

              • OWNER_NAME: Name of the sender.

              • NOTES: Additional text included by the sender for the recipient.

            • Resources (list) --

              An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

    • NextToken (string) --

      If present, 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.

ListHandshakesForOrganization (updated) Link ¶
Changes (request, response)
Request
{'Filter': {'ActionType': {'TRANSFER_RESPONSIBILITY'}}}
Response
{'Handshakes': {'Action': {'TRANSFER_RESPONSIBILITY'},
                'Resources': {'Type': {'MANAGEMENT_ACCOUNT',
                                       'MANAGEMENT_EMAIL',
                                       'MANAGEMENT_NAME',
                                       'RESPONSIBILITY_TRANSFER',
                                       'TRANSFER_START_TIMESTAMP',
                                       'TRANSFER_TYPE'}}}}

Lists the recent handshakes that you have sent.

You can view CANCELED, ACCEPTED, DECLINED, or EXPIRED handshakes in API responses for 30 days before they are deleted.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.list_handshakes_for_organization(
    Filter={
        'ActionType': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
        'ParentHandshakeId': 'string'
    },
    NextToken='string',
    MaxResults=123
)
type Filter:

dict

param Filter:

A HandshakeFilter object. Contains the filer used to select the handshakes for an operation.

  • ActionType (string) --

    The type of handshake.

    If you specify ActionType, you cannot also specify ParentHandshakeId.

  • ParentHandshakeId (string) --

    The parent handshake. Only used for handshake types that are a child of another type.

    If you specify ParentHandshakeId, you cannot also specify ActionType.

    The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'Handshakes': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Parties': [
                {
                    'Id': 'string',
                    'Type': 'ACCOUNT'|'ORGANIZATION'|'EMAIL'
                },
            ],
            'State': 'REQUESTED'|'OPEN'|'CANCELED'|'ACCEPTED'|'DECLINED'|'EXPIRED',
            'RequestedTimestamp': datetime(2015, 1, 1),
            'ExpirationTimestamp': datetime(2015, 1, 1),
            'Action': 'INVITE'|'ENABLE_ALL_FEATURES'|'APPROVE_ALL_FEATURES'|'ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE'|'TRANSFER_RESPONSIBILITY',
            'Resources': [
                {
                    'Value': 'string',
                    'Type': 'ACCOUNT'|'ORGANIZATION'|'ORGANIZATION_FEATURE_SET'|'EMAIL'|'MASTER_EMAIL'|'MASTER_NAME'|'NOTES'|'PARENT_HANDSHAKE'|'RESPONSIBILITY_TRANSFER'|'TRANSFER_START_TIMESTAMP'|'TRANSFER_TYPE'|'MANAGEMENT_ACCOUNT'|'MANAGEMENT_EMAIL'|'MANAGEMENT_NAME',
                    'Resources': {'... recursive ...'}
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Handshakes (list) --

      An array of ``Handshake``objects. Contains details for a handshake.

      • (dict) --

        Contains details for a handshake. A handshake is the secure exchange of information between two Amazon Web Services accounts: a sender and a recipient.

        Note: Handshakes that are CANCELED, ACCEPTED, DECLINED, or EXPIRED show up in lists for only 30 days after entering that state After that they are deleted.

        • Id (string) --

          ID for the handshake.

          The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

        • Arn (string) --

          Amazon Resource Name (ARN) for the handshake.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Parties (list) --

          An array of HandshakeParty objects. Contains details for participant in a handshake.

          • (dict) --

            Contains details for a participant in a handshake.

            • Id (string) --

              ID for the participant: Acccount ID, organization ID, or email address.

              The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

            • Type (string) --

              The type of ID for the participant.

        • State (string) --

          Current state for the handshake.

          • REQUESTED: Handshake awaiting a response from the recipient.

          • OPEN: Handshake sent to multiple recipients and all recipients have responded. The sender can now complete the handshake action.

          • CANCELED: Handshake canceled by the sender.

          • ACCEPTED: Handshake accepted by the recipient.

          • DECLINED: Handshake declined by the recipient.

          • EXPIRED: Handshake has expired.

        • RequestedTimestamp (datetime) --

          Timestamp when the handshake request was made.

        • ExpirationTimestamp (datetime) --

          Timestamp when the handshake expires.

        • Action (string) --

          The type of handshake:

          • INVITE: Handshake sent to a standalone account requesting that it to join the sender's organization.

          • ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable all features for the organization.

          • APPROVE_ALL_FEATURES: Handshake sent to the management account when all invited member accounts have approved to enable all features.

          • TRANSFER_RESPONSIBILITY: Handshake sent to another organization's management account requesting that it designate the sender with the specified responsibilities for recipient's organization.

        • Resources (list) --

          An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

          • (dict) --

            Contains additional details for a handshake.

            • Value (string) --

              Additional information for the handshake. The format of the value string must match the requirements of the specified type.

            • Type (string) --

              The type of information being passed, specifying how the value is to be interpreted by the other party:

              • ACCOUNT: ID for an Amazon Web Services account.

              • ORGANIZATION: ID for an organization.

              • EMAIL: Email address for the recipient.

              • OWNER_EMAIL: Email address for the sender.

              • OWNER_NAME: Name of the sender.

              • NOTES: Additional text included by the sender for the recipient.

            • Resources (list) --

              An array of HandshakeResource objects. When needed, contains additional details for a handshake. For example, the email address for the sender.

    • NextToken (string) --

      If present, 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.

ListPolicies (updated) Link ¶
Changes (request, response)
Request
{'Filter': {'INSPECTOR_POLICY'}}
Response
{'Policies': {'Type': {'INSPECTOR_POLICY'}}}

Retrieves the list of all policies in an organization of a specified type.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.list_policies(
    Filter='SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    NextToken='string',
    MaxResults=123
)
type Filter:

string

param Filter:

[REQUIRED]

Specifies the type of policy that you want to include in the response. You must specify one of the following values:

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'Policies': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
            'AwsManaged': True|False
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Policies (list) --

      A list of policies that match the filter criteria in the request. The output list doesn't include the policy contents. To see the content for a policy, see DescribePolicy.

      • (dict) --

        Contains information about a policy, but does not include the content. To see the content of a policy, see DescribePolicy.

        • Id (string) --

          The unique identifier (ID) of the policy.

          The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

        • Arn (string) --

          The Amazon Resource Name (ARN) of the policy.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Name (string) --

          The friendly name of the policy.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Description (string) --

          The description of the policy.

        • Type (string) --

          The type of policy.

        • AwsManaged (boolean) --

          A boolean value that indicates whether the specified policy is an Amazon Web Services managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.

    • NextToken (string) --

      If present, 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.

ListPoliciesForTarget (updated) Link ¶
Changes (request, response)
Request
{'Filter': {'INSPECTOR_POLICY'}}
Response
{'Policies': {'Type': {'INSPECTOR_POLICY'}}}

Lists the policies that are directly attached to the specified target root, organizational unit (OU), or account. You must specify the policy type that you want included in the returned list.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.list_policies_for_target(
    TargetId='string',
    Filter='SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
    NextToken='string',
    MaxResults=123
)
type TargetId:

string

param TargetId:

[REQUIRED]

ID for the root, organizational unit, or account whose policies you want to list.

The regex pattern for a target ID string requires one of the following:

  • Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.

  • Account - A string that consists of exactly 12 digits.

  • Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.

type Filter:

string

param Filter:

[REQUIRED]

The type of policy that you want to include in the returned list. You must specify one of the following values:

type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'Policies': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
            'AwsManaged': True|False
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Policies (list) --

      The list of policies that match the criteria in the request.

      • (dict) --

        Contains information about a policy, but does not include the content. To see the content of a policy, see DescribePolicy.

        • Id (string) --

          The unique identifier (ID) of the policy.

          The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

        • Arn (string) --

          The Amazon Resource Name (ARN) of the policy.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Name (string) --

          The friendly name of the policy.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Description (string) --

          The description of the policy.

        • Type (string) --

          The type of policy.

        • AwsManaged (boolean) --

          A boolean value that indicates whether the specified policy is an Amazon Web Services managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.

    • NextToken (string) --

      If present, 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.

ListRoots (updated) Link ¶
Changes (response)
{'Roots': {'PolicyTypes': {'Type': {'INSPECTOR_POLICY'}}}}

Lists the roots that are defined in the current organization.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.list_roots(
    NextToken='string',
    MaxResults=123
)
type NextToken:

string

param NextToken:

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

rtype:

dict

returns:

Response Syntax

{
    'Roots': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'PolicyTypes': [
                {
                    'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
                    'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Roots (list) --

      A list of roots that are defined in an organization.

      • (dict) --

        Contains details about a root. A root is a top-level parent node in the hierarchy of an organization that can contain organizational units (OUs) and accounts. The root contains every Amazon Web Services account in the organization.

        • Id (string) --

          The unique identifier (ID) for the root. The ID is unique to the organization only.

          The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or digits.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the root.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Name (string) --

          The friendly name of the root.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • PolicyTypes (list) --

          The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts.

          • (dict) --

            Contains information about a policy type and its status in the associated root.

            • Type (string) --

              The name of the policy type.

            • Status (string) --

              The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.

    • NextToken (string) --

      If present, 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.

UpdatePolicy (updated) Link ¶
Changes (response)
{'Policy': {'PolicySummary': {'Type': {'INSPECTOR_POLICY'}}}}

Updates an existing policy with a new name, description, or content. If you don't supply any parameter, that value remains unchanged. You can't change a policy's type.

You can only call this operation from the management account or a member account that is a delegated administrator.

See also: AWS API Documentation

Request Syntax

client.update_policy(
    PolicyId='string',
    Name='string',
    Description='string',
    Content='string'
)
type PolicyId:

string

param PolicyId:

[REQUIRED]

ID for the policy that you want to update.

The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

type Name:

string

param Name:

If provided, the new name for the policy.

The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

type Description:

string

param Description:

If provided, the new description for the policy.

type Content:

string

param Content:

If provided, the new content for the policy. The text must be correctly formatted JSON that complies with the syntax for the policy's type. For more information, see SCP syntax in the Organizations User Guide.

The maximum size of a policy document depends on the policy's type. For more information, see Maximum and minimum values in the Organizations User Guide.

rtype:

dict

returns:

Response Syntax

{
    'Policy': {
        'PolicySummary': {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY',
            'AwsManaged': True|False
        },
        'Content': 'string'
    }
}

Response Structure

  • (dict) --

    • Policy (dict) --

      A structure that contains details about the updated policy, showing the requested changes.

      • PolicySummary (dict) --

        A structure that contains additional details about the policy.

        • Id (string) --

          The unique identifier (ID) of the policy.

          The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

        • Arn (string) --

          The Amazon Resource Name (ARN) of the policy.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

        • Name (string) --

          The friendly name of the policy.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Description (string) --

          The description of the policy.

        • Type (string) --

          The type of policy.

        • AwsManaged (boolean) --

          A boolean value that indicates whether the specified policy is an Amazon Web Services managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.

      • Content (string) --

        The text content of the policy.