amazonka-ec2-2.0: Amazon Elastic Compute Cloud 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.EC2.CreateTags

Description

Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources. When you specify an existing tag key, the value is overwritten with the new value. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.

For more information about tags, see Tag your Amazon EC2 resources in the Amazon Elastic Compute Cloud User Guide. For more information about creating IAM policies that control users' access to resources based on tags, see Supported resource-level permissions for Amazon EC2 API actions in the Amazon Elastic Compute Cloud User Guide.

Synopsis

Creating a Request

data CreateTags Source #

See: newCreateTags smart constructor.

Constructors

CreateTags' 

Fields

  • dryRun :: Maybe Bool

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • resources :: [Text]

    The IDs of the resources, separated by spaces.

    Constraints: Up to 1000 resource IDs. We recommend breaking up this request into smaller batches.

  • tags :: [Tag]

    The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

Instances

Instances details
ToHeaders CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Methods

toHeaders :: CreateTags -> [Header] #

ToPath CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

ToQuery CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

AWSRequest CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Associated Types

type AWSResponse CreateTags #

Generic CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Associated Types

type Rep CreateTags :: Type -> Type #

Read CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Show CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

NFData CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Methods

rnf :: CreateTags -> () #

Eq CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Hashable CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

type AWSResponse CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

type Rep CreateTags Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

type Rep CreateTags = D1 ('MetaData "CreateTags" "Amazonka.EC2.CreateTags" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateTags'" 'PrefixI 'True) (S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "resources") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text]) :*: S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]))))

newCreateTags :: CreateTags Source #

Create a value of CreateTags 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:dryRun:CreateTags', createTags_dryRun - Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

CreateTags, createTags_resources - The IDs of the resources, separated by spaces.

Constraints: Up to 1000 resource IDs. We recommend breaking up this request into smaller batches.

CreateTags, createTags_tags - The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

Request Lenses

createTags_dryRun :: Lens' CreateTags (Maybe Bool) Source #

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

createTags_resources :: Lens' CreateTags [Text] Source #

The IDs of the resources, separated by spaces.

Constraints: Up to 1000 resource IDs. We recommend breaking up this request into smaller batches.

createTags_tags :: Lens' CreateTags [Tag] Source #

The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

Destructuring the Response

data CreateTagsResponse Source #

See: newCreateTagsResponse smart constructor.

Constructors

CreateTagsResponse' 

Instances

Instances details
Generic CreateTagsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Associated Types

type Rep CreateTagsResponse :: Type -> Type #

Read CreateTagsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Show CreateTagsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

NFData CreateTagsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

Methods

rnf :: CreateTagsResponse -> () #

Eq CreateTagsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

type Rep CreateTagsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateTags

type Rep CreateTagsResponse = D1 ('MetaData "CreateTagsResponse" "Amazonka.EC2.CreateTags" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateTagsResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newCreateTagsResponse :: CreateTagsResponse Source #

Create a value of CreateTagsResponse with all optional fields omitted.

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