Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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
- data TagResource = TagResource' {
- resourceId :: Text
- tags :: [Tag]
- newTagResource :: Text -> TagResource
- tagResource_resourceId :: Lens' TagResource Text
- tagResource_tags :: Lens' TagResource [Tag]
- data TagResourceResponse = TagResourceResponse' {
- newTagResourceResponse :: TagResourceResponse
Creating a Request
data TagResource Source #
See: newTagResource
smart constructor.
Constructors
TagResource' | |
Fields
|
Instances
Arguments
:: Text | |
-> TagResource |
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
newTagResourceResponse :: TagResourceResponse Source #
Create a value of TagResourceResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.