amazonka-kms-1.6.0: Amazon Key Management Service SDK.

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

Network.AWS.KMS.TagResource

Contents

Description

Adds or overwrites one or more tags for the specified customer master key (CMK). You cannot perform this operation on a CMK in a different AWS account.

Each tag consists of a tag key and a tag value. Tag keys and tag values are both required, but tag values can be empty (null) strings.

You cannot use the same tag key more than once per CMK. For example, consider a CMK with one tag whose tag key is Purpose and tag value is Test . If you send a TagResource request for this CMK with a tag key of Purpose and a tag value of Prod , it does not create a second tag. Instead, the original tag is overwritten with the new tag value.

For information about the rules that apply to tag keys and tag values, see User-Defined Tag Restrictions in the AWS Billing and Cost Management User Guide .

Synopsis

Creating a Request

tagResource #

Arguments

:: Text

trKeyId

-> TagResource 

Creates a value of TagResource with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • trKeyId - A unique identifier for the CMK you are tagging. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. For example: * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey .
  • trTags - One or more tags. Each tag consists of a tag key and a tag value.

data TagResource #

See: tagResource smart constructor.

Instances
Eq TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Data TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TagResource -> c TagResource #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TagResource #

toConstr :: TagResource -> Constr #

dataTypeOf :: TagResource -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TagResource) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TagResource) #

gmapT :: (forall b. Data b => b -> b) -> TagResource -> TagResource #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TagResource -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TagResource -> r #

gmapQ :: (forall d. Data d => d -> u) -> TagResource -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TagResource -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TagResource -> m TagResource #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TagResource -> m TagResource #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TagResource -> m TagResource #

Read TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Show TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Generic TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Associated Types

type Rep TagResource :: * -> * #

Hashable TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

ToJSON TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

AWSRequest TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Associated Types

type Rs TagResource :: * #

ToHeaders TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Methods

toHeaders :: TagResource -> [Header] #

ToPath TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

ToQuery TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

NFData TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Methods

rnf :: TagResource -> () #

type Rep TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

type Rep TagResource = D1 (MetaData "TagResource" "Network.AWS.KMS.TagResource" "amazonka-kms-1.6.0-J0DpkKKCQ2By8yYSyE2w7" False) (C1 (MetaCons "TagResource'" PrefixI True) (S1 (MetaSel (Just "_trKeyId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_trTags") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Tag])))
type Rs TagResource # 
Instance details

Defined in Network.AWS.KMS.TagResource

Request Lenses

trKeyId :: Lens' TagResource Text #

A unique identifier for the CMK you are tagging. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. For example: * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey .

trTags :: Lens' TagResource [Tag] #

One or more tags. Each tag consists of a tag key and a tag value.

Destructuring the Response

tagResourceResponse :: TagResourceResponse #

Creates a value of TagResourceResponse with the minimum fields required to make a request.

data TagResourceResponse #

See: tagResourceResponse smart constructor.

Instances
Eq TagResourceResponse # 
Instance details

Defined in Network.AWS.KMS.TagResource

Data TagResourceResponse # 
Instance details

Defined in Network.AWS.KMS.TagResource

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TagResourceResponse -> c TagResourceResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TagResourceResponse #

toConstr :: TagResourceResponse -> Constr #

dataTypeOf :: TagResourceResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TagResourceResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TagResourceResponse) #

gmapT :: (forall b. Data b => b -> b) -> TagResourceResponse -> TagResourceResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TagResourceResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TagResourceResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> TagResourceResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TagResourceResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TagResourceResponse -> m TagResourceResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TagResourceResponse -> m TagResourceResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TagResourceResponse -> m TagResourceResponse #

Read TagResourceResponse # 
Instance details

Defined in Network.AWS.KMS.TagResource

Show TagResourceResponse # 
Instance details

Defined in Network.AWS.KMS.TagResource

Generic TagResourceResponse # 
Instance details

Defined in Network.AWS.KMS.TagResource

Associated Types

type Rep TagResourceResponse :: * -> * #

NFData TagResourceResponse # 
Instance details

Defined in Network.AWS.KMS.TagResource

Methods

rnf :: TagResourceResponse -> () #

type Rep TagResourceResponse # 
Instance details

Defined in Network.AWS.KMS.TagResource

type Rep TagResourceResponse = D1 (MetaData "TagResourceResponse" "Network.AWS.KMS.TagResource" "amazonka-kms-1.6.0-J0DpkKKCQ2By8yYSyE2w7" False) (C1 (MetaCons "TagResourceResponse'" PrefixI False) (U1 :: * -> *))