amazonka-secretsmanager-1.6.0: Amazon Secrets Manager 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.SecretsManager.TagResource

Contents

Description

Attaches one or more tags, each consisting of a key name and a value, to the specified secret. Tags are part of the secret's overall metadata, and are not associated with any specific version of the secret. This operation only appends tags to the existing list of tags. To remove tags, you must use UntagResource .

The following basic restrictions apply to tags:

  • Maximum number of tags per secret—50
  • Maximum key length—127 Unicode characters in UTF-8
  • Maximum value length—255 Unicode characters in UTF-8
  • Tag keys and values are case sensitive.
  • Do not use the aws: prefix in your tag names or values because it is reserved for AWS use. You can't edit or delete tag names or values with this prefix. Tags with this prefix do not count against your tags per secret limit.
  • If your tagging schema will be used across multiple services and resources, remember that other services might have restrictions on allowed characters. Generally allowed characters are: letters, spaces, and numbers representable in UTF-8, plus the following special characters: + - = . _ : / @.

Important: If you use tags as part of your security strategy, then adding or removing a tag can change permissions. If successfully completing this operation would result in you losing your permissions for this secret, then the operation is blocked and returns an Access Denied error.

Minimum permissions

To run this command, you must have the following permissions:

  • secretsmanager:TagResource

Related operations

  • To remove one or more tags from the collection attached to a secret, use UntagResource .
  • To view the list of tags attached to a secret, use DescribeSecret .

Synopsis

Creating a Request

tagResource Source #

Arguments

:: Text

trSecretId

-> 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:

  • trSecretId - The identifier for the secret that you want to attach tags to. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
  • trTags - The tags to attach to the secret. Each element in the list consists of a Key and a Value . This parameter to the API requires a JSON text string argument. For information on how to format a JSON parameter for the various command line tool environments, see Using JSON for Parameters in the AWS CLI User Guide . For the AWS CLI, you can also use the syntax: --Tags Key=Key1,Value=Value1,Key=Key2,Value=Value2[,…]

data TagResource Source #

See: tagResource smart constructor.

Instances

Eq TagResource Source # 
Data TagResource Source # 

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 Source # 
Show TagResource Source # 
Generic TagResource Source # 

Associated Types

type Rep TagResource :: * -> * #

Hashable TagResource Source # 
ToJSON TagResource Source # 
NFData TagResource Source # 

Methods

rnf :: TagResource -> () #

AWSRequest TagResource Source # 
ToHeaders TagResource Source # 

Methods

toHeaders :: TagResource -> [Header] #

ToPath TagResource Source # 
ToQuery TagResource Source # 
type Rep TagResource Source # 
type Rep TagResource = D1 * (MetaData "TagResource" "Network.AWS.SecretsManager.TagResource" "amazonka-secretsmanager-1.6.0-K7nD2j5oEj0GsgMw0kPUxD" False) (C1 * (MetaCons "TagResource'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_trSecretId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "_trTags") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * [Tag]))))
type Rs TagResource Source # 

Request Lenses

trSecretId :: Lens' TagResource Text Source #

The identifier for the secret that you want to attach tags to. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

trTags :: Lens' TagResource [Tag] Source #

The tags to attach to the secret. Each element in the list consists of a Key and a Value . This parameter to the API requires a JSON text string argument. For information on how to format a JSON parameter for the various command line tool environments, see Using JSON for Parameters in the AWS CLI User Guide . For the AWS CLI, you can also use the syntax: --Tags Key=Key1,Value=Value1,Key=Key2,Value=Value2[,…]

Destructuring the Response

tagResourceResponse :: TagResourceResponse Source #

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

data TagResourceResponse Source #

See: tagResourceResponse smart constructor.

Instances

Eq TagResourceResponse Source # 
Data TagResourceResponse Source # 

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 Source # 
Show TagResourceResponse Source # 
Generic TagResourceResponse Source # 
NFData TagResourceResponse Source # 

Methods

rnf :: TagResourceResponse -> () #

type Rep TagResourceResponse Source # 
type Rep TagResourceResponse = D1 * (MetaData "TagResourceResponse" "Network.AWS.SecretsManager.TagResource" "amazonka-secretsmanager-1.6.0-K7nD2j5oEj0GsgMw0kPUxD" False) (C1 * (MetaCons "TagResourceResponse'" PrefixI False) (U1 *))