amazonka-organizations-2.0: Amazon Organizations SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Organizations.TagResource

Description

Adds one or more tags to the specified resource.

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

  • Amazon Web Services 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.

    You can specify any of the following taggable resources.

    • Amazon Web Services 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
  • tags :: [Tag]

    A list of tags to add to the specified resource.

    For each tag in the list, you must specify both a tag key and a value. The value can be an empty string, but you can't set it to null.

    If any one of the tags is invalid or if you exceed the maximum allowed number of tags for a resource, then the entire request fails.

Instances

Instances details
ToJSON TagResource Source # 
Instance details

Defined in Amazonka.Organizations.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

AWSRequest TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Associated Types

type AWSResponse TagResource #

Generic TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Associated Types

type Rep TagResource :: Type -> Type #

Read TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Show TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

NFData TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Methods

rnf :: TagResource -> () #

Eq TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Hashable TagResource Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

type AWSResponse 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" "amazonka-organizations-2.0-JONpdX4PtttLcKxQshpOlA" 'False) (C1 ('MetaCons "TagResource'" 'PrefixI 'True) (S1 ('MetaSel ('Just "resourceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag])))

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.

You can specify any of the following taggable resources.

  • Amazon Web Services 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

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

For each tag in the list, you must specify both a tag key and a value. The value can be an empty string, but you can't set it to null.

If any one of the tags is invalid or if you exceed the maximum allowed number of tags for a resource, then the entire request fails.

Request Lenses

tagResource_resourceId :: Lens' TagResource Text Source #

The ID of the resource to add a tag to.

You can specify any of the following taggable resources.

  • Amazon Web Services 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

tagResource_tags :: Lens' TagResource [Tag] Source #

A list of tags to add to the specified resource.

For each tag in the list, you must specify both a tag key and a value. The value can be an empty string, but you can't set it to null.

If any one of the tags is invalid or if you exceed the maximum allowed number of tags for a resource, then the entire request fails.

Destructuring the Response

data TagResourceResponse Source #

See: newTagResourceResponse smart constructor.

Constructors

TagResourceResponse' 

Instances

Instances details
Generic TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Associated Types

type Rep TagResourceResponse :: Type -> Type #

Read TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Show TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

NFData TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

Methods

rnf :: TagResourceResponse -> () #

Eq TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

type Rep TagResourceResponse Source # 
Instance details

Defined in Amazonka.Organizations.TagResource

type Rep TagResourceResponse = D1 ('MetaData "TagResourceResponse" "Amazonka.Organizations.TagResource" "amazonka-organizations-2.0-JONpdX4PtttLcKxQshpOlA" '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.