aws-sdk-secretsmanager 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0510b3d9111db1b546af3dcf7759a4fbc38eb1ae
4
+ data.tar.gz: 341d393d43faa1bdf7d01997b996fa5a91b3bdf7
5
+ SHA512:
6
+ metadata.gz: 92735d664f25841b1a9835c8e5b20d31153329a689bc4fc1e4c9040bfbdaf8e6d488a101fc96bb7d3568d8a2def294d65e3291cd2671fd7bab033856a9980ed1
7
+ data.tar.gz: f4cc5b8798f92a38e0563d0da60e2ab1344828e5204fa32524f57083a371e7799b6d3d1b6fd024729ffc441897418dd49b6eabce66a43cd0c3f067c5fbc192d3
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-secretsmanager/types'
12
+ require_relative 'aws-sdk-secretsmanager/client_api'
13
+ require_relative 'aws-sdk-secretsmanager/client'
14
+ require_relative 'aws-sdk-secretsmanager/errors'
15
+ require_relative 'aws-sdk-secretsmanager/resource'
16
+ require_relative 'aws-sdk-secretsmanager/customizations'
17
+
18
+ # This module provides support for AWS Secrets Manager. This module is available in the
19
+ # `aws-sdk-secretsmanager` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from AWS Secrets Manager all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::SecretsManager::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::SecretsManager
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,1937 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
22
+ require 'aws-sdk-core/plugins/signature_v4.rb'
23
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
24
+
25
+ Aws::Plugins::GlobalConfiguration.add_identifier(:secretsmanager)
26
+
27
+ module Aws::SecretsManager
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :secretsmanager
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::JsonvalueConverter)
50
+ add_plugin(Aws::Plugins::SignatureV4)
51
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
52
+
53
+ # @option options [required, Aws::CredentialProvider] :credentials
54
+ # Your AWS credentials. This can be an instance of any one of the
55
+ # following classes:
56
+ #
57
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
58
+ # credentials.
59
+ #
60
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
61
+ # from an EC2 IMDS on an EC2 instance.
62
+ #
63
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
64
+ # shared file, such as `~/.aws/config`.
65
+ #
66
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
67
+ #
68
+ # When `:credentials` are not configured directly, the following
69
+ # locations will be searched for credentials:
70
+ #
71
+ # * `Aws.config[:credentials]`
72
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
73
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
74
+ # * `~/.aws/credentials`
75
+ # * `~/.aws/config`
76
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
77
+ # very aggressive. Construct and pass an instance of
78
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
79
+ # timeouts.
80
+ #
81
+ # @option options [required, String] :region
82
+ # The AWS region to connect to. The configured `:region` is
83
+ # used to determine the service `:endpoint`. When not passed,
84
+ # a default `:region` is search for in the following locations:
85
+ #
86
+ # * `Aws.config[:region]`
87
+ # * `ENV['AWS_REGION']`
88
+ # * `ENV['AMAZON_REGION']`
89
+ # * `ENV['AWS_DEFAULT_REGION']`
90
+ # * `~/.aws/credentials`
91
+ # * `~/.aws/config`
92
+ #
93
+ # @option options [String] :access_key_id
94
+ #
95
+ # @option options [Boolean] :convert_params (true)
96
+ # When `true`, an attempt is made to coerce request parameters into
97
+ # the required types.
98
+ #
99
+ # @option options [String] :endpoint
100
+ # The client endpoint is normally constructed from the `:region`
101
+ # option. You should only configure an `:endpoint` when connecting
102
+ # to test endpoints. This should be avalid HTTP(S) URI.
103
+ #
104
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
105
+ # The log formatter.
106
+ #
107
+ # @option options [Symbol] :log_level (:info)
108
+ # The log level to send messages to the `:logger` at.
109
+ #
110
+ # @option options [Logger] :logger
111
+ # The Logger instance to send log messages to. If this option
112
+ # is not set, logging will be disabled.
113
+ #
114
+ # @option options [String] :profile ("default")
115
+ # Used when loading credentials from the shared credentials file
116
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
117
+ #
118
+ # @option options [Integer] :retry_limit (3)
119
+ # The maximum number of times to retry failed requests. Only
120
+ # ~ 500 level server errors and certain ~ 400 level client errors
121
+ # are retried. Generally, these are throttling errors, data
122
+ # checksum errors, networking errors, timeout errors and auth
123
+ # errors from expired credentials.
124
+ #
125
+ # @option options [String] :secret_access_key
126
+ #
127
+ # @option options [String] :session_token
128
+ #
129
+ # @option options [Boolean] :simple_json (false)
130
+ # Disables request parameter conversion, validation, and formatting.
131
+ # Also disable response data type conversions. This option is useful
132
+ # when you want to ensure the highest level of performance by
133
+ # avoiding overhead of walking request parameters and response data
134
+ # structures.
135
+ #
136
+ # When `:simple_json` is enabled, the request parameters hash must
137
+ # be formatted exactly as the DynamoDB API expects.
138
+ #
139
+ # @option options [Boolean] :stub_responses (false)
140
+ # Causes the client to return stubbed responses. By default
141
+ # fake responses are generated and returned. You can specify
142
+ # the response data to return or errors to raise by calling
143
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
144
+ #
145
+ # ** Please note ** When response stubbing is enabled, no HTTP
146
+ # requests are made, and retries are disabled.
147
+ #
148
+ # @option options [Boolean] :validate_params (true)
149
+ # When `true`, request parameters are validated before
150
+ # sending the request.
151
+ #
152
+ def initialize(*args)
153
+ super
154
+ end
155
+
156
+ # @!group API Operations
157
+
158
+ # Disables automatic scheduled rotation and cancels the rotation of a
159
+ # secret if one is currently in progress.
160
+ #
161
+ # To re-enable scheduled rotation, call RotateSecret with
162
+ # `AutomaticallyRotateAfterDays` set to a value greater than 0. This
163
+ # will immediately rotate your secret and then enable the automatic
164
+ # schedule.
165
+ #
166
+ # <note markdown="1"> If you cancel a rotation that is in progress, it can leave the
167
+ # `VersionStage` labels in an unexpected state. Depending on what step
168
+ # of the rotation was in progress, you might need to remove the staging
169
+ # label `AWSPENDING` from the partially created version, specified by
170
+ # the `SecretVersionId` response value. You should also evaluate the
171
+ # partially rotated new version to see if it should be deleted, which
172
+ # you can do by removing all staging labels from the new version's
173
+ # `VersionStage` field.
174
+ #
175
+ # </note>
176
+ #
177
+ # To successfully start a rotation, the staging label `AWSPENDING` must
178
+ # be in one of the following states:
179
+ #
180
+ # * Not be attached to any version at all
181
+ #
182
+ # * Attached to the same version as the staging label `AWSCURRENT`
183
+ #
184
+ # If the staging label `AWSPENDING` is attached to a different version
185
+ # than the version with `AWSCURRENT` then the attempt to rotate fails.
186
+ #
187
+ # **Minimum permissions**
188
+ #
189
+ # To run this command, you must have the following permissions:
190
+ #
191
+ # * secretsmanager:CancelRotateSecret
192
+ #
193
+ # ^
194
+ #
195
+ # **Related operations**
196
+ #
197
+ # * To configure rotation for a secret or to manually trigger a
198
+ # rotation, use RotateSecret.
199
+ #
200
+ # * To get the rotation configuration details for a secret, use
201
+ # DescribeSecret.
202
+ #
203
+ # * To list all of the currently available secrets, use ListSecrets.
204
+ #
205
+ # * To list all of the versions currently associated with a secret, use
206
+ # ListSecretVersionIds.
207
+ #
208
+ # @option params [required, String] :secret_id
209
+ # Specifies the secret for which you want to cancel a rotation request.
210
+ # You can specify either the Amazon Resource Name (ARN) or the friendly
211
+ # name of the secret.
212
+ #
213
+ # @return [Types::CancelRotateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
214
+ #
215
+ # * {Types::CancelRotateSecretResponse#arn #arn} => String
216
+ # * {Types::CancelRotateSecretResponse#name #name} => String
217
+ # * {Types::CancelRotateSecretResponse#version_id #version_id} => String
218
+ #
219
+ # @example Request syntax with placeholder values
220
+ #
221
+ # resp = client.cancel_rotate_secret({
222
+ # secret_id: "SecretIdType", # required
223
+ # })
224
+ #
225
+ # @example Response structure
226
+ #
227
+ # resp.arn #=> String
228
+ # resp.name #=> String
229
+ # resp.version_id #=> String
230
+ #
231
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/CancelRotateSecret AWS API Documentation
232
+ #
233
+ # @overload cancel_rotate_secret(params = {})
234
+ # @param [Hash] params ({})
235
+ def cancel_rotate_secret(params = {}, options = {})
236
+ req = build_request(:cancel_rotate_secret, params)
237
+ req.send_request(options)
238
+ end
239
+
240
+ # Creates a new secret. A secret in AWS Secrets Manager consists of both
241
+ # the protected secret data and the important information needed to
242
+ # manage the secret.
243
+ #
244
+ # Secrets Manager stores the encrypted secret data in one of a
245
+ # collection of "versions" associated with the secret. Each version
246
+ # contains a copy of the encrypted secret data. Each version is
247
+ # associated with one or more "staging labels" that identify where the
248
+ # version is in the rotation cycle. The `SecretVersionsToStages` field
249
+ # of the secret contains the mapping of staging labels to the active
250
+ # versions of the secret. Versions without a staging label are
251
+ # considered deprecated and are not included in the list.
252
+ #
253
+ # You provide the secret data to be encrypted by putting text in the
254
+ # `SecretString` parameter or binary data in the `SecretBinary`
255
+ # parameter. If you include `SecretString` or `SecretBinary` then
256
+ # Secrets Manager also creates an initial secret version and, if you
257
+ # don't supply a staging label, automatically maps the new version's
258
+ # ID to the staging label `AWSCURRENT`.
259
+ #
260
+ # * If you call an operation that needs to encrypt or decrypt the
261
+ # `SecretString` and `SecretBinary` for a secret in the same account
262
+ # as the calling user and that secret doesn't specify a KMS
263
+ # encryption key, AWS Secrets Manager uses the account's default AWS
264
+ # managed customer master key (CMK) with the alias
265
+ # `aws/secretsmanager`. If this key doesn't already exist in your
266
+ # account then AWS Secrets Manager creates it for you automatically.
267
+ # All users in the same AWS account automatically have access to use
268
+ # the default CMK. Note that if an AWS Secrets Manager API call
269
+ # results in AWS having to create the account's AWS-managed CMK, it
270
+ # can result in a one-time significant delay in returning the result.
271
+ #
272
+ # * If the secret is in a different AWS account from the credentials
273
+ # calling an API that requires encryption or decryption of the secret
274
+ # value then you must create and use a custom KMS CMK because you
275
+ # can't access the default CMK for the account using credentials from
276
+ # a different AWS account. Store the ARN of the CMK in the secret when
277
+ # you create the secret or when you update it by including it in the
278
+ # `KMSKeyId`. If you call an API that must encrypt or decrypt
279
+ # `SecretString` or `SecretBinary` using credentials from a different
280
+ # account then the KMS key policy must grant cross-account access to
281
+ # that other account's user or role.
282
+ #
283
+ # **Minimum permissions**
284
+ #
285
+ # To run this command, you must have the following permissions:
286
+ #
287
+ # * secretsmanager:CreateSecret
288
+ #
289
+ # * kms:GenerateDataKey - needed only if you use a customer-created KMS
290
+ # key to encrypt the secret. You do not need this permission to use
291
+ # the account's default AWS managed CMK for Secrets Manager.
292
+ #
293
+ # * kms:Encrypt - needed only if you use a customer-created KMS key to
294
+ # encrypt the secret. You do not need this permission to use the
295
+ # account's default AWS managed CMK for Secrets Manager.
296
+ #
297
+ # **Related operations**
298
+ #
299
+ # * To delete a secret, use DeleteSecret.
300
+ #
301
+ # * To modify an existing secret, use UpdateSecret.
302
+ #
303
+ # * To create a new version of a secret, use PutSecretValue.
304
+ #
305
+ # * To retrieve the encrypted secure string and secure binary values,
306
+ # use GetSecretValue.
307
+ #
308
+ # * To retrieve all other details for a secret, use DescribeSecret. This
309
+ # does not include the encrypted secure string and secure binary
310
+ # values.
311
+ #
312
+ # * To retrieve the list of secret versions associated with the current
313
+ # secret, use DescribeSecret and examine the `SecretVersionsToStages`
314
+ # response value.
315
+ #
316
+ # @option params [required, String] :name
317
+ # Specifies the friendly name of the new secret. The secret name can
318
+ # consist of uppercase letters, lowercase letters, digits, and any of
319
+ # the following characters: /\_+=.@-    Spaces are not permitted.
320
+ #
321
+ # @option params [String] :client_request_token
322
+ # (Optional) If you include `SecretString` or `SecretBinary`, then an
323
+ # initial version is created as part of the secret, and this parameter
324
+ # specifies a unique identifier for the new version.
325
+ #
326
+ # <note markdown="1"> If you use the AWS CLI or one of the AWS SDK to call this operation,
327
+ # then you can leave this parameter empty. The CLI or SDK generates a
328
+ # random UUID for you and includes as the value for this parameter in
329
+ # the request. If you don't use the SDK and instead generate a raw HTTP
330
+ # request to the AWS Secrets Manager service endpoint, then you must
331
+ # generate a `ClientRequestToken` yourself for the new version and
332
+ # include that value in the request.
333
+ #
334
+ # </note>
335
+ #
336
+ # This value helps ensure idempotency. Secrets Manager uses this value
337
+ # to prevent the accidental creation of duplicate versions if there are
338
+ # failures and retries during a rotation. We recommend that you generate
339
+ # a [UUID-type][1] value to ensure uniqueness of your versions within
340
+ # the specified secret.
341
+ #
342
+ # * If the `ClientRequestToken` value isn't already associated with a
343
+ # version of the secret then a new version of the secret is created.
344
+ #
345
+ # * If a version with this value already exists and that version's
346
+ # `SecretString` and `SecretBinary` values are the same as those in
347
+ # the request, then the request is ignored (the operation is
348
+ # idempotent).
349
+ #
350
+ # * If a version with this value already exists and that version's
351
+ # `SecretString` and `SecretBinary` values are different from those in
352
+ # the request then the request fails because you cannot modify an
353
+ # existing version. Instead, use PutSecretValue to create a new
354
+ # version.
355
+ #
356
+ # This value becomes the `SecretVersionId` of the new version.
357
+ #
358
+ # **A suitable default value is auto-generated.** You should normally
359
+ # not need to pass this option.**
360
+ #
361
+ #
362
+ #
363
+ # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
364
+ #
365
+ # @option params [String] :description
366
+ # (Optional) Specifies a user-provided description of the secret.
367
+ #
368
+ # @option params [String] :kms_key_id
369
+ # (Optional) Specifies the ARN or alias of the AWS KMS customer master
370
+ # key (CMK) to be used to encrypt the `SecretString` and `SecretBinary`
371
+ # values in the versions stored in this secret.
372
+ #
373
+ # If you don't specify this value, then Secrets Manager defaults to
374
+ # using the AWS account's default CMK (the one named
375
+ # `aws/secretsmanager`). If a KMS CMK with that name doesn't yet exist,
376
+ # then AWS Secrets Manager creates it for you automatically the first
377
+ # time it needs to encrypt a version's `SecretString` or `SecretBinary`
378
+ # fields.
379
+ #
380
+ # You can use the account's default CMK to encrypt and decrypt only if
381
+ # you call this operation using credentials from the same account that
382
+ # owns the secret. If the secret is in a different account, then you
383
+ # must create a custom CMK and specify the ARN in this field.
384
+ #
385
+ # @option params [String, IO] :secret_binary
386
+ # (Optional) Specifies binary data that you want to encrypt and store in
387
+ # the new version of the secret. To use this parameter in the
388
+ # command-line tools, we recommend that you store your binary data in a
389
+ # file and then use the appropriate technique for your tool to pass the
390
+ # contents of the file as a parameter.
391
+ #
392
+ # Either `SecretString`, `SecretBinary`, or both must have a value. They
393
+ # cannot both be empty.
394
+ #
395
+ # This `SecretBinary` value is stored separately from the
396
+ # `SecretString`, but the two parameters jointly share a maximum size
397
+ # limit.
398
+ #
399
+ # This parameter is not available using the Secrets Manager console. It
400
+ # can be accessed only by using the AWS CLI or one of the AWS SDKs.
401
+ #
402
+ # @option params [String] :secret_string
403
+ # (Optional) Specifies text data that you want to encrypt and store in
404
+ # this new version of the secret.
405
+ #
406
+ # Either `SecretString`, `SecretBinary`, or both must have a value. They
407
+ # cannot both be empty.
408
+ #
409
+ # This string value is stored separately from the `SecretBinary`, but
410
+ # the two parameters jointly share a maximum size limit.
411
+ #
412
+ # If you create a secret by using the Secrets Manager console then
413
+ # Secrets Manager puts the protected secret text in only the
414
+ # `SecretString` parameter. The Secrets Manager console stores the
415
+ # information as a JSON structure of key/value pairs that the Lambda
416
+ # rotation function knows how to parse.
417
+ #
418
+ # For storing multiple values, we recommend that you use a JSON text
419
+ # string argument and specify key/value pairs. For information on how to
420
+ # format a JSON parameter for the various command line tool
421
+ # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
422
+ # Guide*. For example:
423
+ #
424
+ # `[\{"Key":"username","Value":"bob"\},\{"Key":"password","Value":"abc123xyz456"\}]`
425
+ #
426
+ # If your command-line tool or SDK requires quotation marks around the
427
+ # parameter, you should use single quotes to avoid confusion with the
428
+ # double quotes required in the JSON text.
429
+ #
430
+ #
431
+ #
432
+ # [1]: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
433
+ #
434
+ # @option params [Array<Types::Tag>] :tags
435
+ # (Optional) Specifies a list of user-defined tags that are attached to
436
+ # the secret. Each tag is a "Key" and "Value" pair of strings. This
437
+ # operation only appends tags to the existing list of tags. To remove
438
+ # tags, you must use UntagResource.
439
+ #
440
+ # * AWS Secrets Manager tag key names are case sensitive. A tag with the
441
+ # key "ABC" is a different tag from one with key "abc".
442
+ #
443
+ # * If you check tags in IAM policy `Condition` elements as part of your
444
+ # security strategy, then adding or removing a tag can change
445
+ # permissions. If the successful completion of this operation would
446
+ # result in you losing your permissions for this secret, then this
447
+ # operation is blocked and returns an `Access Denied` error.
448
+ #
449
+ # This parameter requires a JSON text string argument. For information
450
+ # on how to format a JSON parameter for the various command line tool
451
+ # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
452
+ # Guide*. For example:
453
+ #
454
+ # `[\{"Key":"CostCenter","Value":"12345"\},\{"Key":"environment","Value":"production"\}]`
455
+ #
456
+ # If your command-line tool or SDK requires quotation marks around the
457
+ # parameter, you should use single quotes to avoid confusion with the
458
+ # double quotes required in the JSON text.
459
+ #
460
+ # The following basic restrictions apply to tags:
461
+ #
462
+ # * Maximum number of tags per secret—50
463
+ #
464
+ # * Maximum key length—127 Unicode characters in UTF-8
465
+ #
466
+ # * Maximum value length—255 Unicode characters in UTF-8
467
+ #
468
+ # * Tag keys and values are case sensitive.
469
+ #
470
+ # * Do not use the `aws:` prefix in your tag names or values because it
471
+ # is reserved for AWS use. You can't edit or delete tag names or
472
+ # values with this prefix. Tags with this prefix do not count against
473
+ # your tags per secret limit.
474
+ #
475
+ # * If your tagging schema will be used across multiple services and
476
+ # resources, remember that other services might have restrictions on
477
+ # allowed characters. Generally allowed characters are: letters,
478
+ # spaces, and numbers representable in UTF-8, plus the following
479
+ # special characters: + - = . \_ : / @.
480
+ #
481
+ #
482
+ #
483
+ # [1]: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
484
+ #
485
+ # @return [Types::CreateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
486
+ #
487
+ # * {Types::CreateSecretResponse#arn #arn} => String
488
+ # * {Types::CreateSecretResponse#name #name} => String
489
+ # * {Types::CreateSecretResponse#version_id #version_id} => String
490
+ #
491
+ # @example Request syntax with placeholder values
492
+ #
493
+ # resp = client.create_secret({
494
+ # name: "NameType", # required
495
+ # client_request_token: "ClientRequestTokenType",
496
+ # description: "DescriptionType",
497
+ # kms_key_id: "KmsKeyIdType",
498
+ # secret_binary: "data",
499
+ # secret_string: "SecretStringType",
500
+ # tags: [
501
+ # {
502
+ # key: "TagKeyType",
503
+ # value: "TagValueType",
504
+ # },
505
+ # ],
506
+ # })
507
+ #
508
+ # @example Response structure
509
+ #
510
+ # resp.arn #=> String
511
+ # resp.name #=> String
512
+ # resp.version_id #=> String
513
+ #
514
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/CreateSecret AWS API Documentation
515
+ #
516
+ # @overload create_secret(params = {})
517
+ # @param [Hash] params ({})
518
+ def create_secret(params = {}, options = {})
519
+ req = build_request(:create_secret, params)
520
+ req.send_request(options)
521
+ end
522
+
523
+ # Deletes an entire secret and all of its versions. You can optionally
524
+ # include a recovery window during which you can restore the secret. If
525
+ # you don't provide a recovery window value, the operation defaults to
526
+ # 30 days. Secrets Manager attaches a `DeletionDate` stamp to the secret
527
+ # that specifies the end of the recovery window. At the end of the
528
+ # recovery window, Secrets Manager deletes the secret permanently.
529
+ #
530
+ # At any time before recovery period ends, you can use RestoreSecret to
531
+ # remove the `DeletionDate` and cancel the deletion of the secret.
532
+ #
533
+ # You cannot access the encrypted secret information in any secret that
534
+ # is scheduled for deletion. If you need to access that information, you
535
+ # can cancel the deletion with RestoreSecret and then retrieve the
536
+ # information.
537
+ #
538
+ # <note markdown="1"> * There is no explicit operation to delete a version of a secret.
539
+ # Instead, remove all staging labels from the `VersionStage` field of
540
+ # a version. That marks the version as deprecated and allows AWS
541
+ # Secrets Manager to delete it as needed. Versions that do not have
542
+ # any staging labels do not show up in ListSecretVersionIds unless you
543
+ # specify `IncludeDeprecated`.
544
+ #
545
+ # * The permanent secret deletion at the end of the waiting period is
546
+ # performed as a background task with low priority. There is no
547
+ # guarantee of a specific time after the recovery window for the
548
+ # actual delete operation to occur.
549
+ #
550
+ # </note>
551
+ #
552
+ # **Minimum permissions**
553
+ #
554
+ # To run this command, you must have the following permissions:
555
+ #
556
+ # * secretsmanager:DeleteSecret
557
+ #
558
+ # ^
559
+ #
560
+ # **Related operations**
561
+ #
562
+ # * To create a secret, use CreateSecret.
563
+ #
564
+ # * To cancel deletion of a version of a secret before the recovery
565
+ # period has expired, use RestoreSecret.
566
+ #
567
+ # @option params [required, String] :secret_id
568
+ # Specifies the secret that you want to delete. You can specify either
569
+ # the Amazon Resource Name (ARN) or the friendly name of the secret.
570
+ #
571
+ # @option params [Integer] :recovery_window_in_days
572
+ # (Optional) Specifies the number of days that AWS Secrets Manager waits
573
+ # before it can delete the secret.
574
+ #
575
+ # This value can range from 7 to 30 days. The default value is 30.
576
+ #
577
+ # @return [Types::DeleteSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
578
+ #
579
+ # * {Types::DeleteSecretResponse#arn #arn} => String
580
+ # * {Types::DeleteSecretResponse#name #name} => String
581
+ # * {Types::DeleteSecretResponse#deletion_date #deletion_date} => Time
582
+ #
583
+ # @example Request syntax with placeholder values
584
+ #
585
+ # resp = client.delete_secret({
586
+ # secret_id: "SecretIdType", # required
587
+ # recovery_window_in_days: 1,
588
+ # })
589
+ #
590
+ # @example Response structure
591
+ #
592
+ # resp.arn #=> String
593
+ # resp.name #=> String
594
+ # resp.deletion_date #=> Time
595
+ #
596
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/DeleteSecret AWS API Documentation
597
+ #
598
+ # @overload delete_secret(params = {})
599
+ # @param [Hash] params ({})
600
+ def delete_secret(params = {}, options = {})
601
+ req = build_request(:delete_secret, params)
602
+ req.send_request(options)
603
+ end
604
+
605
+ # Retrieves the details of a secret. It does not include the encrypted
606
+ # fields. Only those fields that are populated with a value are returned
607
+ # in the response.
608
+ #
609
+ # **Minimum permissions**
610
+ #
611
+ # To run this command, you must have the following permissions:
612
+ #
613
+ # * secretsmanager:DescribeSecret
614
+ #
615
+ # ^
616
+ #
617
+ # **Related operations**
618
+ #
619
+ # * To create a secret, use CreateSecret.
620
+ #
621
+ # * To modify a secret, use UpdateSecret.
622
+ #
623
+ # * To retrieve the encrypted secret information in a version of the
624
+ # secret, use GetSecretValue.
625
+ #
626
+ # * To list all of the secrets in the AWS account, use ListSecrets.
627
+ #
628
+ # @option params [required, String] :secret_id
629
+ # The identifier of the secret whose details you want to retrieve. You
630
+ # can specify either the Amazon Resource Name (ARN) or the friendly name
631
+ # of the secret.
632
+ #
633
+ # @return [Types::DescribeSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
634
+ #
635
+ # * {Types::DescribeSecretResponse#arn #arn} => String
636
+ # * {Types::DescribeSecretResponse#name #name} => String
637
+ # * {Types::DescribeSecretResponse#description #description} => String
638
+ # * {Types::DescribeSecretResponse#kms_key_id #kms_key_id} => String
639
+ # * {Types::DescribeSecretResponse#rotation_enabled #rotation_enabled} => Boolean
640
+ # * {Types::DescribeSecretResponse#rotation_lambda_arn #rotation_lambda_arn} => String
641
+ # * {Types::DescribeSecretResponse#rotation_rules #rotation_rules} => Types::RotationRulesType
642
+ # * {Types::DescribeSecretResponse#last_rotated_date #last_rotated_date} => Time
643
+ # * {Types::DescribeSecretResponse#last_changed_date #last_changed_date} => Time
644
+ # * {Types::DescribeSecretResponse#last_accessed_date #last_accessed_date} => Time
645
+ # * {Types::DescribeSecretResponse#deleted_date #deleted_date} => Time
646
+ # * {Types::DescribeSecretResponse#tags #tags} => Array&lt;Types::Tag&gt;
647
+ # * {Types::DescribeSecretResponse#version_ids_to_stages #version_ids_to_stages} => Hash&lt;String,Array&lt;String&gt;&gt;
648
+ #
649
+ # @example Request syntax with placeholder values
650
+ #
651
+ # resp = client.describe_secret({
652
+ # secret_id: "SecretIdType", # required
653
+ # })
654
+ #
655
+ # @example Response structure
656
+ #
657
+ # resp.arn #=> String
658
+ # resp.name #=> String
659
+ # resp.description #=> String
660
+ # resp.kms_key_id #=> String
661
+ # resp.rotation_enabled #=> Boolean
662
+ # resp.rotation_lambda_arn #=> String
663
+ # resp.rotation_rules.automatically_after_days #=> Integer
664
+ # resp.last_rotated_date #=> Time
665
+ # resp.last_changed_date #=> Time
666
+ # resp.last_accessed_date #=> Time
667
+ # resp.deleted_date #=> Time
668
+ # resp.tags #=> Array
669
+ # resp.tags[0].key #=> String
670
+ # resp.tags[0].value #=> String
671
+ # resp.version_ids_to_stages #=> Hash
672
+ # resp.version_ids_to_stages["SecretVersionIdType"] #=> Array
673
+ # resp.version_ids_to_stages["SecretVersionIdType"][0] #=> String
674
+ #
675
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/DescribeSecret AWS API Documentation
676
+ #
677
+ # @overload describe_secret(params = {})
678
+ # @param [Hash] params ({})
679
+ def describe_secret(params = {}, options = {})
680
+ req = build_request(:describe_secret, params)
681
+ req.send_request(options)
682
+ end
683
+
684
+ # Generates a random password of the specified complexity. This
685
+ # operation is intended for use in the Lambda rotation function. Per
686
+ # best practice, we recommend that you specify the maximum length and
687
+ # include every character type that the system you are generating a
688
+ # password for can support.
689
+ #
690
+ # **Minimum permissions**
691
+ #
692
+ # To run this command, you must have the following permissions:
693
+ #
694
+ # * secretsmanager:GetRandomPassword
695
+ #
696
+ # ^
697
+ #
698
+ # @option params [Integer] :password_length
699
+ # The desired length of the generated password. The default value if you
700
+ # do not include this parameter is 32 characters.
701
+ #
702
+ # @option params [String] :exclude_characters
703
+ # A string that includes characters that should not be included in the
704
+ # generated password. The default is that all characters from the
705
+ # included sets can be used.
706
+ #
707
+ # @option params [Boolean] :exclude_numbers
708
+ # Specifies that the generated password should not include digits. The
709
+ # default if you do not include this switch parameter is that digits can
710
+ # be included.
711
+ #
712
+ # @option params [Boolean] :exclude_punctuation
713
+ # Specifies that the generated password should not include punctuation
714
+ # characters. The default if you do not include this switch parameter is
715
+ # that punctuation characters can be included.
716
+ #
717
+ # @option params [Boolean] :exclude_uppercase
718
+ # Specifies that the generated password should not include uppercase
719
+ # letters. The default if you do not include this switch parameter is
720
+ # that uppercase letters can be included.
721
+ #
722
+ # @option params [Boolean] :exclude_lowercase
723
+ # Specifies that the generated password should not include lowercase
724
+ # letters. The default if you do not include this switch parameter is
725
+ # that lowercase letters can be included.
726
+ #
727
+ # @option params [Boolean] :include_space
728
+ # Specifies that the generated password can include the space character.
729
+ # The default if you do not include this switch parameter is that the
730
+ # space character is not included.
731
+ #
732
+ # @option params [Boolean] :require_each_included_type
733
+ # A boolean value that specifies whether the generated password must
734
+ # include at least one of every allowed character type. The default
735
+ # value is `True` and the operation requires at least one of every
736
+ # character type.
737
+ #
738
+ # @return [Types::GetRandomPasswordResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
739
+ #
740
+ # * {Types::GetRandomPasswordResponse#random_password #random_password} => String
741
+ #
742
+ # @example Request syntax with placeholder values
743
+ #
744
+ # resp = client.get_random_password({
745
+ # password_length: 1,
746
+ # exclude_characters: "ExcludeCharactersType",
747
+ # exclude_numbers: false,
748
+ # exclude_punctuation: false,
749
+ # exclude_uppercase: false,
750
+ # exclude_lowercase: false,
751
+ # include_space: false,
752
+ # require_each_included_type: false,
753
+ # })
754
+ #
755
+ # @example Response structure
756
+ #
757
+ # resp.random_password #=> String
758
+ #
759
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/GetRandomPassword AWS API Documentation
760
+ #
761
+ # @overload get_random_password(params = {})
762
+ # @param [Hash] params ({})
763
+ def get_random_password(params = {}, options = {})
764
+ req = build_request(:get_random_password, params)
765
+ req.send_request(options)
766
+ end
767
+
768
+ # Retrieves the contents of the encrypted fields `SecretString` and
769
+ # `SecretBinary` from the specified version of a secret.
770
+ #
771
+ # **Minimum permissions**
772
+ #
773
+ # To run this command, you must have the following permissions:
774
+ #
775
+ # * secretsmanager:GetSecretValue
776
+ #
777
+ # * kms:Decrypt - required only if you use a customer-created KMS key to
778
+ # encrypt the secret. You do not need this permission to use the
779
+ # account's default AWS managed CMK for Secrets Manager.
780
+ #
781
+ # **Related operations**
782
+ #
783
+ # * To create a new version of the secret with different encrypted
784
+ # information, use PutSecretValue.
785
+ #
786
+ # * To retrieve the non-encrypted details for the secret, use
787
+ # DescribeSecret.
788
+ #
789
+ # @option params [required, String] :secret_id
790
+ # Specifies the secret containing the version that you want to retrieve.
791
+ # You can specify either the Amazon Resource Name (ARN) or the friendly
792
+ # name of the secret.
793
+ #
794
+ # @option params [String] :version_id
795
+ # Specifies the unique identifier of the version of the secret that you
796
+ # want to retrieve. If you specify this parameter then don't specify
797
+ # `VersionStage`. If you don't specify either a `VersionStage` or
798
+ # `SecretVersionId` then the default is to perform the operation on the
799
+ # version with the `VersionStage` value of `AWSCURRENT`.
800
+ #
801
+ # This value is typically a [UUID-type][1] value with 32 hexadecimal
802
+ # digits.
803
+ #
804
+ #
805
+ #
806
+ # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
807
+ #
808
+ # @option params [String] :version_stage
809
+ # Specifies the secret version that you want to retrieve by the staging
810
+ # label attached to the version.
811
+ #
812
+ # Staging labels are used to keep track of different versions during the
813
+ # rotation process. If you use this parameter then don't specify
814
+ # `SecretVersionId`. If you don't specify either a `VersionStage` or
815
+ # `SecretVersionId`, then the default is to perform the operation on the
816
+ # version with the `VersionStage` value of `AWSCURRENT`.
817
+ #
818
+ # @return [Types::GetSecretValueResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
819
+ #
820
+ # * {Types::GetSecretValueResponse#arn #arn} => String
821
+ # * {Types::GetSecretValueResponse#name #name} => String
822
+ # * {Types::GetSecretValueResponse#version_id #version_id} => String
823
+ # * {Types::GetSecretValueResponse#secret_binary #secret_binary} => String
824
+ # * {Types::GetSecretValueResponse#secret_string #secret_string} => String
825
+ # * {Types::GetSecretValueResponse#version_stages #version_stages} => Array&lt;String&gt;
826
+ # * {Types::GetSecretValueResponse#created_date #created_date} => Time
827
+ #
828
+ # @example Request syntax with placeholder values
829
+ #
830
+ # resp = client.get_secret_value({
831
+ # secret_id: "SecretIdType", # required
832
+ # version_id: "SecretVersionIdType",
833
+ # version_stage: "SecretVersionStageType",
834
+ # })
835
+ #
836
+ # @example Response structure
837
+ #
838
+ # resp.arn #=> String
839
+ # resp.name #=> String
840
+ # resp.version_id #=> String
841
+ # resp.secret_binary #=> String
842
+ # resp.secret_string #=> String
843
+ # resp.version_stages #=> Array
844
+ # resp.version_stages[0] #=> String
845
+ # resp.created_date #=> Time
846
+ #
847
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/GetSecretValue AWS API Documentation
848
+ #
849
+ # @overload get_secret_value(params = {})
850
+ # @param [Hash] params ({})
851
+ def get_secret_value(params = {}, options = {})
852
+ req = build_request(:get_secret_value, params)
853
+ req.send_request(options)
854
+ end
855
+
856
+ # Lists all of the versions attached to the specified secret. The output
857
+ # does not include the `SecretString` or `SecretBinary` fields. By
858
+ # default, the list includes only versions that have at least one
859
+ # staging label in `VersionStage` attached.
860
+ #
861
+ # <note markdown="1"> Always check the `NextToken` response parameter when calling any of
862
+ # the `List*` operations. These operations can occasionally return an
863
+ # empty or shorter than expected list of results even when there are
864
+ # more results available. When this happens, the `NextToken` response
865
+ # parameter contains a value to pass to the next call to the same API to
866
+ # request the next part of the list.
867
+ #
868
+ # </note>
869
+ #
870
+ # **Minimum permissions**
871
+ #
872
+ # To run this command, you must have the following permissions:
873
+ #
874
+ # * secretsmanager:ListSecretVersionIds
875
+ #
876
+ # ^
877
+ #
878
+ # **Related operations**
879
+ #
880
+ # * To list the secrets in an account, use ListSecrets.
881
+ #
882
+ # ^
883
+ #
884
+ # @option params [required, String] :secret_id
885
+ # The identifier for the secret containing the versions you want to
886
+ # list. You can specify either the Amazon Resource Name (ARN) or the
887
+ # friendly name of the secret.
888
+ #
889
+ # @option params [Integer] :max_results
890
+ # (Optional) Limits the number of results that you want to include in
891
+ # the response. If you don't include this parameter, it defaults to a
892
+ # value that's specific to the operation. If additional items exist
893
+ # beyond the maximum you specify, the `NextToken` response element is
894
+ # present and has a value (isn't null). Include that value as the
895
+ # `NextToken` request parameter in the next call to the operation to get
896
+ # the next part of the results. Note that AWS Secrets Manager might
897
+ # return fewer results than the maximum even when there are more results
898
+ # available. You should check `NextToken` after every operation to
899
+ # ensure that you receive all of the results.
900
+ #
901
+ # @option params [String] :next_token
902
+ # (Optional) Use this parameter in a request if you receive a
903
+ # `NextToken` response in a previous request that indicates that
904
+ # there's more output available. In a subsequent call, set it to the
905
+ # value of the previous call's `NextToken` response to indicate where
906
+ # the output should continue from.
907
+ #
908
+ # @option params [Boolean] :include_deprecated
909
+ # (Optional) Specifies that you want the results to include versions
910
+ # that do not have any staging labels attached to them. Such versions
911
+ # are considered deprecated and are subject to deletion by Secrets
912
+ # Manager as needed.
913
+ #
914
+ # @return [Types::ListSecretVersionIdsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
915
+ #
916
+ # * {Types::ListSecretVersionIdsResponse#versions #versions} => Array&lt;Types::SecretVersionsListEntry&gt;
917
+ # * {Types::ListSecretVersionIdsResponse#next_token #next_token} => String
918
+ # * {Types::ListSecretVersionIdsResponse#arn #arn} => String
919
+ # * {Types::ListSecretVersionIdsResponse#name #name} => String
920
+ #
921
+ # @example Request syntax with placeholder values
922
+ #
923
+ # resp = client.list_secret_version_ids({
924
+ # secret_id: "SecretIdType", # required
925
+ # max_results: 1,
926
+ # next_token: "NextTokenType",
927
+ # include_deprecated: false,
928
+ # })
929
+ #
930
+ # @example Response structure
931
+ #
932
+ # resp.versions #=> Array
933
+ # resp.versions[0].version_id #=> String
934
+ # resp.versions[0].version_stages #=> Array
935
+ # resp.versions[0].version_stages[0] #=> String
936
+ # resp.versions[0].last_accessed_date #=> Time
937
+ # resp.versions[0].created_date #=> Time
938
+ # resp.next_token #=> String
939
+ # resp.arn #=> String
940
+ # resp.name #=> String
941
+ #
942
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/ListSecretVersionIds AWS API Documentation
943
+ #
944
+ # @overload list_secret_version_ids(params = {})
945
+ # @param [Hash] params ({})
946
+ def list_secret_version_ids(params = {}, options = {})
947
+ req = build_request(:list_secret_version_ids, params)
948
+ req.send_request(options)
949
+ end
950
+
951
+ # Lists all of the secrets that are stored by AWS Secrets Manager in the
952
+ # AWS account. To list the versions currently stored for a specific
953
+ # secret, use ListSecretVersionIds. The encrypted fields `SecretString`
954
+ # and `SecretBinary` are not included in the output. To get that
955
+ # information, call the GetSecretValue operation.
956
+ #
957
+ # <note markdown="1"> Always check the `NextToken` response parameter when calling any of
958
+ # the `List*` operations. These operations can occasionally return an
959
+ # empty or shorter than expected list of results even when there are
960
+ # more results available. When this happens, the `NextToken` response
961
+ # parameter contains a value to pass to the next call to the same API to
962
+ # request the next part of the list.
963
+ #
964
+ # </note>
965
+ #
966
+ # **Minimum permissions**
967
+ #
968
+ # To run this command, you must have the following permissions:
969
+ #
970
+ # * secretsmanager:ListSecrets
971
+ #
972
+ # ^
973
+ #
974
+ # **Related operations**
975
+ #
976
+ # * To list the versions attached to a secret, use ListSecretVersionIds.
977
+ #
978
+ # ^
979
+ #
980
+ # @option params [Integer] :max_results
981
+ # (Optional) Limits the number of results that you want to include in
982
+ # the response. If you don't include this parameter, it defaults to a
983
+ # value that's specific to the operation. If additional items exist
984
+ # beyond the maximum you specify, the `NextToken` response element is
985
+ # present and has a value (isn't null). Include that value as the
986
+ # `NextToken` request parameter in the next call to the operation to get
987
+ # the next part of the results. Note that AWS Secrets Manager might
988
+ # return fewer results than the maximum even when there are more results
989
+ # available. You should check `NextToken` after every operation to
990
+ # ensure that you receive all of the results.
991
+ #
992
+ # @option params [String] :next_token
993
+ # (Optional) Use this parameter in a request if you receive a
994
+ # `NextToken` response in a previous request that indicates that
995
+ # there's more output available. In a subsequent call, set it to the
996
+ # value of the previous call's `NextToken` response to indicate where
997
+ # the output should continue from.
998
+ #
999
+ # @return [Types::ListSecretsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1000
+ #
1001
+ # * {Types::ListSecretsResponse#secret_list #secret_list} => Array&lt;Types::SecretListEntry&gt;
1002
+ # * {Types::ListSecretsResponse#next_token #next_token} => String
1003
+ #
1004
+ # @example Request syntax with placeholder values
1005
+ #
1006
+ # resp = client.list_secrets({
1007
+ # max_results: 1,
1008
+ # next_token: "NextTokenType",
1009
+ # })
1010
+ #
1011
+ # @example Response structure
1012
+ #
1013
+ # resp.secret_list #=> Array
1014
+ # resp.secret_list[0].arn #=> String
1015
+ # resp.secret_list[0].name #=> String
1016
+ # resp.secret_list[0].description #=> String
1017
+ # resp.secret_list[0].kms_key_id #=> String
1018
+ # resp.secret_list[0].rotation_enabled #=> Boolean
1019
+ # resp.secret_list[0].rotation_lambda_arn #=> String
1020
+ # resp.secret_list[0].rotation_rules.automatically_after_days #=> Integer
1021
+ # resp.secret_list[0].last_rotated_date #=> Time
1022
+ # resp.secret_list[0].last_changed_date #=> Time
1023
+ # resp.secret_list[0].last_accessed_date #=> Time
1024
+ # resp.secret_list[0].deleted_date #=> Time
1025
+ # resp.secret_list[0].tags #=> Array
1026
+ # resp.secret_list[0].tags[0].key #=> String
1027
+ # resp.secret_list[0].tags[0].value #=> String
1028
+ # resp.secret_list[0].secret_versions_to_stages #=> Hash
1029
+ # resp.secret_list[0].secret_versions_to_stages["SecretVersionIdType"] #=> Array
1030
+ # resp.secret_list[0].secret_versions_to_stages["SecretVersionIdType"][0] #=> String
1031
+ # resp.next_token #=> String
1032
+ #
1033
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/ListSecrets AWS API Documentation
1034
+ #
1035
+ # @overload list_secrets(params = {})
1036
+ # @param [Hash] params ({})
1037
+ def list_secrets(params = {}, options = {})
1038
+ req = build_request(:list_secrets, params)
1039
+ req.send_request(options)
1040
+ end
1041
+
1042
+ # Stores a new encrypted secret value in the specified secret. To do
1043
+ # this, the operation creates a new version and attaches it to the
1044
+ # secret. The version can contain a new `SecretString` value or a new
1045
+ # `SecretBinary` value.
1046
+ #
1047
+ # <note markdown="1"> The AWS Secrets Manager console uses only the `SecretString` field. To
1048
+ # add binary data to a secret with the `SecretBinary` field you must use
1049
+ # the AWS CLI or one of the AWS SDKs.
1050
+ #
1051
+ # </note>
1052
+ #
1053
+ # * If this operation creates the first version for the secret then
1054
+ # Secrets Manager automatically attaches the staging label
1055
+ # `AWSCURRENT` to the new version.
1056
+ #
1057
+ # * If another version of this secret already exists, then this
1058
+ # operation does not automatically move any staging labels other than
1059
+ # those that you specify in the `VersionStages` parameter.
1060
+ #
1061
+ # * This operation is idempotent. If a version with a `SecretVersionId`
1062
+ # with the same value as the `ClientRequestToken` parameter already
1063
+ # exists and you specify the same secret data, the operation succeeds
1064
+ # but does nothing. However, if the secret data is different, then the
1065
+ # operation fails because you cannot modify an existing version; you
1066
+ # can only create new ones.
1067
+ #
1068
+ # * If this operation moves the staging label `AWSCURRENT` to this
1069
+ # version (because you included it in the `StagingLabels` parameter)
1070
+ # then Secrets Manager also automatically moves the staging label
1071
+ # `AWSPREVIOUS` to the version that `AWSCURRENT` was removed from.
1072
+ #
1073
+ # * If you call an operation that needs to encrypt or decrypt the
1074
+ # `SecretString` and `SecretBinary` for a secret in the same account
1075
+ # as the calling user and that secret doesn't specify a KMS
1076
+ # encryption key, AWS Secrets Manager uses the account's default AWS
1077
+ # managed customer master key (CMK) with the alias
1078
+ # `aws/secretsmanager`. If this key doesn't already exist in your
1079
+ # account then AWS Secrets Manager creates it for you automatically.
1080
+ # All users in the same AWS account automatically have access to use
1081
+ # the default CMK. Note that if an AWS Secrets Manager API call
1082
+ # results in AWS having to create the account's AWS-managed CMK, it
1083
+ # can result in a one-time significant delay in returning the result.
1084
+ #
1085
+ # * If the secret is in a different AWS account from the credentials
1086
+ # calling an API that requires encryption or decryption of the secret
1087
+ # value then you must create and use a custom KMS CMK because you
1088
+ # can't access the default CMK for the account using credentials from
1089
+ # a different AWS account. Store the ARN of the CMK in the secret when
1090
+ # you create the secret or when you update it by including it in the
1091
+ # `KMSKeyId`. If you call an API that must encrypt or decrypt
1092
+ # `SecretString` or `SecretBinary` using credentials from a different
1093
+ # account then the KMS key policy must grant cross-account access to
1094
+ # that other account's user or role.
1095
+ #
1096
+ # **Minimum permissions**
1097
+ #
1098
+ # To run this command, you must have the following permissions:
1099
+ #
1100
+ # * secretsmanager:PutSecretValue
1101
+ #
1102
+ # * kms:GenerateDataKey - needed only if you use a customer-created KMS
1103
+ # key to encrypt the secret. You do not need this permission to use
1104
+ # the account's AWS managed CMK for Secrets Manager.
1105
+ #
1106
+ # * kms:Encrypt - needed only if you use a customer-created KMS key to
1107
+ # encrypt the secret. You do not need this permission to use the
1108
+ # account's AWS managed CMK for Secrets Manager.
1109
+ #
1110
+ # **Related operations**
1111
+ #
1112
+ # * To retrieve the encrypted value you store in the version of a
1113
+ # secret, use GetSecretValue.
1114
+ #
1115
+ # * To create a secret, use CreateSecret.
1116
+ #
1117
+ # * To get the details for a secret, use DescribeSecret.
1118
+ #
1119
+ # * To list the versions attached to a secret, use ListSecretVersionIds.
1120
+ #
1121
+ # @option params [required, String] :secret_id
1122
+ # Specifies the secret to which you want to add a new version. You can
1123
+ # specify either the Amazon Resource Name (ARN) or the friendly name of
1124
+ # the secret. The secret must already exist.
1125
+ #
1126
+ # The secret name can consist of uppercase letters, lowercase letters,
1127
+ # digits, and any of the following characters: /\_+=.@-    Spaces are
1128
+ # not permitted.
1129
+ #
1130
+ # @option params [String] :client_request_token
1131
+ # (Optional) Specifies a unique identifier for the new version of the
1132
+ # secret.
1133
+ #
1134
+ # <note markdown="1"> If you use the AWS CLI or one of the AWS SDK to call this operation,
1135
+ # then you can leave this parameter empty. The CLI or SDK generates a
1136
+ # random UUID for you and includes that in the request. If you don't
1137
+ # use the SDK and instead generate a raw HTTP request to the AWS Secrets
1138
+ # Manager service endpoint, then you must generate a
1139
+ # `ClientRequestToken` yourself for new versions and include that value
1140
+ # in the request.
1141
+ #
1142
+ # </note>
1143
+ #
1144
+ # This value helps ensure idempotency. Secrets Manager uses this value
1145
+ # to prevent the accidental creation of duplicate versions if there are
1146
+ # failures and retries during the Lambda rotation function's
1147
+ # processing. We recommend that you generate a [UUID-type][1] value to
1148
+ # ensure uniqueness within the specified secret.
1149
+ #
1150
+ # * If the `ClientRequestToken` value isn't already associated with a
1151
+ # version of the secret then a new version of the secret is created.
1152
+ #
1153
+ # * If a version with this value already exists and that version's
1154
+ # `SecretString` or `SecretBinary` values are the same as those in the
1155
+ # request then the request is ignored (the operation is idempotent).
1156
+ #
1157
+ # * If a version with this value already exists and that version's
1158
+ # `SecretString` and `SecretBinary` values are different from those in
1159
+ # the request then the request fails because you cannot modify an
1160
+ # existing secret version. You can only create new versions to store
1161
+ # new secret values.
1162
+ #
1163
+ # This value becomes the `SecretVersionId` of the new version.
1164
+ #
1165
+ # **A suitable default value is auto-generated.** You should normally
1166
+ # not need to pass this option.**
1167
+ #
1168
+ #
1169
+ #
1170
+ # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
1171
+ #
1172
+ # @option params [String, IO] :secret_binary
1173
+ # (Optional) Specifies binary data that you want to encrypt and store in
1174
+ # the new version of the secret. To use this parameter in the
1175
+ # command-line tools, we recommend that you store your binary data in a
1176
+ # file and then use the appropriate technique for your tool to pass the
1177
+ # contents of the file as a parameter. Either `SecretBinary` or
1178
+ # `SecretString` must have a value. They cannot both be empty.
1179
+ #
1180
+ # This parameter is not accessible if the secret using the Secrets
1181
+ # Manager console.
1182
+ #
1183
+ # @option params [String] :secret_string
1184
+ # (Optional) Specifies text data that you want to encrypt and store in
1185
+ # this new version of the secret. Either `SecretString` or
1186
+ # `SecretBinary` must have a value. They cannot both be empty.
1187
+ #
1188
+ # If you create this secret by using the Secrets Manager console then
1189
+ # Secrets Manager puts the protected secret text in only the
1190
+ # `SecretString` parameter. The Secrets Manager console stores the
1191
+ # information as a JSON structure of key/value pairs that the default
1192
+ # Lambda rotation function knows how to parse.
1193
+ #
1194
+ # For storing multiple values, we recommend that you use a JSON text
1195
+ # string argument and specify key/value pairs. For information on how to
1196
+ # format a JSON parameter for the various command line tool
1197
+ # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
1198
+ # Guide*.
1199
+ #
1200
+ #
1201
+ #
1202
+ # [1]: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
1203
+ #
1204
+ # @option params [Array<String>] :version_stages
1205
+ # (Optional) Specifies a list of staging labels that are attached to
1206
+ # this version of the secret. These staging labels are used to track the
1207
+ # versions through the rotation process by the Lambda rotation function.
1208
+ #
1209
+ # A staging label must be unique to a single version of the secret. If
1210
+ # you specify a staging label that's already associated with a
1211
+ # different version of the same secret then that staging label is
1212
+ # automatically removed from the other version and attached to this
1213
+ # version.
1214
+ #
1215
+ # If you do not specify a value for `VersionStages` then AWS Secrets
1216
+ # Manager automatically moves the staging label `AWSCURRENT` to this new
1217
+ # version.
1218
+ #
1219
+ # @return [Types::PutSecretValueResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1220
+ #
1221
+ # * {Types::PutSecretValueResponse#arn #arn} => String
1222
+ # * {Types::PutSecretValueResponse#name #name} => String
1223
+ # * {Types::PutSecretValueResponse#version_id #version_id} => String
1224
+ # * {Types::PutSecretValueResponse#version_stages #version_stages} => Array&lt;String&gt;
1225
+ #
1226
+ # @example Request syntax with placeholder values
1227
+ #
1228
+ # resp = client.put_secret_value({
1229
+ # secret_id: "SecretIdType", # required
1230
+ # client_request_token: "ClientRequestTokenType",
1231
+ # secret_binary: "data",
1232
+ # secret_string: "SecretStringType",
1233
+ # version_stages: ["SecretVersionStageType"],
1234
+ # })
1235
+ #
1236
+ # @example Response structure
1237
+ #
1238
+ # resp.arn #=> String
1239
+ # resp.name #=> String
1240
+ # resp.version_id #=> String
1241
+ # resp.version_stages #=> Array
1242
+ # resp.version_stages[0] #=> String
1243
+ #
1244
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/PutSecretValue AWS API Documentation
1245
+ #
1246
+ # @overload put_secret_value(params = {})
1247
+ # @param [Hash] params ({})
1248
+ def put_secret_value(params = {}, options = {})
1249
+ req = build_request(:put_secret_value, params)
1250
+ req.send_request(options)
1251
+ end
1252
+
1253
+ # Cancels the scheduled deletion of a secret by removing the
1254
+ # `DeletedDate` time stamp. This makes the secret accessible to query
1255
+ # once again.
1256
+ #
1257
+ # **Minimum permissions**
1258
+ #
1259
+ # To run this command, you must have the following permissions:
1260
+ #
1261
+ # * secretsmanager:RestoreSecret
1262
+ #
1263
+ # ^
1264
+ #
1265
+ # **Related operations**
1266
+ #
1267
+ # * To delete a secret, use DeleteSecret.
1268
+ #
1269
+ # ^
1270
+ #
1271
+ # @option params [required, String] :secret_id
1272
+ # Specifies the secret that you want to restore from a previously
1273
+ # scheduled deletion. You can specify either the Amazon Resource Name
1274
+ # (ARN) or the friendly name of the secret.
1275
+ #
1276
+ # @return [Types::RestoreSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1277
+ #
1278
+ # * {Types::RestoreSecretResponse#arn #arn} => String
1279
+ # * {Types::RestoreSecretResponse#name #name} => String
1280
+ #
1281
+ # @example Request syntax with placeholder values
1282
+ #
1283
+ # resp = client.restore_secret({
1284
+ # secret_id: "SecretIdType", # required
1285
+ # })
1286
+ #
1287
+ # @example Response structure
1288
+ #
1289
+ # resp.arn #=> String
1290
+ # resp.name #=> String
1291
+ #
1292
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/RestoreSecret AWS API Documentation
1293
+ #
1294
+ # @overload restore_secret(params = {})
1295
+ # @param [Hash] params ({})
1296
+ def restore_secret(params = {}, options = {})
1297
+ req = build_request(:restore_secret, params)
1298
+ req.send_request(options)
1299
+ end
1300
+
1301
+ # Configures and starts the asynchronous process of rotating this
1302
+ # secret. If you include the configuration parameters, the operation
1303
+ # sets those values for the secret and then immediately starts a
1304
+ # rotation. If you do not include the configuration parameters, the
1305
+ # operation starts a rotation with the values already stored in the
1306
+ # secret. After the rotation completes, the protected service and its
1307
+ # clients all use the new version of the secret.
1308
+ #
1309
+ # This required configuration information includes the ARN of an AWS
1310
+ # Lambda function and the time between scheduled rotations. The Lambda
1311
+ # rotation function creates a new version of the secret and creates or
1312
+ # updates the credentials on the protected service to match. After
1313
+ # testing the new credentials, the function marks the new secret with
1314
+ # the staging label `AWSCURRENT` so that your clients all immediately
1315
+ # begin to use the new version. For more information about rotating
1316
+ # secrets and how to configure a Lambda function to rotate the secrets
1317
+ # for your protected service, see [Rotating Secrets in AWS Secrets
1318
+ # Manager][1] in the *AWS Secrets Manager User Guide*.
1319
+ #
1320
+ # The rotation function must end with the versions of the secret in one
1321
+ # of two states:
1322
+ #
1323
+ # * The `AWSPENDING` and `AWSCURRENT` staging labels are attached to the
1324
+ # same version of the secret, or
1325
+ #
1326
+ # * The `AWSPENDING` staging label is not attached to any version of the
1327
+ # secret.
1328
+ #
1329
+ # If instead the `AWSPENDING` staging label is present but is not
1330
+ # attached to the same version as `AWSCURRENT` then any later invocation
1331
+ # of `RotateSecret` assumes that a previous rotation request is still in
1332
+ # progress and returns an error.
1333
+ #
1334
+ # **Minimum permissions**
1335
+ #
1336
+ # To run this command, you must have the following permissions:
1337
+ #
1338
+ # * secretsmanager:RotateSecret
1339
+ #
1340
+ # * lambda:InvokeFunction (on the function specified in the secret's
1341
+ # metadata)
1342
+ #
1343
+ # **Related operations**
1344
+ #
1345
+ # * To list the secrets in your account, use ListSecrets.
1346
+ #
1347
+ # * To get the details for a version of a secret, use DescribeSecret.
1348
+ #
1349
+ # * To create a new version of a secret, use CreateSecret.
1350
+ #
1351
+ # * To attach staging labels to or remove staging labels from a version
1352
+ # of a secret, use UpdateSecretVersionStage.
1353
+ #
1354
+ #
1355
+ #
1356
+ # [1]: http://docs.aws.amazon.com/http:/docs.aws.amazon.com/;asm-service-name;/latest/userguide/rotating-secrets.html
1357
+ #
1358
+ # @option params [required, String] :secret_id
1359
+ # Specifies the secret that you want to rotate. You can specify either
1360
+ # the Amazon Resource Name (ARN) or the friendly name of the secret.
1361
+ #
1362
+ # @option params [String] :client_request_token
1363
+ # (Optional) Specifies a unique identifier for the new version of the
1364
+ # secret that helps ensure idempotency.
1365
+ #
1366
+ # If you use the AWS CLI or one of the AWS SDK to call this operation,
1367
+ # then you can leave this parameter empty. The CLI or SDK generates a
1368
+ # random UUID for you and includes that in the request for this
1369
+ # parameter. If you don't use the SDK and instead generate a raw HTTP
1370
+ # request to the AWS Secrets Manager service endpoint, then you must
1371
+ # generate a `ClientRequestToken` yourself for new versions and include
1372
+ # that value in the request.
1373
+ #
1374
+ # You only need to specify your own value if you are implementing your
1375
+ # own retry logic and want to ensure that a given secret is not created
1376
+ # twice. We recommend that you generate a [UUID-type][1] value to ensure
1377
+ # uniqueness within the specified secret.
1378
+ #
1379
+ # Secrets Manager uses this value to prevent the accidental creation of
1380
+ # duplicate versions if there are failures and retries during the
1381
+ # function's processing.
1382
+ #
1383
+ # * If the `ClientRequestToken` value isn't already associated with a
1384
+ # version of the secret then a new version of the secret is created.
1385
+ #
1386
+ # * If a version with this value already exists and that version's
1387
+ # `SecretString` and `SecretBinary` values are the same as the
1388
+ # request, then the request is ignored (the operation is idempotent).
1389
+ #
1390
+ # * If a version with this value already exists and that version's
1391
+ # `SecretString` and `SecretBinary` values are different from the
1392
+ # request then an error occurs because you cannot modify an existing
1393
+ # secret value.
1394
+ #
1395
+ # This value becomes the `SecretVersionId` of the new version.
1396
+ #
1397
+ # **A suitable default value is auto-generated.** You should normally
1398
+ # not need to pass this option.**
1399
+ #
1400
+ #
1401
+ #
1402
+ # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
1403
+ #
1404
+ # @option params [String] :rotation_lambda_arn
1405
+ # (Optional) Specifies the ARN of the Lambda function that can rotate
1406
+ # the secret.
1407
+ #
1408
+ # @option params [Types::RotationRulesType] :rotation_rules
1409
+ # A structure that defines the rotation configuration for this secret.
1410
+ #
1411
+ # @return [Types::RotateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1412
+ #
1413
+ # * {Types::RotateSecretResponse#arn #arn} => String
1414
+ # * {Types::RotateSecretResponse#name #name} => String
1415
+ # * {Types::RotateSecretResponse#version_id #version_id} => String
1416
+ #
1417
+ # @example Request syntax with placeholder values
1418
+ #
1419
+ # resp = client.rotate_secret({
1420
+ # secret_id: "SecretIdType", # required
1421
+ # client_request_token: "ClientRequestTokenType",
1422
+ # rotation_lambda_arn: "RotationLambdaARNType",
1423
+ # rotation_rules: {
1424
+ # automatically_after_days: 1,
1425
+ # },
1426
+ # })
1427
+ #
1428
+ # @example Response structure
1429
+ #
1430
+ # resp.arn #=> String
1431
+ # resp.name #=> String
1432
+ # resp.version_id #=> String
1433
+ #
1434
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/RotateSecret AWS API Documentation
1435
+ #
1436
+ # @overload rotate_secret(params = {})
1437
+ # @param [Hash] params ({})
1438
+ def rotate_secret(params = {}, options = {})
1439
+ req = build_request(:rotate_secret, params)
1440
+ req.send_request(options)
1441
+ end
1442
+
1443
+ # Attaches one or more tags, each consisting of a key name and a value,
1444
+ # to the specified secret. Tags are part of the secret's overall
1445
+ # metadata, and are not associated with any specific version of the
1446
+ # secret. This operation only appends tags to the existing list of tags.
1447
+ # To remove tags, you must use UntagResource.
1448
+ #
1449
+ # The following basic restrictions apply to tags:
1450
+ #
1451
+ # * Maximum number of tags per secret—50
1452
+ #
1453
+ # * Maximum key length—127 Unicode characters in UTF-8
1454
+ #
1455
+ # * Maximum value length—255 Unicode characters in UTF-8
1456
+ #
1457
+ # * Tag keys and values are case sensitive.
1458
+ #
1459
+ # * Do not use the `aws:` prefix in your tag names or values because it
1460
+ # is reserved for AWS use. You can't edit or delete tag names or
1461
+ # values with this prefix. Tags with this prefix do not count against
1462
+ # your tags per secret limit.
1463
+ #
1464
+ # * If your tagging schema will be used across multiple services and
1465
+ # resources, remember that other services might have restrictions on
1466
+ # allowed characters. Generally allowed characters are: letters,
1467
+ # spaces, and numbers representable in UTF-8, plus the following
1468
+ # special characters: + - = . \_ : / @.
1469
+ #
1470
+ # If you use tags as part of your security strategy, then adding or
1471
+ # removing a tag can change permissions. If successfully completing this
1472
+ # operation would result in you losing your permissions for this secret,
1473
+ # then the operation is blocked and returns an Access Denied error.
1474
+ #
1475
+ # **Minimum permissions**
1476
+ #
1477
+ # To run this command, you must have the following permissions:
1478
+ #
1479
+ # * secretsmanager:TagResource
1480
+ #
1481
+ # ^
1482
+ #
1483
+ # **Related operations**
1484
+ #
1485
+ # * To remove one or more tags from the collection attached to a secret,
1486
+ # use UntagResource.
1487
+ #
1488
+ # * To view the list of tags attached to a secret, use DescribeSecret.
1489
+ #
1490
+ # @option params [required, String] :secret_id
1491
+ # The identifier for the secret that you want to attach tags to. You can
1492
+ # specify either the Amazon Resource Name (ARN) or the friendly name of
1493
+ # the secret.
1494
+ #
1495
+ # @option params [required, Array<Types::Tag>] :tags
1496
+ # The tags to attach to the secret. Each element in the list consists of
1497
+ # a `Key` and a `Value`.
1498
+ #
1499
+ # This parameter to the API requires a JSON text string argument. For
1500
+ # information on how to format a JSON parameter for the various command
1501
+ # line tool environments, see [Using JSON for Parameters][1] in the *AWS
1502
+ # CLI User Guide*. For the AWS CLI, you can also use the syntax: `--Tags
1503
+ # Key="Key1",Value="Value1",Key="Key2",Value="Value2"[,…]`
1504
+ #
1505
+ #
1506
+ #
1507
+ # [1]: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
1508
+ #
1509
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1510
+ #
1511
+ # @example Request syntax with placeholder values
1512
+ #
1513
+ # resp = client.tag_resource({
1514
+ # secret_id: "SecretIdType", # required
1515
+ # tags: [ # required
1516
+ # {
1517
+ # key: "TagKeyType",
1518
+ # value: "TagValueType",
1519
+ # },
1520
+ # ],
1521
+ # })
1522
+ #
1523
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/TagResource AWS API Documentation
1524
+ #
1525
+ # @overload tag_resource(params = {})
1526
+ # @param [Hash] params ({})
1527
+ def tag_resource(params = {}, options = {})
1528
+ req = build_request(:tag_resource, params)
1529
+ req.send_request(options)
1530
+ end
1531
+
1532
+ # Removes one or more tags from the specified secret.
1533
+ #
1534
+ # This operation is idempotent. If a requested tag is not attached to
1535
+ # the secret, no error is returned and the secret metadata is unchanged.
1536
+ #
1537
+ # If you use tags as part of your security strategy, then removing a tag
1538
+ # can change permissions. If successfully completing this operation
1539
+ # would result in you losing your permissions for this secret, then the
1540
+ # operation is blocked and returns an Access Denied error.
1541
+ #
1542
+ # **Minimum permissions**
1543
+ #
1544
+ # To run this command, you must have the following permissions:
1545
+ #
1546
+ # * secretsmanager:UntagResource
1547
+ #
1548
+ # ^
1549
+ #
1550
+ # **Related operations**
1551
+ #
1552
+ # * To add one or more tags to the collection attached to a secret, use
1553
+ # TagResource.
1554
+ #
1555
+ # * To view the list of tags attached to a secret, use DescribeSecret.
1556
+ #
1557
+ # @option params [required, String] :secret_id
1558
+ # The identifier for the secret that you want to remove tags from. You
1559
+ # can specify either the Amazon Resource Name (ARN) or the friendly name
1560
+ # of the secret.
1561
+ #
1562
+ # @option params [required, Array<String>] :tag_keys
1563
+ # A list of tag key names to remove from the secret. You don't specify
1564
+ # the value. Both the key and its associated value are removed.
1565
+ #
1566
+ # This parameter to the API requires a JSON text string argument. For
1567
+ # information on how to format a JSON parameter for the various command
1568
+ # line tool environments, see [Using JSON for Parameters][1] in the *AWS
1569
+ # CLI User Guide*.
1570
+ #
1571
+ #
1572
+ #
1573
+ # [1]: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
1574
+ #
1575
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1576
+ #
1577
+ # @example Request syntax with placeholder values
1578
+ #
1579
+ # resp = client.untag_resource({
1580
+ # secret_id: "SecretIdType", # required
1581
+ # tag_keys: ["TagKeyType"], # required
1582
+ # })
1583
+ #
1584
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/UntagResource AWS API Documentation
1585
+ #
1586
+ # @overload untag_resource(params = {})
1587
+ # @param [Hash] params ({})
1588
+ def untag_resource(params = {}, options = {})
1589
+ req = build_request(:untag_resource, params)
1590
+ req.send_request(options)
1591
+ end
1592
+
1593
+ # Modifies many of the details of a secret. If you include a
1594
+ # `ClientRequestToken` and either `SecretString` or `SecretBinary` then
1595
+ # it also creates a new version attached to the secret.
1596
+ #
1597
+ # To modify the rotation configuration of a secret, use RotateSecret
1598
+ # instead.
1599
+ #
1600
+ # <note markdown="1"> The AWS Secrets Manager console uses only the `SecretString` parameter
1601
+ # and therefore limits you to encrypting and storing only a text string.
1602
+ # To encrypt and store binary data as part of the version of a secret,
1603
+ # you must use either the AWS CLI or one of the AWS SDKs.
1604
+ #
1605
+ # </note>
1606
+ #
1607
+ # * If this update creates the first version of the secret or if you did
1608
+ # not include the `VersionStages` parameter then Secrets Manager
1609
+ # automatically attaches the staging label `AWSCURRENT` to the new
1610
+ # version and removes it from any version that had it previously. The
1611
+ # previous version (if any) is then given the staging label
1612
+ # `AWSPREVIOUS`.
1613
+ #
1614
+ # * If a version with a `SecretVersionId` with the same value as the
1615
+ # `ClientRequestToken` parameter already exists, the operation
1616
+ # generates an error. You cannot modify an existing version, you can
1617
+ # only create new ones.
1618
+ #
1619
+ # * If you call an operation that needs to encrypt or decrypt the
1620
+ # `SecretString` and `SecretBinary` for a secret in the same account
1621
+ # as the calling user and that secret doesn't specify a KMS
1622
+ # encryption key, AWS Secrets Manager uses the account's default AWS
1623
+ # managed customer master key (CMK) with the alias
1624
+ # `aws/secretsmanager`. If this key doesn't already exist in your
1625
+ # account then AWS Secrets Manager creates it for you automatically.
1626
+ # All users in the same AWS account automatically have access to use
1627
+ # the default CMK. Note that if an AWS Secrets Manager API call
1628
+ # results in AWS having to create the account's AWS-managed CMK, it
1629
+ # can result in a one-time significant delay in returning the result.
1630
+ #
1631
+ # * If the secret is in a different AWS account from the credentials
1632
+ # calling an API that requires encryption or decryption of the secret
1633
+ # value then you must create and use a custom KMS CMK because you
1634
+ # can't access the default CMK for the account using credentials from
1635
+ # a different AWS account. Store the ARN of the CMK in the secret when
1636
+ # you create the secret or when you update it by including it in the
1637
+ # `KMSKeyId`. If you call an API that must encrypt or decrypt
1638
+ # `SecretString` or `SecretBinary` using credentials from a different
1639
+ # account then the KMS key policy must grant cross-account access to
1640
+ # that other account's user or role.
1641
+ #
1642
+ # **Minimum permissions**
1643
+ #
1644
+ # To run this command, you must have the following permissions:
1645
+ #
1646
+ # * secretsmanager:UpdateSecret
1647
+ #
1648
+ # * kms:GenerateDataKey - needed only if you use a custom KMS key to
1649
+ # encrypt the secret. You do not need this permission to use the
1650
+ # account's AWS managed CMK for Secrets Manager.
1651
+ #
1652
+ # * kms:Decrypt - needed only if you use a custom KMS key to encrypt the
1653
+ # secret. You do not need this permission to use the account's AWS
1654
+ # managed CMK for Secrets Manager.
1655
+ #
1656
+ # **Related operations**
1657
+ #
1658
+ # * To create a new secret, use CreateSecret.
1659
+ #
1660
+ # * To add only a new version to an existing secret, use PutSecretValue.
1661
+ #
1662
+ # * To get the details for a secret, use DescribeSecret.
1663
+ #
1664
+ # * To list the versions contained in a secret, use
1665
+ # ListSecretVersionIds.
1666
+ #
1667
+ # @option params [required, String] :secret_id
1668
+ # Specifies the secret that you want to update or to which you want to
1669
+ # add a new version. You can specify either the Amazon Resource Name
1670
+ # (ARN) or the friendly name of the secret.
1671
+ #
1672
+ # @option params [String] :client_request_token
1673
+ # (Optional) If you want to add a new version to the secret, this
1674
+ # parameter specifies a unique identifier for the new version that helps
1675
+ # ensure idempotency.
1676
+ #
1677
+ # If you use the AWS CLI or one of the AWS SDK to call this operation,
1678
+ # then you can leave this parameter empty. The CLI or SDK generates a
1679
+ # random UUID for you and includes that in the request. If you don't
1680
+ # use the SDK and instead generate a raw HTTP request to the AWS Secrets
1681
+ # Manager service endpoint, then you must generate a
1682
+ # `ClientRequestToken` yourself for new versions and include that value
1683
+ # in the request.
1684
+ #
1685
+ # You typically only need to interact with this value if you implement
1686
+ # your own retry logic and want to ensure that a given secret is not
1687
+ # created twice. We recommend that you generate a [UUID-type][1] value
1688
+ # to ensure uniqueness within the specified secret.
1689
+ #
1690
+ # Secrets Manager uses this value to prevent the accidental creation of
1691
+ # duplicate versions if there are failures and retries during the Lambda
1692
+ # rotation function's processing.
1693
+ #
1694
+ # * If the `ClientRequestToken` value isn't already associated with a
1695
+ # version of the secret then a new version of the secret is created.
1696
+ #
1697
+ # * If a version with this value already exists and that version's
1698
+ # `SecretString` and `SecretBinary` values are the same as those in
1699
+ # the request then the request is ignored (the operation is
1700
+ # idempotent).
1701
+ #
1702
+ # * If a version with this value already exists and that version's
1703
+ # `SecretString` and `SecretBinary` values are different from the
1704
+ # request then an error occurs because you cannot modify an existing
1705
+ # secret value.
1706
+ #
1707
+ # This value becomes the `SecretVersionId` of the new version.
1708
+ #
1709
+ # **A suitable default value is auto-generated.** You should normally
1710
+ # not need to pass this option.**
1711
+ #
1712
+ #
1713
+ #
1714
+ # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
1715
+ #
1716
+ # @option params [String] :description
1717
+ # (Optional) Specifies a user-provided description of the secret.
1718
+ #
1719
+ # @option params [String] :kms_key_id
1720
+ # (Optional) Specifies the ARN or alias of the KMS customer master key
1721
+ # (CMK) to be used to encrypt the protected text in the versions of this
1722
+ # secret.
1723
+ #
1724
+ # If you don't specify this value, then Secrets Manager defaults to
1725
+ # using the default CMK in the account (the one named
1726
+ # `aws/secretsmanager`). If a KMS CMK with that name doesn't exist,
1727
+ # then AWS Secrets Manager creates it for you automatically the first
1728
+ # time it needs to encrypt a version's `Plaintext` or `PlaintextString`
1729
+ # fields.
1730
+ #
1731
+ # You can only use the account's default CMK to encrypt and decrypt if
1732
+ # you call this operation using credentials from the same account that
1733
+ # owns the secret. If the secret is in a different account, then you
1734
+ # must create a custom CMK and provide the ARN in this field.
1735
+ #
1736
+ # @option params [String, IO] :secret_binary
1737
+ # (Optional) Specifies binary data that you want to encrypt and store in
1738
+ # the new version of the secret. To use this parameter in the
1739
+ # command-line tools, we recommend that you store your binary data in a
1740
+ # file and then use the appropriate technique for your tool to pass the
1741
+ # contents of the file as a parameter. Either `SecretBinary` or
1742
+ # `SecretString` must have a value. They cannot both be empty.
1743
+ #
1744
+ # This parameter is not accessible using the Secrets Manager console.
1745
+ #
1746
+ # @option params [String] :secret_string
1747
+ # (Optional) Specifies text data that you want to encrypt and store in
1748
+ # this new version of the secret. Either `SecretBinary` or
1749
+ # `SecretString` must have a value. They cannot both be empty.
1750
+ #
1751
+ # If you create this secret by using the Secrets Manager console then
1752
+ # Secrets Manager puts the protected secret text in only the
1753
+ # `SecretString` parameter. The Secrets Manager console stores the
1754
+ # information as a JSON structure of key/value pairs that the default
1755
+ # Lambda rotation function knows how to parse.
1756
+ #
1757
+ # For storing multiple values, we recommend that you use a JSON text
1758
+ # string argument and specify key/value pairs. For information on how to
1759
+ # format a JSON parameter for the various command line tool
1760
+ # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
1761
+ # Guide*.
1762
+ #
1763
+ #
1764
+ #
1765
+ # [1]: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
1766
+ #
1767
+ # @return [Types::UpdateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1768
+ #
1769
+ # * {Types::UpdateSecretResponse#arn #arn} => String
1770
+ # * {Types::UpdateSecretResponse#name #name} => String
1771
+ # * {Types::UpdateSecretResponse#version_id #version_id} => String
1772
+ #
1773
+ # @example Request syntax with placeholder values
1774
+ #
1775
+ # resp = client.update_secret({
1776
+ # secret_id: "SecretIdType", # required
1777
+ # client_request_token: "ClientRequestTokenType",
1778
+ # description: "DescriptionType",
1779
+ # kms_key_id: "KmsKeyIdType",
1780
+ # secret_binary: "data",
1781
+ # secret_string: "SecretStringType",
1782
+ # })
1783
+ #
1784
+ # @example Response structure
1785
+ #
1786
+ # resp.arn #=> String
1787
+ # resp.name #=> String
1788
+ # resp.version_id #=> String
1789
+ #
1790
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/UpdateSecret AWS API Documentation
1791
+ #
1792
+ # @overload update_secret(params = {})
1793
+ # @param [Hash] params ({})
1794
+ def update_secret(params = {}, options = {})
1795
+ req = build_request(:update_secret, params)
1796
+ req.send_request(options)
1797
+ end
1798
+
1799
+ # Modifies the staging labels attached to a version of a secret. Staging
1800
+ # labels are used to track a version as it progresses through the secret
1801
+ # rotation process. You can attach a staging label to only one version
1802
+ # of a secret at a time. If a staging label to be added is already
1803
+ # attached to another version, then it is moved--removed from the other
1804
+ # version first and then attached to this one. For more information
1805
+ # about staging labels, see [Staging Labels][1] in the *AWS Secrets
1806
+ # Manager User Guide*.
1807
+ #
1808
+ # The staging labels that you specify in the `VersionStage` parameter
1809
+ # are added to the existing list of staging labels--they don't replace
1810
+ # it.
1811
+ #
1812
+ # You can move the `AWSCURRENT` staging label to this version by
1813
+ # including it in this call.
1814
+ #
1815
+ # <note markdown="1"> Whenever you move `AWSCURRENT`, Secrets Manager automatically moves
1816
+ # the label `AWSPREVIOUS` to the version that `AWSCURRENT` was removed
1817
+ # from.
1818
+ #
1819
+ # </note>
1820
+ #
1821
+ # If this action results in the last label being removed from a version,
1822
+ # then the version is considered to be 'deprecated' and can be deleted
1823
+ # by Secrets Manager.
1824
+ #
1825
+ # **Minimum permissions**
1826
+ #
1827
+ # To run this command, you must have the following permissions:
1828
+ #
1829
+ # * secretsmanager:UpdateSecretVersionStage
1830
+ #
1831
+ # ^
1832
+ #
1833
+ # **Related operations**
1834
+ #
1835
+ # * To get the list of staging labels that are currently associated with
1836
+ # a version of a secret, use ` DescribeSecret ` and examine the
1837
+ # `SecretVersionsToStages` response value.
1838
+ #
1839
+ # ^
1840
+ #
1841
+ #
1842
+ #
1843
+ # [1]: http://docs.aws.amazon.com/http:/docs.aws.amazon.com/;asm-service-name;/latest/userguide/terms-concepts.html#term_label
1844
+ #
1845
+ # @option params [required, String] :secret_id
1846
+ # Specifies the secret with the version whose list of staging labels you
1847
+ # want to modify. You can specify either the Amazon Resource Name (ARN)
1848
+ # or the friendly name of the secret.
1849
+ #
1850
+ # @option params [required, String] :version_stage
1851
+ # The list of staging labels to add to this version.
1852
+ #
1853
+ # @option params [String] :remove_from_version_id
1854
+ # (Optional) Specifies the secret version ID of the version that the
1855
+ # staging labels are to be removed from.
1856
+ #
1857
+ # If you want to move a label to a new version, you do not have to
1858
+ # explicitly remove it with this parameter. Adding a label using the
1859
+ # `MoveToVersionId` parameter automatically removes it from the old
1860
+ # version. However, if you do include both the "MoveTo" and
1861
+ # "RemoveFrom" parameters, then the move is successful only if the
1862
+ # staging labels are actually present on the "RemoveFrom" version. If
1863
+ # a staging label was on a different version than "RemoveFrom", then
1864
+ # the request fails.
1865
+ #
1866
+ # @option params [String] :move_to_version_id
1867
+ # (Optional) The secret version ID that you want to add the staging
1868
+ # labels to.
1869
+ #
1870
+ # If any of the staging labels are already attached to a different
1871
+ # version of the secret, then they are removed from that version before
1872
+ # adding them to this version.
1873
+ #
1874
+ # @return [Types::UpdateSecretVersionStageResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1875
+ #
1876
+ # * {Types::UpdateSecretVersionStageResponse#arn #arn} => String
1877
+ # * {Types::UpdateSecretVersionStageResponse#name #name} => String
1878
+ #
1879
+ # @example Request syntax with placeholder values
1880
+ #
1881
+ # resp = client.update_secret_version_stage({
1882
+ # secret_id: "SecretIdType", # required
1883
+ # version_stage: "SecretVersionStageType", # required
1884
+ # remove_from_version_id: "SecretVersionIdType",
1885
+ # move_to_version_id: "SecretVersionIdType",
1886
+ # })
1887
+ #
1888
+ # @example Response structure
1889
+ #
1890
+ # resp.arn #=> String
1891
+ # resp.name #=> String
1892
+ #
1893
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/UpdateSecretVersionStage AWS API Documentation
1894
+ #
1895
+ # @overload update_secret_version_stage(params = {})
1896
+ # @param [Hash] params ({})
1897
+ def update_secret_version_stage(params = {}, options = {})
1898
+ req = build_request(:update_secret_version_stage, params)
1899
+ req.send_request(options)
1900
+ end
1901
+
1902
+ # @!endgroup
1903
+
1904
+ # @param params ({})
1905
+ # @api private
1906
+ def build_request(operation_name, params = {})
1907
+ handlers = @handlers.for(operation_name)
1908
+ context = Seahorse::Client::RequestContext.new(
1909
+ operation_name: operation_name,
1910
+ operation: config.api.operation(operation_name),
1911
+ client: self,
1912
+ params: params,
1913
+ config: config)
1914
+ context[:gem_name] = 'aws-sdk-secretsmanager'
1915
+ context[:gem_version] = '1.0.0'
1916
+ Seahorse::Client::Request.new(handlers, context)
1917
+ end
1918
+
1919
+ # @api private
1920
+ # @deprecated
1921
+ def waiter_names
1922
+ []
1923
+ end
1924
+
1925
+ class << self
1926
+
1927
+ # @api private
1928
+ attr_reader :identifier
1929
+
1930
+ # @api private
1931
+ def errors_module
1932
+ Errors
1933
+ end
1934
+
1935
+ end
1936
+ end
1937
+ end