AWS Organizations

2019/06/06 - AWS Organizations - 3 new api methods

Changes  Update organizations client to latest version

ListTagsForResource (new) Link ¶

Lists tags for the specified resource.

Currently, you can list tags on an account in AWS Organizations.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceId='string',
    NextToken='string'
)
type ResourceId:

string

param ResourceId:

[REQUIRED]

The ID of the resource that you want to retrieve tags for.

type NextToken:

string

param NextToken:

Use this parameter if you receive a NextToken response in a previous request that indicates that there is more output available. Set it to the value of the previous call's NextToken response to indicate where the output should continue from.

rtype:

dict

returns:

Response Syntax

{
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Tags (list) --

      The tags that are assigned to the resource.

      • (dict) --

        A custom key-value pair associated with a resource such as an account within your organization.

        • Key (string) --

          The key identifier, or name, of the tag.

        • Value (string) --

          The string value that's associated with the key of the tag.

    • NextToken (string) --

      If present, this value indicates that there is more output 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.

UntagResource (new) Link ¶

Removes a tag from the specified resource.

Currently, you can tag and untag accounts in AWS Organizations.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ResourceId='string',
    TagKeys=[
        'string',
    ]
)
type ResourceId:

string

param ResourceId:

[REQUIRED]

The ID of the resource to remove the tag from.

type TagKeys:

list

param TagKeys:

[REQUIRED]

The tag to remove from the specified resource.

  • (string) --

returns:

None

TagResource (new) Link ¶

Adds one or more tags to the specified resource.

Currently, you can tag and untag accounts in AWS Organizations.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ResourceId='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ResourceId:

string

param ResourceId:

[REQUIRED]

The ID of the resource to add a tag to.

type Tags:

list

param Tags:

[REQUIRED]

The tag to add to the specified resource.

  • (dict) --

    A custom key-value pair associated with a resource such as an account within your organization.

    • Key (string) --

      The key identifier, or name, of the tag.

    • Value (string) --

      The string value that's associated with the key of the tag.

returns:

None