libZSservicesZSamazonka-organizationsZSamazonka-organizations
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.Organizations.TagResource

Description

Adds one or more tags to the specified resource.

Currently, you can attach tags to the following resources in AWS Organizations.

  • AWS account
  • Organization root
  • Organizational unit (OU)
  • Policy (any type)

This operation can be called only from the organization's management account.

Synopsis

Creating a Request

data TagResource Source #

See: newTagResource smart constructor.

Constructors

TagResource' 

Fields

  • resourceId :: Text

    The ID of the resource to add a tag to.

  • tags :: [Tag]

    A list of tags to add to the specified resource.

    You can specify any of the following taggable resources.

    • AWS account – specify the account ID number.
    • Organizational unit – specify the OU ID that begins with ou- and looks similar to: ou-1a2b-34uvwxyz
    • Root – specify the root ID that begins with r- and looks similar to: r-1a2b
    • Policy – specify the policy ID that begins with p- andlooks similar to: p-12abcdefg3

    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.

    If any one of the tags is invalid or if you exceed the allowed number of tags for an account user, then the entire request fails and the account is not created.

Instances

Instances details
Eq TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Read TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Show TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Generic TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Associated Types

type Rep TagResource :: Type -> Type #

NFData TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Methods

rnf :: TagResource -> () #

Hashable TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

ToJSON TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

AWSRequest TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Associated Types

type AWSResponse TagResource #

ToHeaders TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Methods

toHeaders :: TagResource -> [Header] #

ToPath TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

ToQuery TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

type Rep TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

type Rep TagResource = D1 ('MetaData "TagResource" "Amazonka.Organizations.TagResource" "libZSservicesZSamazonka-organizationsZSamazonka-organizations" 'False) (C1 ('MetaCons "TagResource'" 'PrefixI 'True) (S1 ('MetaSel ('Just "resourceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag])))
type AWSResponse TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

newTagResource Source #

Create a value of TagResource with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:resourceId:TagResource', tagResource_resourceId - The ID of the resource to add a tag to.

$sel:tags:TagResource', tagResource_tags - A list of tags to add to the specified resource.

You can specify any of the following taggable resources.

  • AWS account – specify the account ID number.
  • Organizational unit – specify the OU ID that begins with ou- and looks similar to: ou-1a2b-34uvwxyz
  • Root – specify the root ID that begins with r- and looks similar to: r-1a2b
  • Policy – specify the policy ID that begins with p- andlooks similar to: p-12abcdefg3

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.

If any one of the tags is invalid or if you exceed the allowed number of tags for an account user, then the entire request fails and the account is not created.

Request Lenses

tagResource_resourceId :: Lens' TagResource Text Source #

The ID of the resource to add a tag to.

tagResource_tags :: Lens' TagResource [Tag] Source #

A list of tags to add to the specified resource.

You can specify any of the following taggable resources.

  • AWS account – specify the account ID number.
  • Organizational unit – specify the OU ID that begins with ou- and looks similar to: ou-1a2b-34uvwxyz
  • Root – specify the root ID that begins with r- and looks similar to: r-1a2b
  • Policy – specify the policy ID that begins with p- andlooks similar to: p-12abcdefg3

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.

If any one of the tags is invalid or if you exceed the allowed number of tags for an account user, then the entire request fails and the account is not created.

Destructuring the Response

data TagResourceResponse Source #

See: newTagResourceResponse smart constructor.

Constructors

TagResourceResponse' 

Instances

Instances details
Eq TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Read TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Show TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Generic TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Associated Types

type Rep TagResourceResponse :: Type -> Type #

NFData TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Methods

rnf :: TagResourceResponse -> () #

type Rep TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

type Rep TagResourceResponse = D1 ('MetaData "TagResourceResponse" "Amazonka.Organizations.TagResource" "libZSservicesZSamazonka-organizationsZSamazonka-organizations" 'False) (C1 ('MetaCons "TagResourceResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newTagResourceResponse :: TagResourceResponse Source #

Create a value of TagResourceResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.