aws-sdk-secretsmanager 1.31.0 → 1.113.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,54 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
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/endpoint_discovery.rb'
19
- require 'aws-sdk-core/plugins/endpoint_pattern.rb'
20
- require 'aws-sdk-core/plugins/response_paging.rb'
21
- require 'aws-sdk-core/plugins/stub_responses.rb'
22
- require 'aws-sdk-core/plugins/idempotency_token.rb'
23
- require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
24
- require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
25
- require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
26
- require 'aws-sdk-core/plugins/transfer_encoding.rb'
27
- require 'aws-sdk-core/plugins/signature_v4.rb'
28
- require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
29
-
30
- Aws::Plugins::GlobalConfiguration.add_identifier(:secretsmanager)
10
+ require 'seahorse/client/plugins/content_length'
11
+ require 'aws-sdk-core/plugins/credentials_configuration'
12
+ require 'aws-sdk-core/plugins/logging'
13
+ require 'aws-sdk-core/plugins/param_converter'
14
+ require 'aws-sdk-core/plugins/param_validator'
15
+ require 'aws-sdk-core/plugins/user_agent'
16
+ require 'aws-sdk-core/plugins/helpful_socket_errors'
17
+ require 'aws-sdk-core/plugins/retry_errors'
18
+ require 'aws-sdk-core/plugins/global_configuration'
19
+ require 'aws-sdk-core/plugins/regional_endpoint'
20
+ require 'aws-sdk-core/plugins/endpoint_discovery'
21
+ require 'aws-sdk-core/plugins/endpoint_pattern'
22
+ require 'aws-sdk-core/plugins/response_paging'
23
+ require 'aws-sdk-core/plugins/stub_responses'
24
+ require 'aws-sdk-core/plugins/idempotency_token'
25
+ require 'aws-sdk-core/plugins/invocation_id'
26
+ require 'aws-sdk-core/plugins/jsonvalue_converter'
27
+ require 'aws-sdk-core/plugins/client_metrics_plugin'
28
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin'
29
+ require 'aws-sdk-core/plugins/transfer_encoding'
30
+ require 'aws-sdk-core/plugins/http_checksum'
31
+ require 'aws-sdk-core/plugins/checksum_algorithm'
32
+ require 'aws-sdk-core/plugins/request_compression'
33
+ require 'aws-sdk-core/plugins/defaults_mode'
34
+ require 'aws-sdk-core/plugins/recursion_detection'
35
+ require 'aws-sdk-core/plugins/telemetry'
36
+ require 'aws-sdk-core/plugins/sign'
37
+ require 'aws-sdk-core/plugins/protocols/json_rpc'
31
38
 
32
39
  module Aws::SecretsManager
40
+ # An API client for SecretsManager. To construct a client, you need to configure a `:region` and `:credentials`.
41
+ #
42
+ # client = Aws::SecretsManager::Client.new(
43
+ # region: region_name,
44
+ # credentials: credentials,
45
+ # # ...
46
+ # )
47
+ #
48
+ # For details on configuring region and credentials see
49
+ # the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
50
+ #
51
+ # See {#initialize} for a full list of supported configuration options.
33
52
  class Client < Seahorse::Client::Base
34
53
 
35
54
  include Aws::ClientStubs
@@ -53,15 +72,28 @@ module Aws::SecretsManager
53
72
  add_plugin(Aws::Plugins::ResponsePaging)
54
73
  add_plugin(Aws::Plugins::StubResponses)
55
74
  add_plugin(Aws::Plugins::IdempotencyToken)
75
+ add_plugin(Aws::Plugins::InvocationId)
56
76
  add_plugin(Aws::Plugins::JsonvalueConverter)
57
77
  add_plugin(Aws::Plugins::ClientMetricsPlugin)
58
78
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
59
79
  add_plugin(Aws::Plugins::TransferEncoding)
60
- add_plugin(Aws::Plugins::SignatureV4)
80
+ add_plugin(Aws::Plugins::HttpChecksum)
81
+ add_plugin(Aws::Plugins::ChecksumAlgorithm)
82
+ add_plugin(Aws::Plugins::RequestCompression)
83
+ add_plugin(Aws::Plugins::DefaultsMode)
84
+ add_plugin(Aws::Plugins::RecursionDetection)
85
+ add_plugin(Aws::Plugins::Telemetry)
86
+ add_plugin(Aws::Plugins::Sign)
61
87
  add_plugin(Aws::Plugins::Protocols::JsonRpc)
88
+ add_plugin(Aws::SecretsManager::Plugins::Endpoints)
62
89
 
63
90
  # @overload initialize(options)
64
91
  # @param [Hash] options
92
+ #
93
+ # @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
94
+ # A list of plugins to apply to the client. Each plugin is either a
95
+ # class name or an instance of a plugin class.
96
+ #
65
97
  # @option options [required, Aws::CredentialProvider] :credentials
66
98
  # Your AWS credentials. This can be an instance of any one of the
67
99
  # following classes:
@@ -69,31 +101,50 @@ module Aws::SecretsManager
69
101
  # * `Aws::Credentials` - Used for configuring static, non-refreshing
70
102
  # credentials.
71
103
  #
104
+ # * `Aws::SharedCredentials` - Used for loading static credentials from a
105
+ # shared file, such as `~/.aws/config`.
106
+ #
107
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
108
+ #
109
+ # * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
110
+ # assume a role after providing credentials via the web.
111
+ #
112
+ # * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
113
+ # access token generated from `aws login`.
114
+ #
115
+ # * `Aws::ProcessCredentials` - Used for loading credentials from a
116
+ # process that outputs to stdout.
117
+ #
72
118
  # * `Aws::InstanceProfileCredentials` - Used for loading credentials
73
119
  # from an EC2 IMDS on an EC2 instance.
74
120
  #
75
- # * `Aws::SharedCredentials` - Used for loading credentials from a
76
- # shared file, such as `~/.aws/config`.
121
+ # * `Aws::ECSCredentials` - Used for loading credentials from
122
+ # instances running in ECS.
77
123
  #
78
- # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
124
+ # * `Aws::CognitoIdentityCredentials` - Used for loading credentials
125
+ # from the Cognito Identity service.
79
126
  #
80
127
  # When `:credentials` are not configured directly, the following
81
128
  # locations will be searched for credentials:
82
129
  #
83
130
  # * `Aws.config[:credentials]`
84
- # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
85
- # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
131
+ # * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
132
+ # `:account_id` options.
133
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],
134
+ # ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
86
135
  # * `~/.aws/credentials`
87
136
  # * `~/.aws/config`
88
- # * EC2 IMDS instance profile - When used by default, the timeouts are
89
- # very aggressive. Construct and pass an instance of
90
- # `Aws::InstanceProfileCredentails` to enable retries and extended
91
- # timeouts.
137
+ # * EC2/ECS IMDS instance profile - When used by default, the timeouts
138
+ # are very aggressive. Construct and pass an instance of
139
+ # `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
140
+ # enable retries and extended timeouts. Instance profile credential
141
+ # fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
142
+ # to true.
92
143
  #
93
144
  # @option options [required, String] :region
94
145
  # The AWS region to connect to. The configured `:region` is
95
146
  # used to determine the service `:endpoint`. When not passed,
96
- # a default `:region` is search for in the following locations:
147
+ # a default `:region` is searched for in the following locations:
97
148
  #
98
149
  # * `Aws.config[:region]`
99
150
  # * `ENV['AWS_REGION']`
@@ -104,10 +155,18 @@ module Aws::SecretsManager
104
155
  #
105
156
  # @option options [String] :access_key_id
106
157
  #
158
+ # @option options [String] :account_id
159
+ #
107
160
  # @option options [Boolean] :active_endpoint_cache (false)
108
161
  # When set to `true`, a thread polling for endpoints will be running in
109
162
  # the background every 60 secs (default). Defaults to `false`.
110
163
  #
164
+ # @option options [Boolean] :adaptive_retry_wait_to_fill (true)
165
+ # Used only in `adaptive` retry mode. When true, the request will sleep
166
+ # until there is sufficent client side capacity to retry the request.
167
+ # When false, the request will raise a `RetryCapacityNotAvailableError` and will
168
+ # not retry instead of sleeping.
169
+ #
111
170
  # @option options [Boolean] :client_side_monitoring (false)
112
171
  # When `true`, client-side metrics will be collected for all API requests from
113
172
  # this client.
@@ -132,14 +191,32 @@ module Aws::SecretsManager
132
191
  # When `true`, an attempt is made to coerce request parameters into
133
192
  # the required types.
134
193
  #
194
+ # @option options [Boolean] :correct_clock_skew (true)
195
+ # Used only in `standard` and adaptive retry modes. Specifies whether to apply
196
+ # a clock skew correction and retry requests with skewed client clocks.
197
+ #
198
+ # @option options [String] :defaults_mode ("legacy")
199
+ # See {Aws::DefaultsModeConfiguration} for a list of the
200
+ # accepted modes and the configuration defaults that are included.
201
+ #
135
202
  # @option options [Boolean] :disable_host_prefix_injection (false)
136
203
  # Set to true to disable SDK automatically adding host prefix
137
204
  # to default service endpoint when available.
138
205
  #
139
- # @option options [String] :endpoint
140
- # The client endpoint is normally constructed from the `:region`
141
- # option. You should only configure an `:endpoint` when connecting
142
- # to test endpoints. This should be avalid HTTP(S) URI.
206
+ # @option options [Boolean] :disable_request_compression (false)
207
+ # When set to 'true' the request body will not be compressed
208
+ # for supported operations.
209
+ #
210
+ # @option options [String, URI::HTTPS, URI::HTTP] :endpoint
211
+ # Normally you should not configure the `:endpoint` option
212
+ # directly. This is normally constructed from the `:region`
213
+ # option. Configuring `:endpoint` is normally reserved for
214
+ # connecting to test or custom endpoints. The endpoint should
215
+ # be a URI formatted like:
216
+ #
217
+ # 'http://example.com'
218
+ # 'https://example.com'
219
+ # 'http://example.com:123'
143
220
  #
144
221
  # @option options [Integer] :endpoint_cache_max_entries (1000)
145
222
  # Used for the maximum size limit of the LRU cache storing endpoints data
@@ -154,7 +231,11 @@ module Aws::SecretsManager
154
231
  # requests fetching endpoints information. Defaults to 60 sec.
155
232
  #
156
233
  # @option options [Boolean] :endpoint_discovery (false)
157
- # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
234
+ # When set to `true`, endpoint discovery will be enabled for operations when available.
235
+ #
236
+ # @option options [Boolean] :ignore_configured_endpoint_urls
237
+ # Setting to true disables use of endpoint URLs provided via environment
238
+ # variables and the shared configuration file.
158
239
  #
159
240
  # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
160
241
  # The log formatter.
@@ -166,15 +247,57 @@ module Aws::SecretsManager
166
247
  # The Logger instance to send log messages to. If this option
167
248
  # is not set, logging will be disabled.
168
249
  #
250
+ # @option options [Integer] :max_attempts (3)
251
+ # An integer representing the maximum number attempts that will be made for
252
+ # a single request, including the initial attempt. For example,
253
+ # setting this value to 5 will result in a request being retried up to
254
+ # 4 times. Used in `standard` and `adaptive` retry modes.
255
+ #
169
256
  # @option options [String] :profile ("default")
170
257
  # Used when loading credentials from the shared credentials file
171
258
  # at HOME/.aws/credentials. When not specified, 'default' is used.
172
259
  #
260
+ # @option options [String] :request_checksum_calculation ("when_supported")
261
+ # Determines when a checksum will be calculated for request payloads. Values are:
262
+ #
263
+ # * `when_supported` - (default) When set, a checksum will be
264
+ # calculated for all request payloads of operations modeled with the
265
+ # `httpChecksum` trait where `requestChecksumRequired` is `true` and/or a
266
+ # `requestAlgorithmMember` is modeled.
267
+ # * `when_required` - When set, a checksum will only be calculated for
268
+ # request payloads of operations modeled with the `httpChecksum` trait where
269
+ # `requestChecksumRequired` is `true` or where a `requestAlgorithmMember`
270
+ # is modeled and supplied.
271
+ #
272
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
273
+ # The minimum size in bytes that triggers compression for request
274
+ # bodies. The value must be non-negative integer value between 0
275
+ # and 10485780 bytes inclusive.
276
+ #
277
+ # @option options [String] :response_checksum_validation ("when_supported")
278
+ # Determines when checksum validation will be performed on response payloads. Values are:
279
+ #
280
+ # * `when_supported` - (default) When set, checksum validation is performed on all
281
+ # response payloads of operations modeled with the `httpChecksum` trait where
282
+ # `responseAlgorithms` is modeled, except when no modeled checksum algorithms
283
+ # are supported.
284
+ # * `when_required` - When set, checksum validation is not performed on
285
+ # response payloads of operations unless the checksum algorithm is supported and
286
+ # the `requestValidationModeMember` member is set to `ENABLED`.
287
+ #
288
+ # @option options [Proc] :retry_backoff
289
+ # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
290
+ # This option is only used in the `legacy` retry mode.
291
+ #
173
292
  # @option options [Float] :retry_base_delay (0.3)
174
- # The base delay in seconds used by the default backoff function.
293
+ # The base delay in seconds used by the default backoff function. This option
294
+ # is only used in the `legacy` retry mode.
175
295
  #
176
296
  # @option options [Symbol] :retry_jitter (:none)
177
- # A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
297
+ # A delay randomiser function used by the default backoff function.
298
+ # Some predefined functions can be referenced by name - :none, :equal, :full,
299
+ # otherwise a Proc that takes and returns a number. This option is only used
300
+ # in the `legacy` retry mode.
178
301
  #
179
302
  # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
180
303
  #
@@ -182,25 +305,55 @@ module Aws::SecretsManager
182
305
  # The maximum number of times to retry failed requests. Only
183
306
  # ~ 500 level server errors and certain ~ 400 level client errors
184
307
  # are retried. Generally, these are throttling errors, data
185
- # checksum errors, networking errors, timeout errors and auth
186
- # errors from expired credentials.
308
+ # checksum errors, networking errors, timeout errors, auth errors,
309
+ # endpoint discovery, and errors from expired credentials.
310
+ # This option is only used in the `legacy` retry mode.
187
311
  #
188
312
  # @option options [Integer] :retry_max_delay (0)
189
- # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
313
+ # The maximum number of seconds to delay between retries (0 for no limit)
314
+ # used by the default backoff function. This option is only used in the
315
+ # `legacy` retry mode.
316
+ #
317
+ # @option options [String] :retry_mode ("legacy")
318
+ # Specifies which retry algorithm to use. Values are:
319
+ #
320
+ # * `legacy` - The pre-existing retry behavior. This is default value if
321
+ # no retry mode is provided.
322
+ #
323
+ # * `standard` - A standardized set of retry rules across the AWS SDKs.
324
+ # This includes support for retry quotas, which limit the number of
325
+ # unsuccessful retries a client can make.
326
+ #
327
+ # * `adaptive` - An experimental retry mode that includes all the
328
+ # functionality of `standard` mode along with automatic client side
329
+ # throttling. This is a provisional mode that may change behavior
330
+ # in the future.
331
+ #
332
+ # @option options [String] :sdk_ua_app_id
333
+ # A unique and opaque application ID that is appended to the
334
+ # User-Agent header as app/sdk_ua_app_id. It should have a
335
+ # maximum length of 50. This variable is sourced from environment
336
+ # variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
190
337
  #
191
338
  # @option options [String] :secret_access_key
192
339
  #
193
340
  # @option options [String] :session_token
194
341
  #
342
+ # @option options [Array] :sigv4a_signing_region_set
343
+ # A list of regions that should be signed with SigV4a signing. When
344
+ # not passed, a default `:sigv4a_signing_region_set` is searched for
345
+ # in the following locations:
346
+ #
347
+ # * `Aws.config[:sigv4a_signing_region_set]`
348
+ # * `ENV['AWS_SIGV4A_SIGNING_REGION_SET']`
349
+ # * `~/.aws/config`
350
+ #
195
351
  # @option options [Boolean] :simple_json (false)
196
352
  # Disables request parameter conversion, validation, and formatting.
197
- # Also disable response data type conversions. This option is useful
198
- # when you want to ensure the highest level of performance by
199
- # avoiding overhead of walking request parameters and response data
200
- # structures.
201
- #
202
- # When `:simple_json` is enabled, the request parameters hash must
203
- # be formatted exactly as the DynamoDB API expects.
353
+ # Also disables response data type conversions. The request parameters
354
+ # hash must be formatted exactly as the API expects.This option is useful
355
+ # when you want to ensure the highest level of performance by avoiding
356
+ # overhead of walking request parameters and response data structures.
204
357
  #
205
358
  # @option options [Boolean] :stub_responses (false)
206
359
  # Causes the client to return stubbed responses. By default
@@ -211,52 +364,112 @@ module Aws::SecretsManager
211
364
  # ** Please note ** When response stubbing is enabled, no HTTP
212
365
  # requests are made, and retries are disabled.
213
366
  #
367
+ # @option options [Aws::Telemetry::TelemetryProviderBase] :telemetry_provider (Aws::Telemetry::NoOpTelemetryProvider)
368
+ # Allows you to provide a telemetry provider, which is used to
369
+ # emit telemetry data. By default, uses `NoOpTelemetryProvider` which
370
+ # will not record or emit any telemetry data. The SDK supports the
371
+ # following telemetry providers:
372
+ #
373
+ # * OpenTelemetry (OTel) - To use the OTel provider, install and require the
374
+ # `opentelemetry-sdk` gem and then, pass in an instance of a
375
+ # `Aws::Telemetry::OTelProvider` for telemetry provider.
376
+ #
377
+ # @option options [Aws::TokenProvider] :token_provider
378
+ # A Bearer Token Provider. This can be an instance of any one of the
379
+ # following classes:
380
+ #
381
+ # * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
382
+ # tokens.
383
+ #
384
+ # * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
385
+ # access token generated from `aws login`.
386
+ #
387
+ # When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
388
+ # will be used to search for tokens configured for your profile in shared configuration files.
389
+ #
390
+ # @option options [Boolean] :use_dualstack_endpoint
391
+ # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
392
+ # will be used if available.
393
+ #
394
+ # @option options [Boolean] :use_fips_endpoint
395
+ # When set to `true`, fips compatible endpoints will be used if available.
396
+ # When a `fips` region is used, the region is normalized and this config
397
+ # is set to `true`.
398
+ #
214
399
  # @option options [Boolean] :validate_params (true)
215
400
  # When `true`, request parameters are validated before
216
401
  # sending the request.
217
402
  #
218
- # @option options [URI::HTTP,String] :http_proxy A proxy to send
219
- # requests through. Formatted like 'http://proxy.com:123'.
220
- #
221
- # @option options [Float] :http_open_timeout (15) The number of
222
- # seconds to wait when opening a HTTP session before rasing a
223
- # `Timeout::Error`.
224
- #
225
- # @option options [Integer] :http_read_timeout (60) The default
226
- # number of seconds to wait for response data. This value can
227
- # safely be set
228
- # per-request on the session yeidled by {#session_for}.
229
- #
230
- # @option options [Float] :http_idle_timeout (5) The number of
231
- # seconds a connection is allowed to sit idble before it is
232
- # considered stale. Stale connections are closed and removed
233
- # from the pool before making a request.
234
- #
235
- # @option options [Float] :http_continue_timeout (1) The number of
236
- # seconds to wait for a 100-continue response before sending the
237
- # request body. This option has no effect unless the request has
238
- # "Expect" header set to "100-continue". Defaults to `nil` which
239
- # disables this behaviour. This value can safely be set per
240
- # request on the session yeidled by {#session_for}.
241
- #
242
- # @option options [Boolean] :http_wire_trace (false) When `true`,
243
- # HTTP debug output will be sent to the `:logger`.
244
- #
245
- # @option options [Boolean] :ssl_verify_peer (true) When `true`,
246
- # SSL peer certificates are verified when establishing a
247
- # connection.
248
- #
249
- # @option options [String] :ssl_ca_bundle Full path to the SSL
250
- # certificate authority bundle file that should be used when
251
- # verifying peer certificates. If you do not pass
252
- # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
253
- # will be used if available.
254
- #
255
- # @option options [String] :ssl_ca_directory Full path of the
256
- # directory that contains the unbundled SSL certificate
403
+ # @option options [Aws::SecretsManager::EndpointProvider] :endpoint_provider
404
+ # The endpoint provider used to resolve endpoints. Any object that responds to
405
+ # `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
406
+ # `Aws::SecretsManager::EndpointParameters`.
407
+ #
408
+ # @option options [Float] :http_continue_timeout (1)
409
+ # The number of seconds to wait for a 100-continue response before sending the
410
+ # request body. This option has no effect unless the request has "Expect"
411
+ # header set to "100-continue". Defaults to `nil` which disables this
412
+ # behaviour. This value can safely be set per request on the session.
413
+ #
414
+ # @option options [Float] :http_idle_timeout (5)
415
+ # The number of seconds a connection is allowed to sit idle before it
416
+ # is considered stale. Stale connections are closed and removed from the
417
+ # pool before making a request.
418
+ #
419
+ # @option options [Float] :http_open_timeout (15)
420
+ # The default number of seconds to wait for response data.
421
+ # This value can safely be set per-request on the session.
422
+ #
423
+ # @option options [URI::HTTP,String] :http_proxy
424
+ # A proxy to send requests through. Formatted like 'http://proxy.com:123'.
425
+ #
426
+ # @option options [Float] :http_read_timeout (60)
427
+ # The default number of seconds to wait for response data.
428
+ # This value can safely be set per-request on the session.
429
+ #
430
+ # @option options [Boolean] :http_wire_trace (false)
431
+ # When `true`, HTTP debug output will be sent to the `:logger`.
432
+ #
433
+ # @option options [Proc] :on_chunk_received
434
+ # When a Proc object is provided, it will be used as callback when each chunk
435
+ # of the response body is received. It provides three arguments: the chunk,
436
+ # the number of bytes received, and the total number of
437
+ # bytes in the response (or nil if the server did not send a `content-length`).
438
+ #
439
+ # @option options [Proc] :on_chunk_sent
440
+ # When a Proc object is provided, it will be used as callback when each chunk
441
+ # of the request body is sent. It provides three arguments: the chunk,
442
+ # the number of bytes read from the body, and the total number of
443
+ # bytes in the body.
444
+ #
445
+ # @option options [Boolean] :raise_response_errors (true)
446
+ # When `true`, response errors are raised.
447
+ #
448
+ # @option options [String] :ssl_ca_bundle
449
+ # Full path to the SSL certificate authority bundle file that should be used when
450
+ # verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
451
+ # `:ssl_ca_directory` the the system default will be used if available.
452
+ #
453
+ # @option options [String] :ssl_ca_directory
454
+ # Full path of the directory that contains the unbundled SSL certificate
257
455
  # authority files for verifying peer certificates. If you do
258
- # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
259
- # system default will be used if available.
456
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
457
+ # default will be used if available.
458
+ #
459
+ # @option options [String] :ssl_ca_store
460
+ # Sets the X509::Store to verify peer certificate.
461
+ #
462
+ # @option options [OpenSSL::X509::Certificate] :ssl_cert
463
+ # Sets a client certificate when creating http connections.
464
+ #
465
+ # @option options [OpenSSL::PKey] :ssl_key
466
+ # Sets a client key when creating http connections.
467
+ #
468
+ # @option options [Float] :ssl_timeout
469
+ # Sets the SSL timeout in seconds
470
+ #
471
+ # @option options [Boolean] :ssl_verify_peer (true)
472
+ # When `true`, SSL peer certificates are verified when establishing a connection.
260
473
  #
261
474
  def initialize(*args)
262
475
  super
@@ -264,75 +477,197 @@ module Aws::SecretsManager
264
477
 
265
478
  # @!group API Operations
266
479
 
267
- # Disables automatic scheduled rotation and cancels the rotation of a
268
- # secret if one is currently in progress.
269
- #
270
- # To re-enable scheduled rotation, call RotateSecret with
271
- # `AutomaticallyRotateAfterDays` set to a value greater than 0. This
272
- # will immediately rotate your secret and then enable the automatic
273
- # schedule.
274
- #
275
- # <note markdown="1"> If you cancel a rotation that is in progress, it can leave the
276
- # `VersionStage` labels in an unexpected state. Depending on what step
277
- # of the rotation was in progress, you might need to remove the staging
278
- # label `AWSPENDING` from the partially created version, specified by
279
- # the `VersionId` response value. You should also evaluate the partially
280
- # rotated new version to see if it should be deleted, which you can do
281
- # by removing all staging labels from the new version's `VersionStage`
282
- # field.
480
+ # Retrieves the contents of the encrypted fields `SecretString` or
481
+ # `SecretBinary` for up to 20 secrets. To retrieve a single secret, call
482
+ # GetSecretValue.
283
483
  #
284
- # </note>
484
+ # To choose which secrets to retrieve, you can specify a list of secrets
485
+ # by name or ARN, or you can use filters. If Secrets Manager encounters
486
+ # errors such as `AccessDeniedException` while attempting to retrieve
487
+ # any of the secrets, you can see the errors in `Errors` in the
488
+ # response.
489
+ #
490
+ # Secrets Manager generates CloudTrail `GetSecretValue` log entries for
491
+ # each secret you request when you call this action. Do not include
492
+ # sensitive information in request parameters because it might be
493
+ # logged. For more information, see [Logging Secrets Manager events with
494
+ # CloudTrail][1].
285
495
  #
286
- # To successfully start a rotation, the staging label `AWSPENDING` must
287
- # be in one of the following states:
496
+ # <b>Required permissions: </b> `secretsmanager:BatchGetSecretValue`,
497
+ # and you must have `secretsmanager:GetSecretValue` for each secret. If
498
+ # you use filters, you must also have `secretsmanager:ListSecrets`. If
499
+ # the secrets are encrypted using customer-managed keys instead of the
500
+ # Amazon Web Services managed key `aws/secretsmanager`, then you also
501
+ # need `kms:Decrypt` permissions for the keys. For more information, see
502
+ # [ IAM policy actions for Secrets Manager][2] and [Authentication and
503
+ # access control in Secrets Manager][3].
288
504
  #
289
- # * Not be attached to any version at all
290
505
  #
291
- # * Attached to the same version as the staging label `AWSCURRENT`
292
506
  #
293
- # If the staging label `AWSPENDING` is attached to a different version
294
- # than the version with `AWSCURRENT` then the attempt to rotate fails.
507
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
508
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
509
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
295
510
  #
296
- # **Minimum permissions**
511
+ # @option params [Array<String>] :secret_id_list
512
+ # The ARN or names of the secrets to retrieve. You must include
513
+ # `Filters` or `SecretIdList`, but not both.
297
514
  #
298
- # To run this command, you must have the following permissions:
515
+ # @option params [Array<Types::Filter>] :filters
516
+ # The filters to choose which secrets to retrieve. You must include
517
+ # `Filters` or `SecretIdList`, but not both.
299
518
  #
300
- # * secretsmanager:CancelRotateSecret
519
+ # @option params [Integer] :max_results
520
+ # The number of results to include in the response.
521
+ #
522
+ # If there are more results available, in the response, Secrets Manager
523
+ # includes `NextToken`. To get the next results, call
524
+ # `BatchGetSecretValue` again with the value from `NextToken`. To use
525
+ # this parameter, you must also use the `Filters` parameter.
526
+ #
527
+ # @option params [String] :next_token
528
+ # A token that indicates where the output should continue from, if a
529
+ # previous call did not show all results. To get the next results, call
530
+ # `BatchGetSecretValue` again with this value.
301
531
  #
302
- # ^
532
+ # @return [Types::BatchGetSecretValueResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
303
533
  #
304
- # **Related operations**
534
+ # * {Types::BatchGetSecretValueResponse#secret_values #secret_values} => Array&lt;Types::SecretValueEntry&gt;
535
+ # * {Types::BatchGetSecretValueResponse#next_token #next_token} => String
536
+ # * {Types::BatchGetSecretValueResponse#errors #errors} => Array&lt;Types::APIErrorType&gt;
305
537
  #
306
- # * To configure rotation for a secret or to manually trigger a
307
- # rotation, use RotateSecret.
538
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
308
539
  #
309
- # * To get the rotation configuration details for a secret, use
310
- # DescribeSecret.
311
540
  #
312
- # * To list all of the currently available secrets, use ListSecrets.
541
+ # @example Example: To retrieve the secret values for a group of secrets listed by name
313
542
  #
314
- # * To list all of the versions currently associated with a secret, use
315
- # ListSecretVersionIds.
543
+ # # The following example gets the values for three secrets.
544
+ #
545
+ # resp = client.batch_get_secret_value({
546
+ # secret_id_list: [
547
+ # "MySecret1",
548
+ # "MySecret2",
549
+ # "MySecret3",
550
+ # ],
551
+ # })
552
+ #
553
+ # resp.to_h outputs the following:
554
+ # {
555
+ # errors: [
556
+ # ],
557
+ # secret_values: [
558
+ # {
559
+ # arn: "&region-arn;&asm-service-name;:us-west-2:&ExampleAccountId;:secret:MySecret1-a1b2c3",
560
+ # created_date: Time.parse(1700591229.801),
561
+ # name: "MySecret1",
562
+ # secret_string: "{\"username\":\"diego_ramirez\",\"password\":\"EXAMPLE-PASSWORD\",\"engine\":\"mysql\",\"host\":\"secretsmanagertutorial.cluster.us-west-2.rds.amazonaws.com\",\"port\":3306,\"dbClusterIdentifier\":\"secretsmanagertutorial\"}",
563
+ # version_id: "a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa",
564
+ # version_stages: [
565
+ # "AWSCURRENT",
566
+ # ],
567
+ # },
568
+ # {
569
+ # arn: "&region-arn;&asm-service-name;:us-west-2:&ExampleAccountId;:secret:MySecret2-a1b2c3",
570
+ # created_date: Time.parse(1699911394.105),
571
+ # name: "MySecret2",
572
+ # secret_string: "{\"username\":\"akua_mansa\",\"password\":\"EXAMPLE-PASSWORD\"",
573
+ # version_id: "a1b2c3d4-5678-90ab-cdef-EXAMPLEbbbbb",
574
+ # version_stages: [
575
+ # "AWSCURRENT",
576
+ # ],
577
+ # },
578
+ # {
579
+ # arn: "&region-arn;&asm-service-name;:us-west-2:&ExampleAccountId;:secret:MySecret3-a1b2c3",
580
+ # created_date: Time.parse(1699911394.105),
581
+ # name: "MySecret3",
582
+ # secret_string: "{\"username\":\"jie_liu\",\"password\":\"EXAMPLE-PASSWORD\"",
583
+ # version_id: "a1b2c3d4-5678-90ab-cdef-EXAMPLEccccc",
584
+ # version_stages: [
585
+ # "AWSCURRENT",
586
+ # ],
587
+ # },
588
+ # ],
589
+ # }
590
+ #
591
+ # @example Request syntax with placeholder values
592
+ #
593
+ # resp = client.batch_get_secret_value({
594
+ # secret_id_list: ["SecretIdType"],
595
+ # filters: [
596
+ # {
597
+ # key: "description", # accepts description, name, tag-key, tag-value, primary-region, owning-service, all
598
+ # values: ["FilterValueStringType"],
599
+ # },
600
+ # ],
601
+ # max_results: 1,
602
+ # next_token: "NextTokenType",
603
+ # })
604
+ #
605
+ # @example Response structure
606
+ #
607
+ # resp.secret_values #=> Array
608
+ # resp.secret_values[0].arn #=> String
609
+ # resp.secret_values[0].name #=> String
610
+ # resp.secret_values[0].version_id #=> String
611
+ # resp.secret_values[0].secret_binary #=> String
612
+ # resp.secret_values[0].secret_string #=> String
613
+ # resp.secret_values[0].version_stages #=> Array
614
+ # resp.secret_values[0].version_stages[0] #=> String
615
+ # resp.secret_values[0].created_date #=> Time
616
+ # resp.next_token #=> String
617
+ # resp.errors #=> Array
618
+ # resp.errors[0].secret_id #=> String
619
+ # resp.errors[0].error_code #=> String
620
+ # resp.errors[0].message #=> String
621
+ #
622
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/BatchGetSecretValue AWS API Documentation
623
+ #
624
+ # @overload batch_get_secret_value(params = {})
625
+ # @param [Hash] params ({})
626
+ def batch_get_secret_value(params = {}, options = {})
627
+ req = build_request(:batch_get_secret_value, params)
628
+ req.send_request(options)
629
+ end
630
+
631
+ # Turns off automatic rotation, and if a rotation is currently in
632
+ # progress, cancels the rotation.
633
+ #
634
+ # If you cancel a rotation in progress, it can leave the `VersionStage`
635
+ # labels in an unexpected state. You might need to remove the staging
636
+ # label `AWSPENDING` from the partially created version. You also need
637
+ # to determine whether to roll back to the previous version of the
638
+ # secret by moving the staging label `AWSCURRENT` to the version that
639
+ # has `AWSPENDING`. To determine which version has a specific staging
640
+ # label, call ListSecretVersionIds. Then use UpdateSecretVersionStage to
641
+ # change staging labels. For more information, see [How rotation
642
+ # works][1].
643
+ #
644
+ # To turn on automatic rotation again, call RotateSecret.
645
+ #
646
+ # Secrets Manager generates a CloudTrail log entry when you call this
647
+ # action. Do not include sensitive information in request parameters
648
+ # because it might be logged. For more information, see [Logging Secrets
649
+ # Manager events with CloudTrail][2].
650
+ #
651
+ # <b>Required permissions: </b> `secretsmanager:CancelRotateSecret`. For
652
+ # more information, see [ IAM policy actions for Secrets Manager][3] and
653
+ # [Authentication and access control in Secrets Manager][4].
654
+ #
655
+ #
656
+ #
657
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html
658
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
659
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
660
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
316
661
  #
317
662
  # @option params [required, String] :secret_id
318
- # Specifies the secret for which you want to cancel a rotation request.
319
- # You can specify either the Amazon Resource Name (ARN) or the friendly
320
- # name of the secret.
321
- #
322
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
323
- # complete ARN. You can specify a partial ARN too—for example, if you
324
- # don’t include the final hyphen and six random characters that Secrets
325
- # Manager adds at the end of the ARN when you created the secret. A
326
- # partial ARN match can work as long as it uniquely matches only one
327
- # secret. However, if your secret has a name that ends in a hyphen
328
- # followed by six characters (before Secrets Manager adds the hyphen and
329
- # six characters to the ARN) and you try to use that as a partial ARN,
330
- # then those characters cause Secrets Manager to assume that you’re
331
- # specifying a complete ARN. This confusion can cause unexpected
332
- # results. To avoid this situation, we recommend that you don’t create
333
- # secret names that end with a hyphen followed by six characters.
663
+ # The ARN or name of the secret.
664
+ #
665
+ # For an ARN, we recommend that you specify a complete ARN rather than a
666
+ # partial ARN. See [Finding a secret from a partial ARN][1].
667
+ #
334
668
  #
335
- # </note>
669
+ #
670
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
336
671
  #
337
672
  # @return [Types::CancelRotateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
338
673
  #
@@ -378,119 +713,106 @@ module Aws::SecretsManager
378
713
  req.send_request(options)
379
714
  end
380
715
 
381
- # Creates a new secret. A secret in Secrets Manager consists of both the
382
- # protected secret data and the important information needed to manage
383
- # the secret.
384
- #
385
- # Secrets Manager stores the encrypted secret data in one of a
386
- # collection of "versions" associated with the secret. Each version
387
- # contains a copy of the encrypted secret data. Each version is
388
- # associated with one or more "staging labels" that identify where the
389
- # version is in the rotation cycle. The `SecretVersionsToStages` field
390
- # of the secret contains the mapping of staging labels to the active
391
- # versions of the secret. Versions without a staging label are
392
- # considered deprecated and are not included in the list.
393
- #
394
- # You provide the secret data to be encrypted by putting text in either
395
- # the `SecretString` parameter or binary data in the `SecretBinary`
716
+ # Creates a new secret. A *secret* can be a password, a set of
717
+ # credentials such as a user name and password, an OAuth token, or other
718
+ # secret information that you store in an encrypted form in Secrets
719
+ # Manager. The secret also includes the connection information to access
720
+ # a database or other service, which Secrets Manager doesn't encrypt. A
721
+ # secret in Secrets Manager consists of both the protected secret data
722
+ # and the important information needed to manage the secret.
723
+ #
724
+ # For secrets that use *managed rotation*, you need to create the secret
725
+ # through the managing service. For more information, see [Secrets
726
+ # Manager secrets managed by other Amazon Web Services services][1].
727
+ #
728
+ # For information about creating a secret in the console, see [Create a
729
+ # secret][2].
730
+ #
731
+ # To create a secret, you can provide the secret value to be encrypted
732
+ # in either the `SecretString` parameter or the `SecretBinary`
396
733
  # parameter, but not both. If you include `SecretString` or
397
- # `SecretBinary` then Secrets Manager also creates an initial secret
398
- # version and automatically attaches the staging label `AWSCURRENT` to
399
- # the new version.
400
- #
401
- # <note markdown="1"> * If you call an operation that needs to encrypt or decrypt the
402
- # `SecretString` or `SecretBinary` for a secret in the same account as
403
- # the calling user and that secret doesn't specify a AWS KMS
404
- # encryption key, Secrets Manager uses the account's default AWS
405
- # managed customer master key (CMK) with the alias
406
- # `aws/secretsmanager`. If this key doesn't already exist in your
407
- # account then Secrets Manager creates it for you automatically. All
408
- # users and roles in the same AWS account automatically have access to
409
- # use the default CMK. Note that if an Secrets Manager API call
410
- # results in AWS having to create the account's AWS-managed CMK, it
411
- # can result in a one-time significant delay in returning the result.
412
- #
413
- # * If the secret is in a different AWS account from the credentials
414
- # calling an API that requires encryption or decryption of the secret
415
- # value then you must create and use a custom AWS KMS CMK because you
416
- # can't access the default CMK for the account using credentials from
417
- # a different AWS account. Store the ARN of the CMK in the secret when
418
- # you create the secret or when you update it by including it in the
419
- # `KMSKeyId`. If you call an API that must encrypt or decrypt
420
- # `SecretString` or `SecretBinary` using credentials from a different
421
- # account then the AWS KMS key policy must grant cross-account access
422
- # to that other account's user or role for both the
423
- # kms:GenerateDataKey and kms:Decrypt operations.
424
- #
425
- # </note>
426
- #
427
- #
428
- #
429
- # **Minimum permissions**
430
- #
431
- # To run this command, you must have the following permissions:
432
- #
433
- # * secretsmanager:CreateSecret
434
- #
435
- # * kms:GenerateDataKey - needed only if you use a customer-managed AWS
436
- # KMS key to encrypt the secret. You do not need this permission to
437
- # use the account's default AWS managed CMK for Secrets Manager.
438
- #
439
- # * kms:Decrypt - needed only if you use a customer-managed AWS KMS key
440
- # to encrypt the secret. You do not need this permission to use the
441
- # account's default AWS managed CMK for Secrets Manager.
442
- #
443
- # * secretsmanager:TagResource - needed only if you include the `Tags`
444
- # parameter.
445
- #
446
- # **Related operations**
447
- #
448
- # * To delete a secret, use DeleteSecret.
449
- #
450
- # * To modify an existing secret, use UpdateSecret.
451
- #
452
- # * To create a new version of a secret, use PutSecretValue.
453
- #
454
- # * To retrieve the encrypted secure string and secure binary values,
455
- # use GetSecretValue.
456
- #
457
- # * To retrieve all other details for a secret, use DescribeSecret. This
458
- # does not include the encrypted secure string and secure binary
459
- # values.
460
- #
461
- # * To retrieve the list of secret versions associated with the current
462
- # secret, use DescribeSecret and examine the `SecretVersionsToStages`
463
- # response value.
734
+ # `SecretBinary` then Secrets Manager creates an initial secret version
735
+ # and automatically attaches the staging label `AWSCURRENT` to it.
736
+ #
737
+ # For database credentials you want to rotate, for Secrets Manager to be
738
+ # able to rotate the secret, you must make sure the JSON you store in
739
+ # the `SecretString` matches the [JSON structure of a database
740
+ # secret][3].
741
+ #
742
+ # If you don't specify an KMS encryption key, Secrets Manager uses the
743
+ # Amazon Web Services managed key `aws/secretsmanager`. If this key
744
+ # doesn't already exist in your account, then Secrets Manager creates
745
+ # it for you automatically. All users and roles in the Amazon Web
746
+ # Services account automatically have access to use
747
+ # `aws/secretsmanager`. Creating `aws/secretsmanager` can result in a
748
+ # one-time significant delay in returning the result.
749
+ #
750
+ # If the secret is in a different Amazon Web Services account from the
751
+ # credentials calling the API, then you can't use `aws/secretsmanager`
752
+ # to encrypt the secret, and you must create and use a customer managed
753
+ # KMS key.
754
+ #
755
+ # Secrets Manager generates a CloudTrail log entry when you call this
756
+ # action. Do not include sensitive information in request parameters
757
+ # except `SecretBinary` or `SecretString` because it might be logged.
758
+ # For more information, see [Logging Secrets Manager events with
759
+ # CloudTrail][4].
760
+ #
761
+ # <b>Required permissions: </b> `secretsmanager:CreateSecret`. If you
762
+ # include tags in the secret, you also need
763
+ # `secretsmanager:TagResource`. To add replica Regions, you must also
764
+ # have `secretsmanager:ReplicateSecretToRegions`. For more information,
765
+ # see [ IAM policy actions for Secrets Manager][5] and [Authentication
766
+ # and access control in Secrets Manager][6].
767
+ #
768
+ # To encrypt the secret with a KMS key other than `aws/secretsmanager`,
769
+ # you need `kms:GenerateDataKey` and `kms:Decrypt` permission to the
770
+ # key.
771
+ #
772
+ # When you enter commands in a command shell, there is a risk of the
773
+ # command history being accessed or utilities having access to your
774
+ # command parameters. This is a concern if the command includes the
775
+ # value of a secret. Learn how to [Mitigate the risks of using
776
+ # command-line tools to store Secrets Manager secrets][7].
777
+ #
778
+ #
779
+ #
780
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html
781
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html
782
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_secret_json_structure.html
783
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
784
+ # [5]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
785
+ # [6]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
786
+ # [7]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/security_cli-exposure-risks.html
464
787
  #
465
788
  # @option params [required, String] :name
466
- # Specifies the friendly name of the new secret.
789
+ # The name of the new secret.
467
790
  #
468
- # The secret name must be ASCII letters, digits, or the following
469
- # characters : /\_+=.@-
791
+ # The secret name can contain ASCII letters, numbers, and the following
792
+ # characters: /\_+=.@-
470
793
  #
471
- # <note markdown="1"> Don't end your secret name with a hyphen followed by six characters.
794
+ # Do not end your secret name with a hyphen followed by six characters.
472
795
  # If you do so, you risk confusion and unexpected results when searching
473
- # for a secret by partial ARN. This is because Secrets Manager
474
- # automatically adds a hyphen and six random characters at the end of
796
+ # for a secret by partial ARN. Secrets Manager automatically adds a
797
+ # hyphen and six random characters after the secret name at the end of
475
798
  # the ARN.
476
799
  #
477
- # </note>
478
- #
479
800
  # @option params [String] :client_request_token
480
- # (Optional) If you include `SecretString` or `SecretBinary`, then an
481
- # initial version is created as part of the secret, and this parameter
482
- # specifies a unique identifier for the new version.
483
- #
484
- # <note markdown="1"> If you use the AWS CLI or one of the AWS SDK to call this operation,
485
- # then you can leave this parameter empty. The CLI or SDK generates a
486
- # random UUID for you and includes it as the value for this parameter in
487
- # the request. If you don't use the SDK and instead generate a raw HTTP
488
- # request to the Secrets Manager service endpoint, then you must
489
- # generate a `ClientRequestToken` yourself for the new version and
490
- # include that value in the request.
801
+ # If you include `SecretString` or `SecretBinary`, then Secrets Manager
802
+ # creates an initial version for the secret, and this parameter
803
+ # specifies the unique identifier for the new version.
804
+ #
805
+ # <note markdown="1"> If you use the Amazon Web Services CLI or one of the Amazon Web
806
+ # Services SDKs to call this operation, then you can leave this
807
+ # parameter empty. The CLI or SDK generates a random UUID for you and
808
+ # includes it as the value for this parameter in the request.
491
809
  #
492
810
  # </note>
493
811
  #
812
+ # If you generate a raw HTTP request to the Secrets Manager service
813
+ # endpoint, then you must generate a `ClientRequestToken` and include it
814
+ # in the request.
815
+ #
494
816
  # This value helps ensure idempotency. Secrets Manager uses this value
495
817
  # to prevent the accidental creation of duplicate versions if there are
496
818
  # failures and retries during a rotation. We recommend that you generate
@@ -500,14 +822,13 @@ module Aws::SecretsManager
500
822
  # * If the `ClientRequestToken` value isn't already associated with a
501
823
  # version of the secret then a new version of the secret is created.
502
824
  #
503
- # * If a version with this value already exists and that version's
825
+ # * If a version with this value already exists and the version
504
826
  # `SecretString` and `SecretBinary` values are the same as those in
505
- # the request, then the request is ignored (the operation is
506
- # idempotent).
827
+ # the request, then the request is ignored.
507
828
  #
508
829
  # * If a version with this value already exists and that version's
509
830
  # `SecretString` and `SecretBinary` values are different from those in
510
- # the request then the request fails because you cannot modify an
831
+ # the request, then the request fails because you cannot modify an
511
832
  # existing version. Instead, use PutSecretValue to create a new
512
833
  # version.
513
834
  #
@@ -521,127 +842,111 @@ module Aws::SecretsManager
521
842
  # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
522
843
  #
523
844
  # @option params [String] :description
524
- # (Optional) Specifies a user-provided description of the secret.
845
+ # The description of the secret.
525
846
  #
526
847
  # @option params [String] :kms_key_id
527
- # (Optional) Specifies the ARN, Key ID, or alias of the AWS KMS customer
528
- # master key (CMK) to be used to encrypt the `SecretString` or
529
- # `SecretBinary` values in the versions stored in this secret.
530
- #
531
- # You can specify any of the supported ways to identify a AWS KMS key
532
- # ID. If you need to reference a CMK in a different account, you can use
533
- # only the key ARN or the alias ARN.
534
- #
535
- # If you don't specify this value, then Secrets Manager defaults to
536
- # using the AWS account's default CMK (the one named
537
- # `aws/secretsmanager`). If a AWS KMS CMK with that name doesn't yet
538
- # exist, then Secrets Manager creates it for you automatically the first
539
- # time it needs to encrypt a version's `SecretString` or `SecretBinary`
540
- # fields.
541
- #
542
- # You can use the account's default CMK to encrypt and decrypt only if
543
- # you call this operation using credentials from the same account that
544
- # owns the secret. If the secret is in a different account, then you
545
- # must create a custom CMK and specify the ARN in this field.
546
- #
547
- # @option params [String, IO] :secret_binary
548
- # (Optional) Specifies binary data that you want to encrypt and store in
549
- # the new version of the secret. To use this parameter in the
550
- # command-line tools, we recommend that you store your binary data in a
551
- # file and then use the appropriate technique for your tool to pass the
552
- # contents of the file as a parameter.
848
+ # The ARN, key ID, or alias of the KMS key that Secrets Manager uses to
849
+ # encrypt the secret value in the secret. An alias is always prefixed by
850
+ # `alias/`, for example `alias/aws/secretsmanager`. For more
851
+ # information, see [About aliases][1].
852
+ #
853
+ # To use a KMS key in a different account, use the key ARN or the alias
854
+ # ARN.
855
+ #
856
+ # If you don't specify this value, then Secrets Manager uses the key
857
+ # `aws/secretsmanager`. If that key doesn't yet exist, then Secrets
858
+ # Manager creates it for you automatically the first time it encrypts
859
+ # the secret value.
860
+ #
861
+ # If the secret is in a different Amazon Web Services account from the
862
+ # credentials calling the API, then you can't use `aws/secretsmanager`
863
+ # to encrypt the secret, and you must create and use a customer managed
864
+ # KMS key.
865
+ #
866
+ #
867
+ #
868
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html
869
+ #
870
+ # @option params [String, StringIO, File] :secret_binary
871
+ # The binary data to encrypt and store in the new version of the secret.
872
+ # We recommend that you store your binary data in a file and then pass
873
+ # the contents of the file as a parameter.
553
874
  #
554
875
  # Either `SecretString` or `SecretBinary` must have a value, but not
555
- # both. They cannot both be empty.
876
+ # both.
877
+ #
878
+ # This parameter is not available in the Secrets Manager console.
556
879
  #
557
- # This parameter is not available using the Secrets Manager console. It
558
- # can be accessed only by using the AWS CLI or one of the AWS SDKs.
880
+ # Sensitive: This field contains sensitive information, so the service
881
+ # does not include it in CloudTrail log entries. If you create your own
882
+ # log entries, you must also avoid logging the information in this
883
+ # field.
559
884
  #
560
885
  # @option params [String] :secret_string
561
- # (Optional) Specifies text data that you want to encrypt and store in
562
- # this new version of the secret.
886
+ # The text data to encrypt and store in this new version of the secret.
887
+ # We recommend you use a JSON structure of key/value pairs for your
888
+ # secret value.
563
889
  #
564
890
  # Either `SecretString` or `SecretBinary` must have a value, but not
565
- # both. They cannot both be empty.
891
+ # both.
566
892
  #
567
893
  # If you create a secret by using the Secrets Manager console then
568
894
  # Secrets Manager puts the protected secret text in only the
569
895
  # `SecretString` parameter. The Secrets Manager console stores the
570
- # information as a JSON structure of key/value pairs that the Lambda
571
- # rotation function knows how to parse.
572
- #
573
- # For storing multiple values, we recommend that you use a JSON text
574
- # string argument and specify key/value pairs. For information on how to
575
- # format a JSON parameter for the various command line tool
576
- # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
577
- # Guide*. For example:
578
- #
579
- # `[\{"username":"bob"\},\{"password":"abc123xyz456"\}]`
580
- #
581
- # If your command-line tool or SDK requires quotation marks around the
582
- # parameter, you should use single quotes to avoid confusion with the
583
- # double quotes required in the JSON text.
896
+ # information as a JSON structure of key/value pairs that a Lambda
897
+ # rotation function can parse.
584
898
  #
585
- #
586
- #
587
- # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
899
+ # Sensitive: This field contains sensitive information, so the service
900
+ # does not include it in CloudTrail log entries. If you create your own
901
+ # log entries, you must also avoid logging the information in this
902
+ # field.
588
903
  #
589
904
  # @option params [Array<Types::Tag>] :tags
590
- # (Optional) Specifies a list of user-defined tags that are attached to
591
- # the secret. Each tag is a "Key" and "Value" pair of strings. This
592
- # operation only appends tags to the existing list of tags. To remove
593
- # tags, you must use UntagResource.
905
+ # A list of tags to attach to the secret. Each tag is a key and value
906
+ # pair of strings in a JSON text string, for example:
594
907
  #
595
- # * Secrets Manager tag key names are case sensitive. A tag with the key
596
- # "ABC" is a different tag from one with key "abc".
908
+ # `[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]`
597
909
  #
598
- # * If you check tags in IAM policy `Condition` elements as part of your
599
- # security strategy, then adding or removing a tag can change
600
- # permissions. If the successful completion of this operation would
601
- # result in you losing your permissions for this secret, then this
602
- # operation is blocked and returns an `Access Denied` error.
910
+ # Secrets Manager tag key names are case sensitive. A tag with the key
911
+ # "ABC" is a different tag from one with key "abc".
603
912
  #
604
- # This parameter requires a JSON text string argument. For information
605
- # on how to format a JSON parameter for the various command line tool
606
- # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
607
- # Guide*. For example:
913
+ # If you check tags in permissions policies as part of your security
914
+ # strategy, then adding or removing a tag can change permissions. If the
915
+ # completion of this operation would result in you losing your
916
+ # permissions for this secret, then Secrets Manager blocks the operation
917
+ # and returns an `Access Denied` error. For more information, see
918
+ # [Control access to secrets using tags][1] and [Limit access to
919
+ # identities with tags that match secrets' tags][2].
608
920
  #
609
- # `[\{"Key":"CostCenter","Value":"12345"\},\{"Key":"environment","Value":"production"\}]`
610
- #
611
- # If your command-line tool or SDK requires quotation marks around the
921
+ # For information about how to format a JSON parameter for the various
922
+ # command line tool environments, see [Using JSON for Parameters][3]. If
923
+ # your command-line tool or SDK requires quotation marks around the
612
924
  # parameter, you should use single quotes to avoid confusion with the
613
925
  # double quotes required in the JSON text.
614
926
  #
615
- # The following basic restrictions apply to tags:
616
- #
617
- # * Maximum number of tags per secret—50
618
- #
619
- # * Maximum key length—127 Unicode characters in UTF-8
620
- #
621
- # * Maximum value length—255 Unicode characters in UTF-8
622
- #
623
- # * Tag keys and values are case sensitive.
927
+ # For tag quotas and naming restrictions, see [Service quotas for
928
+ # Tagging][4] in the *Amazon Web Services General Reference guide*.
624
929
  #
625
- # * Do not use the `aws:` prefix in your tag names or values because it
626
- # is reserved for AWS use. You can't edit or delete tag names or
627
- # values with this prefix. Tags with this prefix do not count against
628
- # your tags per secret limit.
629
930
  #
630
- # * If your tagging schema will be used across multiple services and
631
- # resources, remember that other services might have restrictions on
632
- # allowed characters. Generally allowed characters are: letters,
633
- # spaces, and numbers representable in UTF-8, plus the following
634
- # special characters: + - = . \_ : / @.
635
931
  #
932
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac
933
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2
934
+ # [3]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
935
+ # [4]: https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas
636
936
  #
937
+ # @option params [Array<Types::ReplicaRegionType>] :add_replica_regions
938
+ # A list of Regions and KMS keys to replicate secrets.
637
939
  #
638
- # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
940
+ # @option params [Boolean] :force_overwrite_replica_secret
941
+ # Specifies whether to overwrite a secret with the same name in the
942
+ # destination Region. By default, secrets aren't overwritten.
639
943
  #
640
944
  # @return [Types::CreateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
641
945
  #
642
946
  # * {Types::CreateSecretResponse#arn #arn} => String
643
947
  # * {Types::CreateSecretResponse#name #name} => String
644
948
  # * {Types::CreateSecretResponse#version_id #version_id} => String
949
+ # * {Types::CreateSecretResponse#replication_status #replication_status} => Array&lt;Types::ReplicationStatusType&gt;
645
950
  #
646
951
  #
647
952
  # @example Example: To create a basic secret
@@ -653,7 +958,7 @@ module Aws::SecretsManager
653
958
  # client_request_token: "EXAMPLE1-90ab-cdef-fedc-ba987SECRET1",
654
959
  # description: "My test database secret created with the CLI",
655
960
  # name: "MyTestDatabaseSecret",
656
- # secret_string: "{\"username\":\"david\",\"password\":\"BnQw!XDWgaEeT9XGTT29\"}",
961
+ # secret_string: "{\"username\":\"david\",\"password\":\"EXAMPLE-PASSWORD\"}",
657
962
  # })
658
963
  #
659
964
  # resp.to_h outputs the following:
@@ -678,6 +983,13 @@ module Aws::SecretsManager
678
983
  # value: "TagValueType",
679
984
  # },
680
985
  # ],
986
+ # add_replica_regions: [
987
+ # {
988
+ # region: "RegionType",
989
+ # kms_key_id: "KmsKeyIdType",
990
+ # },
991
+ # ],
992
+ # force_overwrite_replica_secret: false,
681
993
  # })
682
994
  #
683
995
  # @example Response structure
@@ -685,6 +997,12 @@ module Aws::SecretsManager
685
997
  # resp.arn #=> String
686
998
  # resp.name #=> String
687
999
  # resp.version_id #=> String
1000
+ # resp.replication_status #=> Array
1001
+ # resp.replication_status[0].region #=> String
1002
+ # resp.replication_status[0].kms_key_id #=> String
1003
+ # resp.replication_status[0].status #=> String, one of "InSync", "Failed", "InProgress"
1004
+ # resp.replication_status[0].status_message #=> String
1005
+ # resp.replication_status[0].last_accessed_date #=> Time
688
1006
  #
689
1007
  # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/CreateSecret AWS API Documentation
690
1008
  #
@@ -695,45 +1013,34 @@ module Aws::SecretsManager
695
1013
  req.send_request(options)
696
1014
  end
697
1015
 
698
- # Deletes the resource-based permission policy that's attached to the
699
- # secret.
1016
+ # Deletes the resource-based permission policy attached to the secret.
1017
+ # To attach a policy to a secret, use PutResourcePolicy.
700
1018
  #
701
- # **Minimum permissions**
1019
+ # Secrets Manager generates a CloudTrail log entry when you call this
1020
+ # action. Do not include sensitive information in request parameters
1021
+ # because it might be logged. For more information, see [Logging Secrets
1022
+ # Manager events with CloudTrail][1].
702
1023
  #
703
- # To run this command, you must have the following permissions:
1024
+ # <b>Required permissions: </b> `secretsmanager:DeleteResourcePolicy`.
1025
+ # For more information, see [ IAM policy actions for Secrets Manager][2]
1026
+ # and [Authentication and access control in Secrets Manager][3].
704
1027
  #
705
- # * secretsmanager:DeleteResourcePolicy
706
1028
  #
707
- # ^
708
1029
  #
709
- # **Related operations**
1030
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1031
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1032
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
710
1033
  #
711
- # * To attach a resource policy to a secret, use PutResourcePolicy.
1034
+ # @option params [required, String] :secret_id
1035
+ # The ARN or name of the secret to delete the attached resource-based
1036
+ # policy for.
712
1037
  #
713
- # * To retrieve the current resource-based policy that's attached to a
714
- # secret, use GetResourcePolicy.
1038
+ # For an ARN, we recommend that you specify a complete ARN rather than a
1039
+ # partial ARN. See [Finding a secret from a partial ARN][1].
715
1040
  #
716
- # * To list all of the currently available secrets, use ListSecrets.
717
1041
  #
718
- # @option params [required, String] :secret_id
719
- # Specifies the secret that you want to delete the attached
720
- # resource-based policy for. You can specify either the Amazon Resource
721
- # Name (ARN) or the friendly name of the secret.
722
- #
723
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
724
- # complete ARN. You can specify a partial ARN too—for example, if you
725
- # don’t include the final hyphen and six random characters that Secrets
726
- # Manager adds at the end of the ARN when you created the secret. A
727
- # partial ARN match can work as long as it uniquely matches only one
728
- # secret. However, if your secret has a name that ends in a hyphen
729
- # followed by six characters (before Secrets Manager adds the hyphen and
730
- # six characters to the ARN) and you try to use that as a partial ARN,
731
- # then those characters cause Secrets Manager to assume that you’re
732
- # specifying a complete ARN. This confusion can cause unexpected
733
- # results. To avoid this situation, we recommend that you don’t create
734
- # secret names that end with a hyphen followed by six characters.
735
1042
  #
736
- # </note>
1043
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
737
1044
  #
738
1045
  # @return [Types::DeleteResourcePolicyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
739
1046
  #
@@ -751,7 +1058,7 @@ module Aws::SecretsManager
751
1058
  #
752
1059
  # resp.to_h outputs the following:
753
1060
  # {
754
- # arn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseMasterSecret-a1b2c3",
1061
+ # arn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
755
1062
  # name: "MyTestDatabaseSecret",
756
1063
  # }
757
1064
  #
@@ -775,93 +1082,93 @@ module Aws::SecretsManager
775
1082
  req.send_request(options)
776
1083
  end
777
1084
 
778
- # Deletes an entire secret and all of its versions. You can optionally
779
- # include a recovery window during which you can restore the secret. If
780
- # you don't specify a recovery window value, the operation defaults to
781
- # 30 days. Secrets Manager attaches a `DeletionDate` stamp to the secret
782
- # that specifies the end of the recovery window. At the end of the
783
- # recovery window, Secrets Manager deletes the secret permanently.
1085
+ # Deletes a secret and all of its versions. You can specify a recovery
1086
+ # window during which you can restore the secret. The minimum recovery
1087
+ # window is 7 days. The default recovery window is 30 days. Secrets
1088
+ # Manager attaches a `DeletionDate` stamp to the secret that specifies
1089
+ # the end of the recovery window. At the end of the recovery window,
1090
+ # Secrets Manager deletes the secret permanently.
1091
+ #
1092
+ # You can't delete a primary secret that is replicated to other
1093
+ # Regions. You must first delete the replicas using
1094
+ # RemoveRegionsFromReplication, and then delete the primary secret. When
1095
+ # you delete a replica, it is deleted immediately.
1096
+ #
1097
+ # You can't directly delete a version of a secret. Instead, you remove
1098
+ # all staging labels from the version using UpdateSecretVersionStage.
1099
+ # This marks the version as deprecated, and then Secrets Manager can
1100
+ # automatically delete the version in the background.
1101
+ #
1102
+ # To determine whether an application still uses a secret, you can
1103
+ # create an Amazon CloudWatch alarm to alert you to any attempts to
1104
+ # access a secret during the recovery window. For more information, see
1105
+ # [ Monitor secrets scheduled for deletion][1].
1106
+ #
1107
+ # Secrets Manager performs the permanent secret deletion at the end of
1108
+ # the waiting period as a background task with low priority. There is no
1109
+ # guarantee of a specific time after the recovery window for the
1110
+ # permanent delete to occur.
784
1111
  #
785
1112
  # At any time before recovery window ends, you can use RestoreSecret to
786
1113
  # remove the `DeletionDate` and cancel the deletion of the secret.
787
1114
  #
788
- # You cannot access the encrypted secret information in any secret that
789
- # is scheduled for deletion. If you need to access that information, you
790
- # must cancel the deletion with RestoreSecret and then retrieve the
791
- # information.
792
- #
793
- # <note markdown="1"> * There is no explicit operation to delete a version of a secret.
794
- # Instead, remove all staging labels from the `VersionStage` field of
795
- # a version. That marks the version as deprecated and allows Secrets
796
- # Manager to delete it as needed. Versions that do not have any
797
- # staging labels do not show up in ListSecretVersionIds unless you
798
- # specify `IncludeDeprecated`.
1115
+ # When a secret is scheduled for deletion, you cannot retrieve the
1116
+ # secret value. You must first cancel the deletion with RestoreSecret
1117
+ # and then you can retrieve the secret.
799
1118
  #
800
- # * The permanent secret deletion at the end of the waiting period is
801
- # performed as a background task with low priority. There is no
802
- # guarantee of a specific time after the recovery window for the
803
- # actual delete operation to occur.
1119
+ # Secrets Manager generates a CloudTrail log entry when you call this
1120
+ # action. Do not include sensitive information in request parameters
1121
+ # because it might be logged. For more information, see [Logging Secrets
1122
+ # Manager events with CloudTrail][2].
804
1123
  #
805
- # </note>
806
- #
807
- # **Minimum permissions**
1124
+ # <b>Required permissions: </b> `secretsmanager:DeleteSecret`. For more
1125
+ # information, see [ IAM policy actions for Secrets Manager][3] and
1126
+ # [Authentication and access control in Secrets Manager][4].
808
1127
  #
809
- # To run this command, you must have the following permissions:
810
1128
  #
811
- # * secretsmanager:DeleteSecret
812
1129
  #
813
- # ^
1130
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring_cloudwatch_deleted-secrets.html
1131
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1132
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1133
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
814
1134
  #
815
- # **Related operations**
1135
+ # @option params [required, String] :secret_id
1136
+ # The ARN or name of the secret to delete.
816
1137
  #
817
- # * To create a secret, use CreateSecret.
1138
+ # For an ARN, we recommend that you specify a complete ARN rather than a
1139
+ # partial ARN. See [Finding a secret from a partial ARN][1].
818
1140
  #
819
- # * To cancel deletion of a version of a secret before the recovery
820
- # window has expired, use RestoreSecret.
821
1141
  #
822
- # @option params [required, String] :secret_id
823
- # Specifies the secret that you want to delete. You can specify either
824
- # the Amazon Resource Name (ARN) or the friendly name of the secret.
825
- #
826
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
827
- # complete ARN. You can specify a partial ARN too—for example, if you
828
- # don’t include the final hyphen and six random characters that Secrets
829
- # Manager adds at the end of the ARN when you created the secret. A
830
- # partial ARN match can work as long as it uniquely matches only one
831
- # secret. However, if your secret has a name that ends in a hyphen
832
- # followed by six characters (before Secrets Manager adds the hyphen and
833
- # six characters to the ARN) and you try to use that as a partial ARN,
834
- # then those characters cause Secrets Manager to assume that you’re
835
- # specifying a complete ARN. This confusion can cause unexpected
836
- # results. To avoid this situation, we recommend that you don’t create
837
- # secret names that end with a hyphen followed by six characters.
838
1142
  #
839
- # </note>
1143
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
840
1144
  #
841
1145
  # @option params [Integer] :recovery_window_in_days
842
- # (Optional) Specifies the number of days that Secrets Manager waits
843
- # before it can delete the secret. You can't use both this parameter
844
- # and the `ForceDeleteWithoutRecovery` parameter in the same API call.
845
- #
846
- # This value can range from 7 to 30 days. The default value is 30.
1146
+ # The number of days from 7 to 30 that Secrets Manager waits before
1147
+ # permanently deleting the secret. You can't use both this parameter
1148
+ # and `ForceDeleteWithoutRecovery` in the same call. If you don't use
1149
+ # either, then by default Secrets Manager uses a 30 day recovery window.
847
1150
  #
848
1151
  # @option params [Boolean] :force_delete_without_recovery
849
- # (Optional) Specifies that the secret is to be deleted without any
850
- # recovery window. You can't use both this parameter and the
851
- # `RecoveryWindowInDays` parameter in the same API call.
1152
+ # Specifies whether to delete the secret without any recovery window.
1153
+ # You can't use both this parameter and `RecoveryWindowInDays` in the
1154
+ # same call. If you don't use either, then by default Secrets Manager
1155
+ # uses a 30 day recovery window.
852
1156
  #
853
- # An asynchronous background process performs the actual deletion, so
854
- # there can be a short delay before the operation completes. If you
855
- # write code to delete and then immediately recreate a secret with the
856
- # same name, ensure that your code includes appropriate back off and
857
- # retry logic.
1157
+ # Secrets Manager performs the actual deletion with an asynchronous
1158
+ # background process, so there might be a short delay before the secret
1159
+ # is permanently deleted. If you delete a secret and then immediately
1160
+ # create a secret with the same name, use appropriate back off and retry
1161
+ # logic.
1162
+ #
1163
+ # If you forcibly delete an already deleted or nonexistent secret, the
1164
+ # operation does not return `ResourceNotFoundException`.
858
1165
  #
859
1166
  # Use this parameter with caution. This parameter causes the operation
860
- # to skip the normal waiting period before the permanent deletion that
861
- # AWS would normally impose with the `RecoveryWindowInDays` parameter.
862
- # If you delete a secret with the `ForceDeleteWithouRecovery` parameter,
863
- # then you have no opportunity to recover the secret. It is permanently
864
- # lost.
1167
+ # to skip the normal recovery window before the permanent deletion that
1168
+ # Secrets Manager would normally impose with the `RecoveryWindowInDays`
1169
+ # parameter. If you delete a secret with the
1170
+ # `ForceDeleteWithoutRecovery` parameter, then you have no opportunity
1171
+ # to recover the secret. You lose the secret permanently.
865
1172
  #
866
1173
  # @return [Types::DeleteSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
867
1174
  #
@@ -912,47 +1219,33 @@ module Aws::SecretsManager
912
1219
  end
913
1220
 
914
1221
  # Retrieves the details of a secret. It does not include the encrypted
915
- # fields. Only those fields that are populated with a value are returned
916
- # in the response.
917
- #
918
- # **Minimum permissions**
1222
+ # secret value. Secrets Manager only returns fields that have a value in
1223
+ # the response.
919
1224
  #
920
- # To run this command, you must have the following permissions:
1225
+ # Secrets Manager generates a CloudTrail log entry when you call this
1226
+ # action. Do not include sensitive information in request parameters
1227
+ # because it might be logged. For more information, see [Logging Secrets
1228
+ # Manager events with CloudTrail][1].
921
1229
  #
922
- # * secretsmanager:DescribeSecret
1230
+ # <b>Required permissions: </b> `secretsmanager:DescribeSecret`. For
1231
+ # more information, see [ IAM policy actions for Secrets Manager][2] and
1232
+ # [Authentication and access control in Secrets Manager][3].
923
1233
  #
924
- # ^
925
1234
  #
926
- # **Related operations**
927
1235
  #
928
- # * To create a secret, use CreateSecret.
1236
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1237
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1238
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
929
1239
  #
930
- # * To modify a secret, use UpdateSecret.
1240
+ # @option params [required, String] :secret_id
1241
+ # The ARN or name of the secret.
931
1242
  #
932
- # * To retrieve the encrypted secret information in a version of the
933
- # secret, use GetSecretValue.
1243
+ # For an ARN, we recommend that you specify a complete ARN rather than a
1244
+ # partial ARN. See [Finding a secret from a partial ARN][1].
934
1245
  #
935
- # * To list all of the secrets in the AWS account, use ListSecrets.
936
1246
  #
937
- # @option params [required, String] :secret_id
938
- # The identifier of the secret whose details you want to retrieve. You
939
- # can specify either the Amazon Resource Name (ARN) or the friendly name
940
- # of the secret.
941
- #
942
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
943
- # complete ARN. You can specify a partial ARN too—for example, if you
944
- # don’t include the final hyphen and six random characters that Secrets
945
- # Manager adds at the end of the ARN when you created the secret. A
946
- # partial ARN match can work as long as it uniquely matches only one
947
- # secret. However, if your secret has a name that ends in a hyphen
948
- # followed by six characters (before Secrets Manager adds the hyphen and
949
- # six characters to the ARN) and you try to use that as a partial ARN,
950
- # then those characters cause Secrets Manager to assume that you’re
951
- # specifying a complete ARN. This confusion can cause unexpected
952
- # results. To avoid this situation, we recommend that you don’t create
953
- # secret names that end with a hyphen followed by six characters.
954
1247
  #
955
- # </note>
1248
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
956
1249
  #
957
1250
  # @return [Types::DescribeSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
958
1251
  #
@@ -967,9 +1260,13 @@ module Aws::SecretsManager
967
1260
  # * {Types::DescribeSecretResponse#last_changed_date #last_changed_date} => Time
968
1261
  # * {Types::DescribeSecretResponse#last_accessed_date #last_accessed_date} => Time
969
1262
  # * {Types::DescribeSecretResponse#deleted_date #deleted_date} => Time
1263
+ # * {Types::DescribeSecretResponse#next_rotation_date #next_rotation_date} => Time
970
1264
  # * {Types::DescribeSecretResponse#tags #tags} => Array&lt;Types::Tag&gt;
971
1265
  # * {Types::DescribeSecretResponse#version_ids_to_stages #version_ids_to_stages} => Hash&lt;String,Array&lt;String&gt;&gt;
972
1266
  # * {Types::DescribeSecretResponse#owning_service #owning_service} => String
1267
+ # * {Types::DescribeSecretResponse#created_date #created_date} => Time
1268
+ # * {Types::DescribeSecretResponse#primary_region #primary_region} => String
1269
+ # * {Types::DescribeSecretResponse#replication_status #replication_status} => Array&lt;Types::ReplicationStatusType&gt;
973
1270
  #
974
1271
  #
975
1272
  # @example Example: To retrieve the details of a secret
@@ -989,10 +1286,13 @@ module Aws::SecretsManager
989
1286
  # last_changed_date: Time.parse(1523477145.729),
990
1287
  # last_rotated_date: Time.parse(1525747253.72),
991
1288
  # name: "MyTestDatabaseSecret",
1289
+ # next_rotation_date: Time.parse("1665165599"),
992
1290
  # rotation_enabled: true,
993
1291
  # rotation_lambda_arn: "arn:aws:lambda:us-west-2:123456789012:function:MyTestRotationLambda",
994
1292
  # rotation_rules: {
995
- # automatically_after_days: 30,
1293
+ # automatically_after_days: 14,
1294
+ # duration: "2h",
1295
+ # schedule_expression: "cron(0 16 1,15 * ? *)",
996
1296
  # },
997
1297
  # tags: [
998
1298
  # {
@@ -1029,10 +1329,13 @@ module Aws::SecretsManager
1029
1329
  # resp.rotation_enabled #=> Boolean
1030
1330
  # resp.rotation_lambda_arn #=> String
1031
1331
  # resp.rotation_rules.automatically_after_days #=> Integer
1332
+ # resp.rotation_rules.duration #=> String
1333
+ # resp.rotation_rules.schedule_expression #=> String
1032
1334
  # resp.last_rotated_date #=> Time
1033
1335
  # resp.last_changed_date #=> Time
1034
1336
  # resp.last_accessed_date #=> Time
1035
1337
  # resp.deleted_date #=> Time
1338
+ # resp.next_rotation_date #=> Time
1036
1339
  # resp.tags #=> Array
1037
1340
  # resp.tags[0].key #=> String
1038
1341
  # resp.tags[0].value #=> String
@@ -1040,6 +1343,14 @@ module Aws::SecretsManager
1040
1343
  # resp.version_ids_to_stages["SecretVersionIdType"] #=> Array
1041
1344
  # resp.version_ids_to_stages["SecretVersionIdType"][0] #=> String
1042
1345
  # resp.owning_service #=> String
1346
+ # resp.created_date #=> Time
1347
+ # resp.primary_region #=> String
1348
+ # resp.replication_status #=> Array
1349
+ # resp.replication_status[0].region #=> String
1350
+ # resp.replication_status[0].kms_key_id #=> String
1351
+ # resp.replication_status[0].status #=> String, one of "InSync", "Failed", "InProgress"
1352
+ # resp.replication_status[0].status_message #=> String
1353
+ # resp.replication_status[0].last_accessed_date #=> Time
1043
1354
  #
1044
1355
  # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/DescribeSecret AWS API Documentation
1045
1356
  #
@@ -1050,66 +1361,59 @@ module Aws::SecretsManager
1050
1361
  req.send_request(options)
1051
1362
  end
1052
1363
 
1053
- # Generates a random password of the specified complexity. This
1054
- # operation is intended for use in the Lambda rotation function. Per
1055
- # best practice, we recommend that you specify the maximum length and
1056
- # include every character type that the system you are generating a
1057
- # password for can support.
1364
+ # Generates a random password. We recommend that you specify the maximum
1365
+ # length and include every character type that the system you are
1366
+ # generating a password for can support. By default, Secrets Manager
1367
+ # uses uppercase and lowercase letters, numbers, and the following
1368
+ # characters in passwords: `` !"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ``
1058
1369
  #
1059
- # **Minimum permissions**
1370
+ # Secrets Manager generates a CloudTrail log entry when you call this
1371
+ # action.
1060
1372
  #
1061
- # To run this command, you must have the following permissions:
1373
+ # <b>Required permissions: </b> `secretsmanager:GetRandomPassword`. For
1374
+ # more information, see [ IAM policy actions for Secrets Manager][1] and
1375
+ # [Authentication and access control in Secrets Manager][2].
1062
1376
  #
1063
- # * secretsmanager:GetRandomPassword
1064
1377
  #
1065
- # ^
1378
+ #
1379
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1380
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
1066
1381
  #
1067
1382
  # @option params [Integer] :password_length
1068
- # The desired length of the generated password. The default value if you
1069
- # do not include this parameter is 32 characters.
1383
+ # The length of the password. If you don't include this parameter, the
1384
+ # default length is 32 characters.
1070
1385
  #
1071
1386
  # @option params [String] :exclude_characters
1072
- # A string that includes characters that should not be included in the
1073
- # generated password. The default is that all characters from the
1074
- # included sets can be used.
1387
+ # A string of the characters that you don't want in the password.
1075
1388
  #
1076
1389
  # @option params [Boolean] :exclude_numbers
1077
- # Specifies that the generated password should not include digits. The
1078
- # default if you do not include this switch parameter is that digits can
1079
- # be included.
1390
+ # Specifies whether to exclude numbers from the password. If you don't
1391
+ # include this switch, the password can contain numbers.
1080
1392
  #
1081
1393
  # @option params [Boolean] :exclude_punctuation
1082
- # Specifies that the generated password should not include punctuation
1083
- # characters. The default if you do not include this switch parameter is
1084
- # that punctuation characters can be included.
1085
- #
1086
- # The following are the punctuation characters that *can* be included in
1087
- # the generated password if you don't explicitly exclude them with
1088
- # `ExcludeCharacters` or `ExcludePunctuation`\:
1089
- #
1090
- # `` ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` \{ | \} ~
1091
- # ``
1394
+ # Specifies whether to exclude the following punctuation characters from
1395
+ # the password: `` ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _
1396
+ # ` { | } ~ ``. If you don't include this switch, the password can
1397
+ # contain punctuation.
1092
1398
  #
1093
1399
  # @option params [Boolean] :exclude_uppercase
1094
- # Specifies that the generated password should not include uppercase
1095
- # letters. The default if you do not include this switch parameter is
1096
- # that uppercase letters can be included.
1400
+ # Specifies whether to exclude uppercase letters from the password. If
1401
+ # you don't include this switch, the password can contain uppercase
1402
+ # letters.
1097
1403
  #
1098
1404
  # @option params [Boolean] :exclude_lowercase
1099
- # Specifies that the generated password should not include lowercase
1100
- # letters. The default if you do not include this switch parameter is
1101
- # that lowercase letters can be included.
1405
+ # Specifies whether to exclude lowercase letters from the password. If
1406
+ # you don't include this switch, the password can contain lowercase
1407
+ # letters.
1102
1408
  #
1103
1409
  # @option params [Boolean] :include_space
1104
- # Specifies that the generated password can include the space character.
1105
- # The default if you do not include this switch parameter is that the
1106
- # space character is not included.
1410
+ # Specifies whether to include the space character. If you include this
1411
+ # switch, the password can contain space characters.
1107
1412
  #
1108
1413
  # @option params [Boolean] :require_each_included_type
1109
- # A boolean value that specifies whether the generated password must
1110
- # include at least one of every allowed character type. The default
1111
- # value is `True` and the operation requires at least one of every
1112
- # character type.
1414
+ # Specifies whether to include at least one upper and lowercase letter,
1415
+ # one number, and one punctuation. If you don't include this switch,
1416
+ # the password contains at least one of every character type.
1113
1417
  #
1114
1418
  # @return [Types::GetRandomPasswordResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1115
1419
  #
@@ -1129,7 +1433,7 @@ module Aws::SecretsManager
1129
1433
  #
1130
1434
  # resp.to_h outputs the following:
1131
1435
  # {
1132
- # random_password: "N+Z43a,>vx7j O8^*<8i3",
1436
+ # random_password: "EXAMPLE-PASSWORD",
1133
1437
  # }
1134
1438
  #
1135
1439
  # @example Request syntax with placeholder values
@@ -1158,48 +1462,37 @@ module Aws::SecretsManager
1158
1462
  req.send_request(options)
1159
1463
  end
1160
1464
 
1161
- # Retrieves the JSON text of the resource-based policy document that's
1162
- # attached to the specified secret. The JSON request string input and
1163
- # response output are shown formatted with white space and line breaks
1164
- # for better readability. Submit your input as a single line JSON
1165
- # string.
1465
+ # Retrieves the JSON text of the resource-based policy document attached
1466
+ # to the secret. For more information about permissions policies
1467
+ # attached to a secret, see [Permissions policies attached to a
1468
+ # secret][1].
1166
1469
  #
1167
- # **Minimum permissions**
1470
+ # Secrets Manager generates a CloudTrail log entry when you call this
1471
+ # action. Do not include sensitive information in request parameters
1472
+ # because it might be logged. For more information, see [Logging Secrets
1473
+ # Manager events with CloudTrail][2].
1168
1474
  #
1169
- # To run this command, you must have the following permissions:
1475
+ # <b>Required permissions: </b> `secretsmanager:GetResourcePolicy`. For
1476
+ # more information, see [ IAM policy actions for Secrets Manager][3] and
1477
+ # [Authentication and access control in Secrets Manager][4].
1170
1478
  #
1171
- # * secretsmanager:GetResourcePolicy
1172
1479
  #
1173
- # ^
1174
1480
  #
1175
- # **Related operations**
1481
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-policies.html
1482
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1483
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1484
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
1176
1485
  #
1177
- # * To attach a resource policy to a secret, use PutResourcePolicy.
1486
+ # @option params [required, String] :secret_id
1487
+ # The ARN or name of the secret to retrieve the attached resource-based
1488
+ # policy for.
1178
1489
  #
1179
- # * To delete the resource-based policy that's attached to a secret,
1180
- # use DeleteResourcePolicy.
1490
+ # For an ARN, we recommend that you specify a complete ARN rather than a
1491
+ # partial ARN. See [Finding a secret from a partial ARN][1].
1181
1492
  #
1182
- # * To list all of the currently available secrets, use ListSecrets.
1183
1493
  #
1184
- # @option params [required, String] :secret_id
1185
- # Specifies the secret that you want to retrieve the attached
1186
- # resource-based policy for. You can specify either the Amazon Resource
1187
- # Name (ARN) or the friendly name of the secret.
1188
- #
1189
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
1190
- # complete ARN. You can specify a partial ARN too—for example, if you
1191
- # don’t include the final hyphen and six random characters that Secrets
1192
- # Manager adds at the end of the ARN when you created the secret. A
1193
- # partial ARN match can work as long as it uniquely matches only one
1194
- # secret. However, if your secret has a name that ends in a hyphen
1195
- # followed by six characters (before Secrets Manager adds the hyphen and
1196
- # six characters to the ARN) and you try to use that as a partial ARN,
1197
- # then those characters cause Secrets Manager to assume that you’re
1198
- # specifying a complete ARN. This confusion can cause unexpected
1199
- # results. To avoid this situation, we recommend that you don’t create
1200
- # secret names that end with a hyphen followed by six characters.
1201
1494
  #
1202
- # </note>
1495
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
1203
1496
  #
1204
1497
  # @return [Types::GetResourcePolicyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1205
1498
  #
@@ -1248,50 +1541,54 @@ module Aws::SecretsManager
1248
1541
  # `SecretBinary` from the specified version of a secret, whichever
1249
1542
  # contains content.
1250
1543
  #
1251
- # **Minimum permissions**
1544
+ # To retrieve the values for a group of secrets, call
1545
+ # BatchGetSecretValue.
1252
1546
  #
1253
- # To run this command, you must have the following permissions:
1547
+ # We recommend that you cache your secret values by using client-side
1548
+ # caching. Caching secrets improves speed and reduces your costs. For
1549
+ # more information, see [Cache secrets for your applications][1].
1254
1550
  #
1255
- # * secretsmanager:GetSecretValue
1551
+ # To retrieve the previous version of a secret, use `VersionStage` and
1552
+ # specify AWSPREVIOUS. To revert to the previous version of a secret,
1553
+ # call [UpdateSecretVersionStage][2].
1256
1554
  #
1257
- # * kms:Decrypt - required only if you use a customer-managed AWS KMS
1258
- # key to encrypt the secret. You do not need this permission to use
1259
- # the account's default AWS managed CMK for Secrets Manager.
1555
+ # Secrets Manager generates a CloudTrail log entry when you call this
1556
+ # action. Do not include sensitive information in request parameters
1557
+ # because it might be logged. For more information, see [Logging Secrets
1558
+ # Manager events with CloudTrail][3].
1260
1559
  #
1261
- # **Related operations**
1560
+ # <b>Required permissions: </b> `secretsmanager:GetSecretValue`. If the
1561
+ # secret is encrypted using a customer-managed key instead of the Amazon
1562
+ # Web Services managed key `aws/secretsmanager`, then you also need
1563
+ # `kms:Decrypt` permissions for that key. For more information, see [
1564
+ # IAM policy actions for Secrets Manager][4] and [Authentication and
1565
+ # access control in Secrets Manager][5].
1262
1566
  #
1263
- # * To create a new version of the secret with different encrypted
1264
- # information, use PutSecretValue.
1265
1567
  #
1266
- # * To retrieve the non-encrypted details for the secret, use
1267
- # DescribeSecret.
1568
+ #
1569
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets.html
1570
+ # [2]: https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/update-secret-version-stage.html
1571
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1572
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1573
+ # [5]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
1268
1574
  #
1269
1575
  # @option params [required, String] :secret_id
1270
- # Specifies the secret containing the version that you want to retrieve.
1271
- # You can specify either the Amazon Resource Name (ARN) or the friendly
1272
- # name of the secret.
1273
- #
1274
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
1275
- # complete ARN. You can specify a partial ARN too—for example, if you
1276
- # don’t include the final hyphen and six random characters that Secrets
1277
- # Manager adds at the end of the ARN when you created the secret. A
1278
- # partial ARN match can work as long as it uniquely matches only one
1279
- # secret. However, if your secret has a name that ends in a hyphen
1280
- # followed by six characters (before Secrets Manager adds the hyphen and
1281
- # six characters to the ARN) and you try to use that as a partial ARN,
1282
- # then those characters cause Secrets Manager to assume that you’re
1283
- # specifying a complete ARN. This confusion can cause unexpected
1284
- # results. To avoid this situation, we recommend that you don’t create
1285
- # secret names that end with a hyphen followed by six characters.
1576
+ # The ARN or name of the secret to retrieve. To retrieve a secret from
1577
+ # another account, you must use an ARN.
1286
1578
  #
1287
- # </note>
1579
+ # For an ARN, we recommend that you specify a complete ARN rather than a
1580
+ # partial ARN. See [Finding a secret from a partial ARN][1].
1581
+ #
1582
+ #
1583
+ #
1584
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
1288
1585
  #
1289
1586
  # @option params [String] :version_id
1290
- # Specifies the unique identifier of the version of the secret that you
1291
- # want to retrieve. If you specify this parameter then don't specify
1292
- # `VersionStage`. If you don't specify either a `VersionStage` or
1293
- # `VersionId` then the default is to perform the operation on the
1294
- # version with the `VersionStage` value of `AWSCURRENT`.
1587
+ # The unique identifier of the version of the secret to retrieve. If you
1588
+ # include both this parameter and `VersionStage`, the two parameters
1589
+ # must refer to the same secret version. If you don't specify either a
1590
+ # `VersionStage` or `VersionId`, then Secrets Manager returns the
1591
+ # `AWSCURRENT` version.
1295
1592
  #
1296
1593
  # This value is typically a [UUID-type][1] value with 32 hexadecimal
1297
1594
  # digits.
@@ -1301,14 +1598,13 @@ module Aws::SecretsManager
1301
1598
  # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
1302
1599
  #
1303
1600
  # @option params [String] :version_stage
1304
- # Specifies the secret version that you want to retrieve by the staging
1305
- # label attached to the version.
1601
+ # The staging label of the version of the secret to retrieve.
1306
1602
  #
1307
- # Staging labels are used to keep track of different versions during the
1308
- # rotation process. If you use this parameter then don't specify
1309
- # `VersionId`. If you don't specify either a `VersionStage` or
1310
- # `VersionId`, then the default is to perform the operation on the
1311
- # version with the `VersionStage` value of `AWSCURRENT`.
1603
+ # Secrets Manager uses staging labels to keep track of different
1604
+ # versions during the rotation process. If you include both this
1605
+ # parameter and `VersionId`, the two parameters must refer to the same
1606
+ # secret version. If you don't specify either a `VersionStage` or
1607
+ # `VersionId`, Secrets Manager returns the `AWSCURRENT` version.
1312
1608
  #
1313
1609
  # @return [Types::GetSecretValueResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1314
1610
  #
@@ -1323,13 +1619,10 @@ module Aws::SecretsManager
1323
1619
  #
1324
1620
  # @example Example: To retrieve the encrypted secret value of a secret
1325
1621
  #
1326
- # # The following example shows how to retrieve the secret string value from the version of the secret that has the
1327
- # # AWSPREVIOUS staging label attached. If you want to retrieve the AWSCURRENT version of the secret, then you can omit the
1328
- # # VersionStage parameter because it defaults to AWSCURRENT.
1622
+ # # The following example shows how to retrieve a secret string value.
1329
1623
  #
1330
1624
  # resp = client.get_secret_value({
1331
1625
  # secret_id: "MyTestDatabaseSecret",
1332
- # version_stage: "AWSPREVIOUS",
1333
1626
  # })
1334
1627
  #
1335
1628
  # resp.to_h outputs the following:
@@ -1337,7 +1630,7 @@ module Aws::SecretsManager
1337
1630
  # arn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
1338
1631
  # created_date: Time.parse(1523477145.713),
1339
1632
  # name: "MyTestDatabaseSecret",
1340
- # secret_string: "{\n \"username\":\"david\",\n \"password\":\"BnQw&XDWgaEeT9XGTT29\"\n}\n",
1633
+ # secret_string: "{\n \"username\":\"david\",\n \"password\":\"EXAMPLE-PASSWORD\"\n}\n",
1341
1634
  # version_id: "EXAMPLE1-90ab-cdef-fedc-ba987SECRET1",
1342
1635
  # version_stages: [
1343
1636
  # "AWSPREVIOUS",
@@ -1372,78 +1665,55 @@ module Aws::SecretsManager
1372
1665
  req.send_request(options)
1373
1666
  end
1374
1667
 
1375
- # Lists all of the versions attached to the specified secret. The output
1376
- # does not include the `SecretString` or `SecretBinary` fields. By
1377
- # default, the list includes only versions that have at least one
1378
- # staging label in `VersionStage` attached.
1379
- #
1380
- # <note markdown="1"> Always check the `NextToken` response parameter when calling any of
1381
- # the `List*` operations. These operations can occasionally return an
1382
- # empty or shorter than expected list of results even when there are
1383
- # more results available. When this happens, the `NextToken` response
1384
- # parameter contains a value to pass to the next call to the same API to
1385
- # request the next part of the list.
1668
+ # Lists the versions of a secret. Secrets Manager uses staging labels to
1669
+ # indicate the different versions of a secret. For more information, see
1670
+ # [ Secrets Manager concepts: Versions][1].
1386
1671
  #
1387
- # </note>
1672
+ # To list the secrets in the account, use ListSecrets.
1388
1673
  #
1389
- # **Minimum permissions**
1674
+ # Secrets Manager generates a CloudTrail log entry when you call this
1675
+ # action. Do not include sensitive information in request parameters
1676
+ # because it might be logged. For more information, see [Logging Secrets
1677
+ # Manager events with CloudTrail][2].
1390
1678
  #
1391
- # To run this command, you must have the following permissions:
1679
+ # <b>Required permissions: </b> `secretsmanager:ListSecretVersionIds`.
1680
+ # For more information, see [ IAM policy actions for Secrets Manager][3]
1681
+ # and [Authentication and access control in Secrets Manager][4].
1392
1682
  #
1393
- # * secretsmanager:ListSecretVersionIds
1394
1683
  #
1395
- # ^
1396
1684
  #
1397
- # **Related operations**
1685
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version
1686
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1687
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1688
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
1398
1689
  #
1399
- # * To list the secrets in an account, use ListSecrets.
1690
+ # @option params [required, String] :secret_id
1691
+ # The ARN or name of the secret whose versions you want to list.
1400
1692
  #
1401
- # ^
1693
+ # For an ARN, we recommend that you specify a complete ARN rather than a
1694
+ # partial ARN. See [Finding a secret from a partial ARN][1].
1402
1695
  #
1403
- # @option params [required, String] :secret_id
1404
- # The identifier for the secret containing the versions you want to
1405
- # list. You can specify either the Amazon Resource Name (ARN) or the
1406
- # friendly name of the secret.
1407
- #
1408
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
1409
- # complete ARN. You can specify a partial ARN too—for example, if you
1410
- # don’t include the final hyphen and six random characters that Secrets
1411
- # Manager adds at the end of the ARN when you created the secret. A
1412
- # partial ARN match can work as long as it uniquely matches only one
1413
- # secret. However, if your secret has a name that ends in a hyphen
1414
- # followed by six characters (before Secrets Manager adds the hyphen and
1415
- # six characters to the ARN) and you try to use that as a partial ARN,
1416
- # then those characters cause Secrets Manager to assume that you’re
1417
- # specifying a complete ARN. This confusion can cause unexpected
1418
- # results. To avoid this situation, we recommend that you don’t create
1419
- # secret names that end with a hyphen followed by six characters.
1420
1696
  #
1421
- # </note>
1697
+ #
1698
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
1422
1699
  #
1423
1700
  # @option params [Integer] :max_results
1424
- # (Optional) Limits the number of results that you want to include in
1425
- # the response. If you don't include this parameter, it defaults to a
1426
- # value that's specific to the operation. If additional items exist
1427
- # beyond the maximum you specify, the `NextToken` response element is
1428
- # present and has a value (isn't null). Include that value as the
1429
- # `NextToken` request parameter in the next call to the operation to get
1430
- # the next part of the results. Note that Secrets Manager might return
1431
- # fewer results than the maximum even when there are more results
1432
- # available. You should check `NextToken` after every operation to
1433
- # ensure that you receive all of the results.
1701
+ # The number of results to include in the response.
1702
+ #
1703
+ # If there are more results available, in the response, Secrets Manager
1704
+ # includes `NextToken`. To get the next results, call
1705
+ # `ListSecretVersionIds` again with the value from `NextToken`.
1434
1706
  #
1435
1707
  # @option params [String] :next_token
1436
- # (Optional) Use this parameter in a request if you receive a
1437
- # `NextToken` response in a previous request that indicates that
1438
- # there's more output available. In a subsequent call, set it to the
1439
- # value of the previous call's `NextToken` response to indicate where
1440
- # the output should continue from.
1708
+ # A token that indicates where the output should continue from, if a
1709
+ # previous call did not show all results. To get the next results, call
1710
+ # `ListSecretVersionIds` again with this value.
1441
1711
  #
1442
1712
  # @option params [Boolean] :include_deprecated
1443
- # (Optional) Specifies that you want the results to include versions
1444
- # that do not have any staging labels attached to them. Such versions
1445
- # are considered deprecated and are subject to deletion by Secrets
1446
- # Manager as needed.
1713
+ # Specifies whether to include versions of secrets that don't have any
1714
+ # staging labels attached to them. Versions without staging labels are
1715
+ # considered deprecated and are subject to deletion by Secrets Manager.
1716
+ # By default, versions without staging labels aren't included.
1447
1717
  #
1448
1718
  # @return [Types::ListSecretVersionIdsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1449
1719
  #
@@ -1452,6 +1722,8 @@ module Aws::SecretsManager
1452
1722
  # * {Types::ListSecretVersionIdsResponse#arn #arn} => String
1453
1723
  # * {Types::ListSecretVersionIdsResponse#name #name} => String
1454
1724
  #
1725
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
1726
+ #
1455
1727
  #
1456
1728
  # @example Example: To list all of the secret versions associated with a secret
1457
1729
  #
@@ -1506,6 +1778,8 @@ module Aws::SecretsManager
1506
1778
  # resp.versions[0].version_stages[0] #=> String
1507
1779
  # resp.versions[0].last_accessed_date #=> Time
1508
1780
  # resp.versions[0].created_date #=> Time
1781
+ # resp.versions[0].kms_key_ids #=> Array
1782
+ # resp.versions[0].kms_key_ids[0] #=> String
1509
1783
  # resp.next_token #=> String
1510
1784
  # resp.arn #=> String
1511
1785
  # resp.name #=> String
@@ -1519,59 +1793,67 @@ module Aws::SecretsManager
1519
1793
  req.send_request(options)
1520
1794
  end
1521
1795
 
1522
- # Lists all of the secrets that are stored by Secrets Manager in the AWS
1523
- # account. To list the versions currently stored for a specific secret,
1524
- # use ListSecretVersionIds. The encrypted fields `SecretString` and
1525
- # `SecretBinary` are not included in the output. To get that
1526
- # information, call the GetSecretValue operation.
1527
- #
1528
- # <note markdown="1"> Always check the `NextToken` response parameter when calling any of
1529
- # the `List*` operations. These operations can occasionally return an
1530
- # empty or shorter than expected list of results even when there are
1531
- # more results available. When this happens, the `NextToken` response
1532
- # parameter contains a value to pass to the next call to the same API to
1533
- # request the next part of the list.
1796
+ # Lists the secrets that are stored by Secrets Manager in the Amazon Web
1797
+ # Services account, not including secrets that are marked for deletion.
1798
+ # To see secrets marked for deletion, use the Secrets Manager console.
1534
1799
  #
1535
- # </note>
1800
+ # All Secrets Manager operations are eventually consistent. ListSecrets
1801
+ # might not reflect changes from the last five minutes. You can get more
1802
+ # recent information for a specific secret by calling DescribeSecret.
1536
1803
  #
1537
- # **Minimum permissions**
1804
+ # To list the versions of a secret, use ListSecretVersionIds.
1538
1805
  #
1539
- # To run this command, you must have the following permissions:
1806
+ # To retrieve the values for the secrets, call BatchGetSecretValue or
1807
+ # GetSecretValue.
1540
1808
  #
1541
- # * secretsmanager:ListSecrets
1809
+ # For information about finding secrets in the console, see [Find
1810
+ # secrets in Secrets Manager][1].
1542
1811
  #
1543
- # ^
1812
+ # Secrets Manager generates a CloudTrail log entry when you call this
1813
+ # action. Do not include sensitive information in request parameters
1814
+ # because it might be logged. For more information, see [Logging Secrets
1815
+ # Manager events with CloudTrail][2].
1544
1816
  #
1545
- # **Related operations**
1817
+ # <b>Required permissions: </b> `secretsmanager:ListSecrets`. For more
1818
+ # information, see [ IAM policy actions for Secrets Manager][3] and
1819
+ # [Authentication and access control in Secrets Manager][4].
1546
1820
  #
1547
- # * To list the versions attached to a secret, use ListSecretVersionIds.
1548
1821
  #
1549
- # ^
1822
+ #
1823
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html
1824
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1825
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1826
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
1827
+ #
1828
+ # @option params [Boolean] :include_planned_deletion
1829
+ # Specifies whether to include secrets scheduled for deletion. By
1830
+ # default, secrets scheduled for deletion aren't included.
1550
1831
  #
1551
1832
  # @option params [Integer] :max_results
1552
- # (Optional) Limits the number of results that you want to include in
1553
- # the response. If you don't include this parameter, it defaults to a
1554
- # value that's specific to the operation. If additional items exist
1555
- # beyond the maximum you specify, the `NextToken` response element is
1556
- # present and has a value (isn't null). Include that value as the
1557
- # `NextToken` request parameter in the next call to the operation to get
1558
- # the next part of the results. Note that Secrets Manager might return
1559
- # fewer results than the maximum even when there are more results
1560
- # available. You should check `NextToken` after every operation to
1561
- # ensure that you receive all of the results.
1833
+ # The number of results to include in the response.
1834
+ #
1835
+ # If there are more results available, in the response, Secrets Manager
1836
+ # includes `NextToken`. To get the next results, call `ListSecrets`
1837
+ # again with the value from `NextToken`.
1562
1838
  #
1563
1839
  # @option params [String] :next_token
1564
- # (Optional) Use this parameter in a request if you receive a
1565
- # `NextToken` response in a previous request that indicates that
1566
- # there's more output available. In a subsequent call, set it to the
1567
- # value of the previous call's `NextToken` response to indicate where
1568
- # the output should continue from.
1840
+ # A token that indicates where the output should continue from, if a
1841
+ # previous call did not show all results. To get the next results, call
1842
+ # `ListSecrets` again with this value.
1843
+ #
1844
+ # @option params [Array<Types::Filter>] :filters
1845
+ # The filters to apply to the list of secrets.
1846
+ #
1847
+ # @option params [String] :sort_order
1848
+ # Secrets are listed by `CreatedDate`.
1569
1849
  #
1570
1850
  # @return [Types::ListSecretsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1571
1851
  #
1572
1852
  # * {Types::ListSecretsResponse#secret_list #secret_list} => Array&lt;Types::SecretListEntry&gt;
1573
1853
  # * {Types::ListSecretsResponse#next_token #next_token} => String
1574
1854
  #
1855
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
1856
+ #
1575
1857
  #
1576
1858
  # @example Example: To list the secrets in your account
1577
1859
  #
@@ -1611,8 +1893,16 @@ module Aws::SecretsManager
1611
1893
  # @example Request syntax with placeholder values
1612
1894
  #
1613
1895
  # resp = client.list_secrets({
1896
+ # include_planned_deletion: false,
1614
1897
  # max_results: 1,
1615
1898
  # next_token: "NextTokenType",
1899
+ # filters: [
1900
+ # {
1901
+ # key: "description", # accepts description, name, tag-key, tag-value, primary-region, owning-service, all
1902
+ # values: ["FilterValueStringType"],
1903
+ # },
1904
+ # ],
1905
+ # sort_order: "asc", # accepts asc, desc
1616
1906
  # })
1617
1907
  #
1618
1908
  # @example Response structure
@@ -1625,10 +1915,13 @@ module Aws::SecretsManager
1625
1915
  # resp.secret_list[0].rotation_enabled #=> Boolean
1626
1916
  # resp.secret_list[0].rotation_lambda_arn #=> String
1627
1917
  # resp.secret_list[0].rotation_rules.automatically_after_days #=> Integer
1918
+ # resp.secret_list[0].rotation_rules.duration #=> String
1919
+ # resp.secret_list[0].rotation_rules.schedule_expression #=> String
1628
1920
  # resp.secret_list[0].last_rotated_date #=> Time
1629
1921
  # resp.secret_list[0].last_changed_date #=> Time
1630
1922
  # resp.secret_list[0].last_accessed_date #=> Time
1631
1923
  # resp.secret_list[0].deleted_date #=> Time
1924
+ # resp.secret_list[0].next_rotation_date #=> Time
1632
1925
  # resp.secret_list[0].tags #=> Array
1633
1926
  # resp.secret_list[0].tags[0].key #=> String
1634
1927
  # resp.secret_list[0].tags[0].value #=> String
@@ -1636,6 +1929,8 @@ module Aws::SecretsManager
1636
1929
  # resp.secret_list[0].secret_versions_to_stages["SecretVersionIdType"] #=> Array
1637
1930
  # resp.secret_list[0].secret_versions_to_stages["SecretVersionIdType"][0] #=> String
1638
1931
  # resp.secret_list[0].owning_service #=> String
1932
+ # resp.secret_list[0].created_date #=> Time
1933
+ # resp.secret_list[0].primary_region #=> String
1639
1934
  # resp.next_token #=> String
1640
1935
  #
1641
1936
  # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/ListSecrets AWS API Documentation
@@ -1647,71 +1942,70 @@ module Aws::SecretsManager
1647
1942
  req.send_request(options)
1648
1943
  end
1649
1944
 
1650
- # Attaches the contents of the specified resource-based permission
1651
- # policy to a secret. A resource-based policy is optional.
1652
- # Alternatively, you can use IAM identity-based policies that specify
1653
- # the secret's Amazon Resource Name (ARN) in the policy statement's
1654
- # `Resources` element. You can also use a combination of both
1655
- # identity-based and resource-based policies. The affected users and
1656
- # roles receive the permissions that are permitted by all of the
1657
- # relevant policies. For more information, see [Using Resource-Based
1658
- # Policies for AWS Secrets Manager][1]. For the complete description of
1659
- # the AWS policy syntax and grammar, see [IAM JSON Policy Reference][2]
1660
- # in the *IAM User Guide*.
1945
+ # Attaches a resource-based permission policy to a secret. A
1946
+ # resource-based policy is optional. For more information, see
1947
+ # [Authentication and access control for Secrets Manager][1]
1661
1948
  #
1662
- # **Minimum permissions**
1949
+ # For information about attaching a policy in the console, see [Attach a
1950
+ # permissions policy to a secret][2].
1663
1951
  #
1664
- # To run this command, you must have the following permissions:
1952
+ # Secrets Manager generates a CloudTrail log entry when you call this
1953
+ # action. Do not include sensitive information in request parameters
1954
+ # because it might be logged. For more information, see [Logging Secrets
1955
+ # Manager events with CloudTrail][3].
1665
1956
  #
1666
- # * secretsmanager:PutResourcePolicy
1957
+ # <b>Required permissions: </b> `secretsmanager:PutResourcePolicy`. For
1958
+ # more information, see [ IAM policy actions for Secrets Manager][4] and
1959
+ # [Authentication and access control in Secrets Manager][1].
1667
1960
  #
1668
- # ^
1669
1961
  #
1670
- # **Related operations**
1671
1962
  #
1672
- # * To retrieve the resource policy that's attached to a secret, use
1673
- # GetResourcePolicy.
1963
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
1964
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html
1965
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
1966
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
1674
1967
  #
1675
- # * To delete the resource-based policy that's attached to a secret,
1676
- # use DeleteResourcePolicy.
1968
+ # @option params [required, String] :secret_id
1969
+ # The ARN or name of the secret to attach the resource-based policy.
1677
1970
  #
1678
- # * To list all of the currently available secrets, use ListSecrets.
1971
+ # For an ARN, we recommend that you specify a complete ARN rather than a
1972
+ # partial ARN. See [Finding a secret from a partial ARN][1].
1679
1973
  #
1680
1974
  #
1681
1975
  #
1682
- # [1]: http://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html
1683
- # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
1976
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
1684
1977
  #
1685
- # @option params [required, String] :secret_id
1686
- # Specifies the secret that you want to attach the resource-based policy
1687
- # to. You can specify either the ARN or the friendly name of the secret.
1688
- #
1689
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
1690
- # complete ARN. You can specify a partial ARN too—for example, if you
1691
- # don’t include the final hyphen and six random characters that Secrets
1692
- # Manager adds at the end of the ARN when you created the secret. A
1693
- # partial ARN match can work as long as it uniquely matches only one
1694
- # secret. However, if your secret has a name that ends in a hyphen
1695
- # followed by six characters (before Secrets Manager adds the hyphen and
1696
- # six characters to the ARN) and you try to use that as a partial ARN,
1697
- # then those characters cause Secrets Manager to assume that you’re
1698
- # specifying a complete ARN. This confusion can cause unexpected
1699
- # results. To avoid this situation, we recommend that you don’t create
1700
- # secret names that end with a hyphen followed by six characters.
1978
+ # @option params [required, String] :resource_policy
1979
+ # A JSON-formatted string for an Amazon Web Services resource-based
1980
+ # policy. For example policies, see [Permissions policy examples][1].
1701
1981
  #
1702
- # </note>
1703
1982
  #
1704
- # @option params [required, String] :resource_policy
1705
- # A JSON-formatted string that's constructed according to the grammar
1706
- # and syntax for an AWS resource-based policy. The policy in the string
1707
- # identifies who can access or manage this secret and its versions. For
1708
- # information on how to format a JSON parameter for the various command
1709
- # line tool environments, see [Using JSON for Parameters][1] in the *AWS
1710
- # CLI User Guide*.
1711
1983
  #
1984
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html
1985
+ #
1986
+ # @option params [Boolean] :block_public_policy
1987
+ # Specifies whether to block resource-based policies that allow broad
1988
+ # access to the secret, for example those that use a wildcard for the
1989
+ # principal. By default, public policies aren't blocked.
1990
+ #
1991
+ # Resource policy validation and the BlockPublicPolicy parameter help
1992
+ # protect your resources by preventing public access from being granted
1993
+ # through the resource policies that are directly attached to your
1994
+ # secrets. In addition to using these features, carefully inspect the
1995
+ # following policies to confirm that they do not grant public access:
1712
1996
  #
1997
+ # * Identity-based policies attached to associated Amazon Web Services
1998
+ # principals (for example, IAM roles)
1713
1999
  #
1714
- # [1]: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
2000
+ # * Resource-based policies attached to associated Amazon Web Services
2001
+ # resources (for example, Key Management Service (KMS) keys)
2002
+ #
2003
+ # To review permissions to your secrets, see [Determine who has
2004
+ # permissions to your secrets][1].
2005
+ #
2006
+ #
2007
+ #
2008
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/determine-acccess_examine-iam-policies.html
1715
2009
  #
1716
2010
  # @return [Types::PutResourcePolicyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1717
2011
  #
@@ -1739,6 +2033,7 @@ module Aws::SecretsManager
1739
2033
  # resp = client.put_resource_policy({
1740
2034
  # secret_id: "SecretIdType", # required
1741
2035
  # resource_policy: "NonEmptyResourcePolicyType", # required
2036
+ # block_public_policy: false,
1742
2037
  # })
1743
2038
  #
1744
2039
  # @example Response structure
@@ -1755,138 +2050,103 @@ module Aws::SecretsManager
1755
2050
  req.send_request(options)
1756
2051
  end
1757
2052
 
1758
- # Stores a new encrypted secret value in the specified secret. To do
1759
- # this, the operation creates a new version and attaches it to the
1760
- # secret. The version can contain a new `SecretString` value or a new
1761
- # `SecretBinary` value. You can also specify the staging labels that are
1762
- # initially attached to the new version.
1763
- #
1764
- # <note markdown="1"> The Secrets Manager console uses only the `SecretString` field. To add
1765
- # binary data to a secret with the `SecretBinary` field you must use the
1766
- # AWS CLI or one of the AWS SDKs.
1767
- #
1768
- # </note>
2053
+ # Creates a new version with a new encrypted secret value and attaches
2054
+ # it to the secret. The version can contain a new `SecretString` value
2055
+ # or a new `SecretBinary` value.
2056
+ #
2057
+ # We recommend you avoid calling `PutSecretValue` at a sustained rate of
2058
+ # more than once every 10 minutes. When you update the secret value,
2059
+ # Secrets Manager creates a new version of the secret. Secrets Manager
2060
+ # removes outdated versions when there are more than 100, but it does
2061
+ # not remove versions created less than 24 hours ago. If you call
2062
+ # `PutSecretValue` more than once every 10 minutes, you create more
2063
+ # versions than Secrets Manager removes, and you will reach the quota
2064
+ # for secret versions.
2065
+ #
2066
+ # You can specify the staging labels to attach to the new version in
2067
+ # `VersionStages`. If you don't include `VersionStages`, then Secrets
2068
+ # Manager automatically moves the staging label `AWSCURRENT` to this
2069
+ # version. If this operation creates the first version for the secret,
2070
+ # then Secrets Manager automatically attaches the staging label
2071
+ # `AWSCURRENT` to it. If this operation moves the staging label
2072
+ # `AWSCURRENT` from another version to this version, then Secrets
2073
+ # Manager also automatically moves the staging label `AWSPREVIOUS` to
2074
+ # the version that `AWSCURRENT` was removed from.
2075
+ #
2076
+ # This operation is idempotent. If you call this operation with a
2077
+ # `ClientRequestToken` that matches an existing version's VersionId,
2078
+ # and you specify the same secret data, the operation succeeds but does
2079
+ # nothing. However, if the secret data is different, then the operation
2080
+ # fails because you can't modify an existing version; you can only
2081
+ # create new ones.
2082
+ #
2083
+ # Secrets Manager generates a CloudTrail log entry when you call this
2084
+ # action. Do not include sensitive information in request parameters
2085
+ # except `SecretBinary`, `SecretString`, or `RotationToken` because it
2086
+ # might be logged. For more information, see [Logging Secrets Manager
2087
+ # events with CloudTrail][1].
2088
+ #
2089
+ # <b>Required permissions: </b> `secretsmanager:PutSecretValue`. For
2090
+ # more information, see [ IAM policy actions for Secrets Manager][2] and
2091
+ # [Authentication and access control in Secrets Manager][3].
2092
+ #
2093
+ # When you enter commands in a command shell, there is a risk of the
2094
+ # command history being accessed or utilities having access to your
2095
+ # command parameters. This is a concern if the command includes the
2096
+ # value of a secret. Learn how to [Mitigate the risks of using
2097
+ # command-line tools to store Secrets Manager secrets][4].
2098
+ #
2099
+ #
2100
+ #
2101
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2102
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2103
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2104
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/security_cli-exposure-risks.html
1769
2105
  #
1770
- # * If this operation creates the first version for the secret then
1771
- # Secrets Manager automatically attaches the staging label
1772
- # `AWSCURRENT` to the new version.
1773
- #
1774
- # * If another version of this secret already exists, then this
1775
- # operation does not automatically move any staging labels other than
1776
- # those that you explicitly specify in the `VersionStages` parameter.
1777
- #
1778
- # * If this operation moves the staging label `AWSCURRENT` from another
1779
- # version to this version (because you included it in the
1780
- # `StagingLabels` parameter) then Secrets Manager also automatically
1781
- # moves the staging label `AWSPREVIOUS` to the version that
1782
- # `AWSCURRENT` was removed from.
1783
- #
1784
- # * This operation is idempotent. If a version with a `VersionId` with
1785
- # the same value as the `ClientRequestToken` parameter already exists
1786
- # and you specify the same secret data, the operation succeeds but
1787
- # does nothing. However, if the secret data is different, then the
1788
- # operation fails because you cannot modify an existing version; you
1789
- # can only create new ones.
1790
- #
1791
- # <note markdown="1"> * If you call an operation that needs to encrypt or decrypt the
1792
- # `SecretString` or `SecretBinary` for a secret in the same account as
1793
- # the calling user and that secret doesn't specify a AWS KMS
1794
- # encryption key, Secrets Manager uses the account's default AWS
1795
- # managed customer master key (CMK) with the alias
1796
- # `aws/secretsmanager`. If this key doesn't already exist in your
1797
- # account then Secrets Manager creates it for you automatically. All
1798
- # users and roles in the same AWS account automatically have access to
1799
- # use the default CMK. Note that if an Secrets Manager API call
1800
- # results in AWS having to create the account's AWS-managed CMK, it
1801
- # can result in a one-time significant delay in returning the result.
1802
- #
1803
- # * If the secret is in a different AWS account from the credentials
1804
- # calling an API that requires encryption or decryption of the secret
1805
- # value then you must create and use a custom AWS KMS CMK because you
1806
- # can't access the default CMK for the account using credentials from
1807
- # a different AWS account. Store the ARN of the CMK in the secret when
1808
- # you create the secret or when you update it by including it in the
1809
- # `KMSKeyId`. If you call an API that must encrypt or decrypt
1810
- # `SecretString` or `SecretBinary` using credentials from a different
1811
- # account then the AWS KMS key policy must grant cross-account access
1812
- # to that other account's user or role for both the
1813
- # kms:GenerateDataKey and kms:Decrypt operations.
1814
- #
1815
- # </note>
1816
- #
1817
- # **Minimum permissions**
1818
- #
1819
- # To run this command, you must have the following permissions:
1820
- #
1821
- # * secretsmanager:PutSecretValue
2106
+ # @option params [required, String] :secret_id
2107
+ # The ARN or name of the secret to add a new version to.
1822
2108
  #
1823
- # * kms:GenerateDataKey - needed only if you use a customer-managed AWS
1824
- # KMS key to encrypt the secret. You do not need this permission to
1825
- # use the account's default AWS managed CMK for Secrets Manager.
2109
+ # For an ARN, we recommend that you specify a complete ARN rather than a
2110
+ # partial ARN. See [Finding a secret from a partial ARN][1].
1826
2111
  #
1827
- # **Related operations**
2112
+ # If the secret doesn't already exist, use `CreateSecret` instead.
1828
2113
  #
1829
- # * To retrieve the encrypted value you store in the version of a
1830
- # secret, use GetSecretValue.
1831
2114
  #
1832
- # * To create a secret, use CreateSecret.
1833
2115
  #
1834
- # * To get the details for a secret, use DescribeSecret.
2116
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
1835
2117
  #
1836
- # * To list the versions attached to a secret, use ListSecretVersionIds.
2118
+ # @option params [String] :client_request_token
2119
+ # A unique identifier for the new version of the secret.
1837
2120
  #
1838
- # @option params [required, String] :secret_id
1839
- # Specifies the secret to which you want to add a new version. You can
1840
- # specify either the Amazon Resource Name (ARN) or the friendly name of
1841
- # the secret. The secret must already exist.
1842
- #
1843
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
1844
- # complete ARN. You can specify a partial ARN too—for example, if you
1845
- # don’t include the final hyphen and six random characters that Secrets
1846
- # Manager adds at the end of the ARN when you created the secret. A
1847
- # partial ARN match can work as long as it uniquely matches only one
1848
- # secret. However, if your secret has a name that ends in a hyphen
1849
- # followed by six characters (before Secrets Manager adds the hyphen and
1850
- # six characters to the ARN) and you try to use that as a partial ARN,
1851
- # then those characters cause Secrets Manager to assume that you’re
1852
- # specifying a complete ARN. This confusion can cause unexpected
1853
- # results. To avoid this situation, we recommend that you don’t create
1854
- # secret names that end with a hyphen followed by six characters.
2121
+ # <note markdown="1"> If you use the Amazon Web Services CLI or one of the Amazon Web
2122
+ # Services SDKs to call this operation, then you can leave this
2123
+ # parameter empty. The CLI or SDK generates a random UUID for you and
2124
+ # includes it as the value for this parameter in the request.
1855
2125
  #
1856
2126
  # </note>
1857
2127
  #
1858
- # @option params [String] :client_request_token
1859
- # (Optional) Specifies a unique identifier for the new version of the
1860
- # secret.
1861
- #
1862
- # <note markdown="1"> If you use the AWS CLI or one of the AWS SDK to call this operation,
1863
- # then you can leave this parameter empty. The CLI or SDK generates a
1864
- # random UUID for you and includes that in the request. If you don't
1865
- # use the SDK and instead generate a raw HTTP request to the Secrets
1866
- # Manager service endpoint, then you must generate a
1867
- # `ClientRequestToken` yourself for new versions and include that value
2128
+ # If you generate a raw HTTP request to the Secrets Manager service
2129
+ # endpoint, then you must generate a `ClientRequestToken` and include it
1868
2130
  # in the request.
1869
2131
  #
1870
- # </note>
1871
- #
1872
2132
  # This value helps ensure idempotency. Secrets Manager uses this value
1873
2133
  # to prevent the accidental creation of duplicate versions if there are
1874
- # failures and retries during the Lambda rotation function's
1875
- # processing. We recommend that you generate a [UUID-type][1] value to
1876
- # ensure uniqueness within the specified secret.
2134
+ # failures and retries during a rotation. We recommend that you generate
2135
+ # a [UUID-type][1] value to ensure uniqueness of your versions within
2136
+ # the specified secret.
1877
2137
  #
1878
2138
  # * If the `ClientRequestToken` value isn't already associated with a
1879
2139
  # version of the secret then a new version of the secret is created.
1880
2140
  #
1881
2141
  # * If a version with this value already exists and that version's
1882
2142
  # `SecretString` or `SecretBinary` values are the same as those in the
1883
- # request then the request is ignored (the operation is idempotent).
2143
+ # request then the request is ignored. The operation is idempotent.
1884
2144
  #
1885
- # * If a version with this value already exists and that version's
2145
+ # * If a version with this value already exists and the version of the
1886
2146
  # `SecretString` and `SecretBinary` values are different from those in
1887
- # the request then the request fails because you cannot modify an
1888
- # existing secret version. You can only create new versions to store
1889
- # new secret values.
2147
+ # the request, then the request fails because you can't modify a
2148
+ # secret version. You can only create new versions to store new secret
2149
+ # values.
1890
2150
  #
1891
2151
  # This value becomes the `VersionId` of the new version.
1892
2152
  #
@@ -1897,62 +2157,65 @@ module Aws::SecretsManager
1897
2157
  #
1898
2158
  # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
1899
2159
  #
1900
- # @option params [String, IO] :secret_binary
1901
- # (Optional) Specifies binary data that you want to encrypt and store in
1902
- # the new version of the secret. To use this parameter in the
1903
- # command-line tools, we recommend that you store your binary data in a
1904
- # file and then use the appropriate technique for your tool to pass the
1905
- # contents of the file as a parameter. Either `SecretBinary` or
1906
- # `SecretString` must have a value, but not both. They cannot both be
1907
- # empty.
2160
+ # @option params [String, StringIO, File] :secret_binary
2161
+ # The binary data to encrypt and store in the new version of the secret.
2162
+ # To use this parameter in the command-line tools, we recommend that you
2163
+ # store your binary data in a file and then pass the contents of the
2164
+ # file as a parameter.
2165
+ #
2166
+ # You must include `SecretBinary` or `SecretString`, but not both.
2167
+ #
2168
+ # You can't access this value from the Secrets Manager console.
1908
2169
  #
1909
- # This parameter is not accessible if the secret using the Secrets
1910
- # Manager console.
2170
+ # Sensitive: This field contains sensitive information, so the service
2171
+ # does not include it in CloudTrail log entries. If you create your own
2172
+ # log entries, you must also avoid logging the information in this
2173
+ # field.
1911
2174
  #
1912
2175
  # @option params [String] :secret_string
1913
- # (Optional) Specifies text data that you want to encrypt and store in
1914
- # this new version of the secret. Either `SecretString` or
1915
- # `SecretBinary` must have a value, but not both. They cannot both be
1916
- # empty.
2176
+ # The text to encrypt and store in the new version of the secret.
1917
2177
  #
1918
- # If you create this secret by using the Secrets Manager console then
1919
- # Secrets Manager puts the protected secret text in only the
1920
- # `SecretString` parameter. The Secrets Manager console stores the
1921
- # information as a JSON structure of key/value pairs that the default
1922
- # Lambda rotation function knows how to parse.
2178
+ # You must include `SecretBinary` or `SecretString`, but not both.
1923
2179
  #
1924
- # For storing multiple values, we recommend that you use a JSON text
1925
- # string argument and specify key/value pairs. For information on how to
1926
- # format a JSON parameter for the various command line tool
1927
- # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
1928
- # Guide*.
2180
+ # We recommend you create the secret string as JSON key/value pairs, as
2181
+ # shown in the example.
1929
2182
  #
1930
- # For example:
2183
+ # Sensitive: This field contains sensitive information, so the service
2184
+ # does not include it in CloudTrail log entries. If you create your own
2185
+ # log entries, you must also avoid logging the information in this
2186
+ # field.
1931
2187
  #
1932
- # `[\{"username":"bob"\},\{"password":"abc123xyz456"\}]`
2188
+ # @option params [Array<String>] :version_stages
2189
+ # A list of staging labels to attach to this version of the secret.
2190
+ # Secrets Manager uses staging labels to track versions of a secret
2191
+ # through the rotation process.
1933
2192
  #
1934
- # If your command-line tool or SDK requires quotation marks around the
1935
- # parameter, you should use single quotes to avoid confusion with the
1936
- # double quotes required in the JSON text.
2193
+ # If you specify a staging label that's already associated with a
2194
+ # different version of the same secret, then Secrets Manager removes the
2195
+ # label from the other version and attaches it to this version. If you
2196
+ # specify `AWSCURRENT`, and it is already attached to another version,
2197
+ # then Secrets Manager also moves the staging label `AWSPREVIOUS` to the
2198
+ # version that `AWSCURRENT` was removed from.
1937
2199
  #
2200
+ # If you don't include `VersionStages`, then Secrets Manager
2201
+ # automatically moves the staging label `AWSCURRENT` to this version.
1938
2202
  #
2203
+ # @option params [String] :rotation_token
2204
+ # A unique identifier that indicates the source of the request. For
2205
+ # cross-account rotation (when you rotate a secret in one account by
2206
+ # using a Lambda rotation function in another account) and the Lambda
2207
+ # rotation function assumes an IAM role to call Secrets Manager, Secrets
2208
+ # Manager validates the identity with the rotation token. For more
2209
+ # information, see [How rotation works][1].
1939
2210
  #
1940
- # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
2211
+ # Sensitive: This field contains sensitive information, so the service
2212
+ # does not include it in CloudTrail log entries. If you create your own
2213
+ # log entries, you must also avoid logging the information in this
2214
+ # field.
1941
2215
  #
1942
- # @option params [Array<String>] :version_stages
1943
- # (Optional) Specifies a list of staging labels that are attached to
1944
- # this version of the secret. These staging labels are used to track the
1945
- # versions through the rotation process by the Lambda rotation function.
1946
2216
  #
1947
- # A staging label must be unique to a single version of the secret. If
1948
- # you specify a staging label that's already associated with a
1949
- # different version of the same secret then that staging label is
1950
- # automatically removed from the other version and attached to this
1951
- # version.
1952
2217
  #
1953
- # If you do not specify a value for `VersionStages` then Secrets Manager
1954
- # automatically moves the staging label `AWSCURRENT` to this new
1955
- # version.
2218
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html
1956
2219
  #
1957
2220
  # @return [Types::PutSecretValueResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1958
2221
  #
@@ -1970,7 +2233,7 @@ module Aws::SecretsManager
1970
2233
  # resp = client.put_secret_value({
1971
2234
  # client_request_token: "EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE",
1972
2235
  # secret_id: "MyTestDatabaseSecret",
1973
- # secret_string: "{\"username\":\"david\",\"password\":\"BnQw!XDWgaEeT9XGTT29\"}",
2236
+ # secret_string: "{\"username\":\"david\",\"password\":\"EXAMPLE-PASSWORD\"}",
1974
2237
  # })
1975
2238
  #
1976
2239
  # resp.to_h outputs the following:
@@ -1991,6 +2254,7 @@ module Aws::SecretsManager
1991
2254
  # secret_binary: "data",
1992
2255
  # secret_string: "SecretStringType",
1993
2256
  # version_stages: ["SecretVersionStageType"],
2257
+ # rotation_token: "RotationTokenType",
1994
2258
  # })
1995
2259
  #
1996
2260
  # @example Response structure
@@ -2010,43 +2274,188 @@ module Aws::SecretsManager
2010
2274
  req.send_request(options)
2011
2275
  end
2012
2276
 
2013
- # Cancels the scheduled deletion of a secret by removing the
2014
- # `DeletedDate` time stamp. This makes the secret accessible to query
2015
- # once again.
2277
+ # For a secret that is replicated to other Regions, deletes the secret
2278
+ # replicas from the Regions you specify.
2279
+ #
2280
+ # Secrets Manager generates a CloudTrail log entry when you call this
2281
+ # action. Do not include sensitive information in request parameters
2282
+ # because it might be logged. For more information, see [Logging Secrets
2283
+ # Manager events with CloudTrail][1].
2016
2284
  #
2017
- # **Minimum permissions**
2285
+ # <b>Required permissions: </b>
2286
+ # `secretsmanager:RemoveRegionsFromReplication`. For more information,
2287
+ # see [ IAM policy actions for Secrets Manager][2] and [Authentication
2288
+ # and access control in Secrets Manager][3].
2018
2289
  #
2019
- # To run this command, you must have the following permissions:
2020
2290
  #
2021
- # * secretsmanager:RestoreSecret
2022
2291
  #
2023
- # ^
2292
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2293
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2294
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2024
2295
  #
2025
- # **Related operations**
2296
+ # @option params [required, String] :secret_id
2297
+ # The ARN or name of the secret.
2026
2298
  #
2027
- # * To delete a secret, use DeleteSecret.
2299
+ # @option params [required, Array<String>] :remove_replica_regions
2300
+ # The Regions of the replicas to remove.
2028
2301
  #
2029
- # ^
2302
+ # @return [Types::RemoveRegionsFromReplicationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2303
+ #
2304
+ # * {Types::RemoveRegionsFromReplicationResponse#arn #arn} => String
2305
+ # * {Types::RemoveRegionsFromReplicationResponse#replication_status #replication_status} => Array&lt;Types::ReplicationStatusType&gt;
2306
+ #
2307
+ # @example Request syntax with placeholder values
2308
+ #
2309
+ # resp = client.remove_regions_from_replication({
2310
+ # secret_id: "SecretIdType", # required
2311
+ # remove_replica_regions: ["RegionType"], # required
2312
+ # })
2313
+ #
2314
+ # @example Response structure
2315
+ #
2316
+ # resp.arn #=> String
2317
+ # resp.replication_status #=> Array
2318
+ # resp.replication_status[0].region #=> String
2319
+ # resp.replication_status[0].kms_key_id #=> String
2320
+ # resp.replication_status[0].status #=> String, one of "InSync", "Failed", "InProgress"
2321
+ # resp.replication_status[0].status_message #=> String
2322
+ # resp.replication_status[0].last_accessed_date #=> Time
2323
+ #
2324
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/RemoveRegionsFromReplication AWS API Documentation
2325
+ #
2326
+ # @overload remove_regions_from_replication(params = {})
2327
+ # @param [Hash] params ({})
2328
+ def remove_regions_from_replication(params = {}, options = {})
2329
+ req = build_request(:remove_regions_from_replication, params)
2330
+ req.send_request(options)
2331
+ end
2332
+
2333
+ # Replicates the secret to a new Regions. See [Multi-Region secrets][1].
2334
+ #
2335
+ # Secrets Manager generates a CloudTrail log entry when you call this
2336
+ # action. Do not include sensitive information in request parameters
2337
+ # because it might be logged. For more information, see [Logging Secrets
2338
+ # Manager events with CloudTrail][2].
2339
+ #
2340
+ # <b>Required permissions: </b>
2341
+ # `secretsmanager:ReplicateSecretToRegions`. If the primary secret is
2342
+ # encrypted with a KMS key other than `aws/secretsmanager`, you also
2343
+ # need `kms:Decrypt` permission to the key. To encrypt the replicated
2344
+ # secret with a KMS key other than `aws/secretsmanager`, you need
2345
+ # `kms:GenerateDataKey` and `kms:Encrypt` to the key. For more
2346
+ # information, see [ IAM policy actions for Secrets Manager][3] and
2347
+ # [Authentication and access control in Secrets Manager][4].
2348
+ #
2349
+ #
2350
+ #
2351
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/create-manage-multi-region-secrets.html
2352
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2353
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2354
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2030
2355
  #
2031
2356
  # @option params [required, String] :secret_id
2032
- # Specifies the secret that you want to restore from a previously
2033
- # scheduled deletion. You can specify either the Amazon Resource Name
2034
- # (ARN) or the friendly name of the secret.
2035
- #
2036
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
2037
- # complete ARN. You can specify a partial ARN too—for example, if you
2038
- # don’t include the final hyphen and six random characters that Secrets
2039
- # Manager adds at the end of the ARN when you created the secret. A
2040
- # partial ARN match can work as long as it uniquely matches only one
2041
- # secret. However, if your secret has a name that ends in a hyphen
2042
- # followed by six characters (before Secrets Manager adds the hyphen and
2043
- # six characters to the ARN) and you try to use that as a partial ARN,
2044
- # then those characters cause Secrets Manager to assume that you’re
2045
- # specifying a complete ARN. This confusion can cause unexpected
2046
- # results. To avoid this situation, we recommend that you don’t create
2047
- # secret names that end with a hyphen followed by six characters.
2357
+ # The ARN or name of the secret to replicate.
2358
+ #
2359
+ # @option params [required, Array<Types::ReplicaRegionType>] :add_replica_regions
2360
+ # A list of Regions in which to replicate the secret.
2361
+ #
2362
+ # @option params [Boolean] :force_overwrite_replica_secret
2363
+ # Specifies whether to overwrite a secret with the same name in the
2364
+ # destination Region. By default, secrets aren't overwritten.
2365
+ #
2366
+ # @return [Types::ReplicateSecretToRegionsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2367
+ #
2368
+ # * {Types::ReplicateSecretToRegionsResponse#arn #arn} => String
2369
+ # * {Types::ReplicateSecretToRegionsResponse#replication_status #replication_status} => Array&lt;Types::ReplicationStatusType&gt;
2370
+ #
2371
+ #
2372
+ # @example Example: Example
2373
+ #
2374
+ # # The following example replicates a secret to eu-west-3. The replica is encrypted with the AWS managed key
2375
+ # # aws/secretsmanager.
2376
+ #
2377
+ # resp = client.replicate_secret_to_regions({
2378
+ # add_replica_regions: [
2379
+ # {
2380
+ # region: "eu-west-3",
2381
+ # },
2382
+ # ],
2383
+ # force_overwrite_replica_secret: true,
2384
+ # secret_id: "MyTestSecret",
2385
+ # })
2386
+ #
2387
+ # resp.to_h outputs the following:
2388
+ # {
2389
+ # arn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestSecret-1a2b3c",
2390
+ # replication_status: [
2391
+ # {
2392
+ # kms_key_id: "alias/aws/secretsmanager",
2393
+ # region: "eu-west-3",
2394
+ # status: "InProgress",
2395
+ # },
2396
+ # ],
2397
+ # }
2398
+ #
2399
+ # @example Request syntax with placeholder values
2400
+ #
2401
+ # resp = client.replicate_secret_to_regions({
2402
+ # secret_id: "SecretIdType", # required
2403
+ # add_replica_regions: [ # required
2404
+ # {
2405
+ # region: "RegionType",
2406
+ # kms_key_id: "KmsKeyIdType",
2407
+ # },
2408
+ # ],
2409
+ # force_overwrite_replica_secret: false,
2410
+ # })
2411
+ #
2412
+ # @example Response structure
2413
+ #
2414
+ # resp.arn #=> String
2415
+ # resp.replication_status #=> Array
2416
+ # resp.replication_status[0].region #=> String
2417
+ # resp.replication_status[0].kms_key_id #=> String
2418
+ # resp.replication_status[0].status #=> String, one of "InSync", "Failed", "InProgress"
2419
+ # resp.replication_status[0].status_message #=> String
2420
+ # resp.replication_status[0].last_accessed_date #=> Time
2421
+ #
2422
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/ReplicateSecretToRegions AWS API Documentation
2423
+ #
2424
+ # @overload replicate_secret_to_regions(params = {})
2425
+ # @param [Hash] params ({})
2426
+ def replicate_secret_to_regions(params = {}, options = {})
2427
+ req = build_request(:replicate_secret_to_regions, params)
2428
+ req.send_request(options)
2429
+ end
2430
+
2431
+ # Cancels the scheduled deletion of a secret by removing the
2432
+ # `DeletedDate` time stamp. You can access a secret again after it has
2433
+ # been restored.
2434
+ #
2435
+ # Secrets Manager generates a CloudTrail log entry when you call this
2436
+ # action. Do not include sensitive information in request parameters
2437
+ # because it might be logged. For more information, see [Logging Secrets
2438
+ # Manager events with CloudTrail][1].
2439
+ #
2440
+ # <b>Required permissions: </b> `secretsmanager:RestoreSecret`. For more
2441
+ # information, see [ IAM policy actions for Secrets Manager][2] and
2442
+ # [Authentication and access control in Secrets Manager][3].
2048
2443
  #
2049
- # </note>
2444
+ #
2445
+ #
2446
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2447
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2448
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2449
+ #
2450
+ # @option params [required, String] :secret_id
2451
+ # The ARN or name of the secret to restore.
2452
+ #
2453
+ # For an ARN, we recommend that you specify a complete ARN rather than a
2454
+ # partial ARN. See [Finding a secret from a partial ARN][1].
2455
+ #
2456
+ #
2457
+ #
2458
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
2050
2459
  #
2051
2460
  # @return [Types::RestoreSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2052
2461
  #
@@ -2088,111 +2497,76 @@ module Aws::SecretsManager
2088
2497
  req.send_request(options)
2089
2498
  end
2090
2499
 
2091
- # Configures and starts the asynchronous process of rotating this
2092
- # secret. If you include the configuration parameters, the operation
2093
- # sets those values for the secret and then immediately starts a
2094
- # rotation. If you do not include the configuration parameters, the
2095
- # operation starts a rotation with the values already stored in the
2096
- # secret. After the rotation completes, the protected service and its
2097
- # clients all use the new version of the secret.
2098
- #
2099
- # This required configuration information includes the ARN of an AWS
2100
- # Lambda function and the time between scheduled rotations. The Lambda
2101
- # rotation function creates a new version of the secret and creates or
2102
- # updates the credentials on the protected service to match. After
2103
- # testing the new credentials, the function marks the new secret with
2104
- # the staging label `AWSCURRENT` so that your clients all immediately
2105
- # begin to use the new version. For more information about rotating
2106
- # secrets and how to configure a Lambda function to rotate the secrets
2107
- # for your protected service, see [Rotating Secrets in AWS Secrets
2108
- # Manager][1] in the *AWS Secrets Manager User Guide*.
2109
- #
2110
- # Secrets Manager schedules the next rotation when the previous one is
2111
- # complete. Secrets Manager schedules the date by adding the rotation
2112
- # interval (number of days) to the actual date of the last rotation. The
2113
- # service chooses the hour within that 24-hour date window randomly. The
2114
- # minute is also chosen somewhat randomly, but weighted towards the top
2115
- # of the hour and influenced by a variety of factors that help
2116
- # distribute load.
2117
- #
2118
- # The rotation function must end with the versions of the secret in one
2119
- # of two states:
2120
- #
2121
- # * The `AWSPENDING` and `AWSCURRENT` staging labels are attached to the
2122
- # same version of the secret, or
2123
- #
2124
- # * The `AWSPENDING` staging label is not attached to any version of the
2125
- # secret.
2126
- #
2127
- # If instead the `AWSPENDING` staging label is present but is not
2128
- # attached to the same version as `AWSCURRENT` then any later invocation
2129
- # of `RotateSecret` assumes that a previous rotation request is still in
2130
- # progress and returns an error.
2131
- #
2132
- # **Minimum permissions**
2133
- #
2134
- # To run this command, you must have the following permissions:
2500
+ # Configures and starts the asynchronous process of rotating the secret.
2501
+ # For information about rotation, see [Rotate secrets][1] in the
2502
+ # *Secrets Manager User Guide*. If you include the configuration
2503
+ # parameters, the operation sets the values for the secret and then
2504
+ # immediately starts a rotation. If you don't include the configuration
2505
+ # parameters, the operation starts a rotation with the values already
2506
+ # stored in the secret.
2507
+ #
2508
+ # When rotation is successful, the `AWSPENDING` staging label might be
2509
+ # attached to the same version as the `AWSCURRENT` version, or it might
2510
+ # not be attached to any version. If the `AWSPENDING` staging label is
2511
+ # present but not attached to the same version as `AWSCURRENT`, then any
2512
+ # later invocation of `RotateSecret` assumes that a previous rotation
2513
+ # request is still in progress and returns an error. When rotation is
2514
+ # unsuccessful, the `AWSPENDING` staging label might be attached to an
2515
+ # empty secret version. For more information, see [Troubleshoot
2516
+ # rotation][2] in the *Secrets Manager User Guide*.
2517
+ #
2518
+ # Secrets Manager generates a CloudTrail log entry when you call this
2519
+ # action. Do not include sensitive information in request parameters
2520
+ # because it might be logged. For more information, see [Logging Secrets
2521
+ # Manager events with CloudTrail][3].
2522
+ #
2523
+ # <b>Required permissions: </b> `secretsmanager:RotateSecret`. For more
2524
+ # information, see [ IAM policy actions for Secrets Manager][4] and
2525
+ # [Authentication and access control in Secrets Manager][5]. You also
2526
+ # need `lambda:InvokeFunction` permissions on the rotation function. For
2527
+ # more information, see [ Permissions for rotation][6].
2135
2528
  #
2136
- # * secretsmanager:RotateSecret
2137
2529
  #
2138
- # * lambda:InvokeFunction (on the function specified in the secret's
2139
- # metadata)
2140
2530
  #
2141
- # **Related operations**
2142
- #
2143
- # * To list the secrets in your account, use ListSecrets.
2531
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html
2532
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot_rotation.html
2533
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2534
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2535
+ # [5]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2536
+ # [6]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets-required-permissions-function.html
2144
2537
  #
2145
- # * To get the details for a version of a secret, use DescribeSecret.
2538
+ # @option params [required, String] :secret_id
2539
+ # The ARN or name of the secret to rotate.
2146
2540
  #
2147
- # * To create a new version of a secret, use CreateSecret.
2541
+ # For an ARN, we recommend that you specify a complete ARN rather than a
2542
+ # partial ARN. See [Finding a secret from a partial ARN][1].
2148
2543
  #
2149
- # * To attach staging labels to or remove staging labels from a version
2150
- # of a secret, use UpdateSecretVersionStage.
2151
2544
  #
2152
2545
  #
2546
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
2153
2547
  #
2154
- # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html
2548
+ # @option params [String] :client_request_token
2549
+ # A unique identifier for the new version of the secret. You only need
2550
+ # to specify this value if you implement your own retry logic and you
2551
+ # want to ensure that Secrets Manager doesn't attempt to create a
2552
+ # secret version twice.
2155
2553
  #
2156
- # @option params [required, String] :secret_id
2157
- # Specifies the secret that you want to rotate. You can specify either
2158
- # the Amazon Resource Name (ARN) or the friendly name of the secret.
2159
- #
2160
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
2161
- # complete ARN. You can specify a partial ARN too—for example, if you
2162
- # don’t include the final hyphen and six random characters that Secrets
2163
- # Manager adds at the end of the ARN when you created the secret. A
2164
- # partial ARN match can work as long as it uniquely matches only one
2165
- # secret. However, if your secret has a name that ends in a hyphen
2166
- # followed by six characters (before Secrets Manager adds the hyphen and
2167
- # six characters to the ARN) and you try to use that as a partial ARN,
2168
- # then those characters cause Secrets Manager to assume that you’re
2169
- # specifying a complete ARN. This confusion can cause unexpected
2170
- # results. To avoid this situation, we recommend that you don’t create
2171
- # secret names that end with a hyphen followed by six characters.
2554
+ # <note markdown="1"> If you use the Amazon Web Services CLI or one of the Amazon Web
2555
+ # Services SDKs to call this operation, then you can leave this
2556
+ # parameter empty. The CLI or SDK generates a random UUID for you and
2557
+ # includes it as the value for this parameter in the request.
2172
2558
  #
2173
2559
  # </note>
2174
2560
  #
2175
- # @option params [String] :client_request_token
2176
- # (Optional) Specifies a unique identifier for the new version of the
2177
- # secret that helps ensure idempotency.
2178
- #
2179
- # If you use the AWS CLI or one of the AWS SDK to call this operation,
2180
- # then you can leave this parameter empty. The CLI or SDK generates a
2181
- # random UUID for you and includes that in the request for this
2182
- # parameter. If you don't use the SDK and instead generate a raw HTTP
2183
- # request to the Secrets Manager service endpoint, then you must
2184
- # generate a `ClientRequestToken` yourself for new versions and include
2185
- # that value in the request.
2186
- #
2187
- # You only need to specify your own value if you are implementing your
2188
- # own retry logic and want to ensure that a given secret is not created
2189
- # twice. We recommend that you generate a [UUID-type][1] value to ensure
2190
- # uniqueness within the specified secret.
2191
- #
2192
- # Secrets Manager uses this value to prevent the accidental creation of
2193
- # duplicate versions if there are failures and retries during the
2194
- # function's processing. This value becomes the `VersionId` of the new
2195
- # version.
2561
+ # If you generate a raw HTTP request to the Secrets Manager service
2562
+ # endpoint, then you must generate a `ClientRequestToken` and include it
2563
+ # in the request.
2564
+ #
2565
+ # This value helps ensure idempotency. Secrets Manager uses this value
2566
+ # to prevent the accidental creation of duplicate versions if there are
2567
+ # failures and retries during a rotation. We recommend that you generate
2568
+ # a [UUID-type][1] value to ensure uniqueness of your versions within
2569
+ # the specified secret.
2196
2570
  #
2197
2571
  # **A suitable default value is auto-generated.** You should normally
2198
2572
  # not need to pass this option.**
@@ -2202,18 +2576,82 @@ module Aws::SecretsManager
2202
2576
  # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
2203
2577
  #
2204
2578
  # @option params [String] :rotation_lambda_arn
2205
- # (Optional) Specifies the ARN of the Lambda function that can rotate
2206
- # the secret.
2579
+ # For secrets that use a Lambda rotation function to rotate, the ARN of
2580
+ # the Lambda rotation function.
2581
+ #
2582
+ # For secrets that use *managed rotation*, omit this field. For more
2583
+ # information, see [Managed rotation][1] in the *Secrets Manager User
2584
+ # Guide*.
2585
+ #
2586
+ #
2587
+ #
2588
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html
2207
2589
  #
2208
2590
  # @option params [Types::RotationRulesType] :rotation_rules
2209
2591
  # A structure that defines the rotation configuration for this secret.
2210
2592
  #
2593
+ # @option params [Boolean] :rotate_immediately
2594
+ # Specifies whether to rotate the secret immediately or wait until the
2595
+ # next scheduled rotation window. The rotation schedule is defined in
2596
+ # RotateSecretRequest$RotationRules.
2597
+ #
2598
+ # For secrets that use a Lambda rotation function to rotate, if you
2599
+ # don't immediately rotate the secret, Secrets Manager tests the
2600
+ # rotation configuration by running the [ `testSecret` step][1] of the
2601
+ # Lambda rotation function. The test creates an `AWSPENDING` version of
2602
+ # the secret and then removes it.
2603
+ #
2604
+ # By default, Secrets Manager rotates the secret immediately.
2605
+ #
2606
+ #
2607
+ #
2608
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda-functions.html#rotate-secrets_lambda-functions-code
2609
+ #
2211
2610
  # @return [Types::RotateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2212
2611
  #
2213
2612
  # * {Types::RotateSecretResponse#arn #arn} => String
2214
2613
  # * {Types::RotateSecretResponse#name #name} => String
2215
2614
  # * {Types::RotateSecretResponse#version_id #version_id} => String
2216
2615
  #
2616
+ #
2617
+ # @example Example: To configure rotation for a secret
2618
+ #
2619
+ # # The following example configures rotation for a secret using a cron expression. The first rotation happens immediately
2620
+ # # after the changes are stored in the secret. The rotation schedule is the first and 15th day of every month. The rotation
2621
+ # # window begins at 4:00 PM UTC and ends at 6:00 PM.
2622
+ #
2623
+ # resp = client.rotate_secret({
2624
+ # rotation_lambda_arn: "arn:aws:lambda:us-west-2:123456789012:function:MyTestDatabaseRotationLambda",
2625
+ # rotation_rules: {
2626
+ # duration: "2h",
2627
+ # schedule_expression: "cron(0 16 1,15 * ? *)",
2628
+ # },
2629
+ # secret_id: "MyTestDatabaseSecret",
2630
+ # })
2631
+ #
2632
+ # resp.to_h outputs the following:
2633
+ # {
2634
+ # arn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
2635
+ # name: "MyTestDatabaseSecret",
2636
+ # version_id: "EXAMPLE2-90ab-cdef-fedc-ba987SECRET2",
2637
+ # }
2638
+ #
2639
+ # @example Example: To request an immediate rotation for a secret
2640
+ #
2641
+ # # The following example requests an immediate invocation of the secret's Lambda rotation function. It assumes that the
2642
+ # # specified secret already has rotation configured. The rotation function runs asynchronously in the background.
2643
+ #
2644
+ # resp = client.rotate_secret({
2645
+ # secret_id: "MyTestDatabaseSecret",
2646
+ # })
2647
+ #
2648
+ # resp.to_h outputs the following:
2649
+ # {
2650
+ # arn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
2651
+ # name: "MyTestDatabaseSecret",
2652
+ # version_id: "EXAMPLE2-90ab-cdef-fedc-ba987SECRET2",
2653
+ # }
2654
+ #
2217
2655
  # @example Request syntax with placeholder values
2218
2656
  #
2219
2657
  # resp = client.rotate_secret({
@@ -2222,7 +2660,10 @@ module Aws::SecretsManager
2222
2660
  # rotation_lambda_arn: "RotationLambdaARNType",
2223
2661
  # rotation_rules: {
2224
2662
  # automatically_after_days: 1,
2663
+ # duration: "DurationType",
2664
+ # schedule_expression: "ScheduleExpressionType",
2225
2665
  # },
2666
+ # rotate_immediately: false,
2226
2667
  # })
2227
2668
  #
2228
2669
  # @example Response structure
@@ -2240,86 +2681,107 @@ module Aws::SecretsManager
2240
2681
  req.send_request(options)
2241
2682
  end
2242
2683
 
2243
- # Attaches one or more tags, each consisting of a key name and a value,
2244
- # to the specified secret. Tags are part of the secret's overall
2245
- # metadata, and are not associated with any specific version of the
2246
- # secret. This operation only appends tags to the existing list of tags.
2247
- # To remove tags, you must use UntagResource.
2684
+ # Removes the link between the replica secret and the primary secret and
2685
+ # promotes the replica to a primary secret in the replica Region.
2686
+ #
2687
+ # You must call this operation from the Region in which you want to
2688
+ # promote the replica to a primary secret.
2689
+ #
2690
+ # Secrets Manager generates a CloudTrail log entry when you call this
2691
+ # action. Do not include sensitive information in request parameters
2692
+ # because it might be logged. For more information, see [Logging Secrets
2693
+ # Manager events with CloudTrail][1].
2694
+ #
2695
+ # <b>Required permissions: </b>
2696
+ # `secretsmanager:StopReplicationToReplica`. For more information, see [
2697
+ # IAM policy actions for Secrets Manager][2] and [Authentication and
2698
+ # access control in Secrets Manager][3].
2699
+ #
2700
+ #
2248
2701
  #
2249
- # The following basic restrictions apply to tags:
2702
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2703
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2704
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2250
2705
  #
2251
- # * Maximum number of tags per secret—50
2706
+ # @option params [required, String] :secret_id
2707
+ # The ARN of the primary secret.
2708
+ #
2709
+ # @return [Types::StopReplicationToReplicaResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2252
2710
  #
2253
- # * Maximum key length—127 Unicode characters in UTF-8
2711
+ # * {Types::StopReplicationToReplicaResponse#arn #arn} => String
2712
+ #
2713
+ # @example Request syntax with placeholder values
2254
2714
  #
2255
- # * Maximum value length—255 Unicode characters in UTF-8
2715
+ # resp = client.stop_replication_to_replica({
2716
+ # secret_id: "SecretIdType", # required
2717
+ # })
2256
2718
  #
2257
- # * Tag keys and values are case sensitive.
2719
+ # @example Response structure
2258
2720
  #
2259
- # * Do not use the `aws:` prefix in your tag names or values because it
2260
- # is reserved for AWS use. You can't edit or delete tag names or
2261
- # values with this prefix. Tags with this prefix do not count against
2262
- # your tags per secret limit.
2721
+ # resp.arn #=> String
2263
2722
  #
2264
- # * If your tagging schema will be used across multiple services and
2265
- # resources, remember that other services might have restrictions on
2266
- # allowed characters. Generally allowed characters are: letters,
2267
- # spaces, and numbers representable in UTF-8, plus the following
2268
- # special characters: + - = . \_ : / @.
2723
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/StopReplicationToReplica AWS API Documentation
2724
+ #
2725
+ # @overload stop_replication_to_replica(params = {})
2726
+ # @param [Hash] params ({})
2727
+ def stop_replication_to_replica(params = {}, options = {})
2728
+ req = build_request(:stop_replication_to_replica, params)
2729
+ req.send_request(options)
2730
+ end
2731
+
2732
+ # Attaches tags to a secret. Tags consist of a key name and a value.
2733
+ # Tags are part of the secret's metadata. They are not associated with
2734
+ # specific versions of the secret. This operation appends tags to the
2735
+ # existing list of tags.
2736
+ #
2737
+ # For tag quotas and naming restrictions, see [Service quotas for
2738
+ # Tagging][1] in the *Amazon Web Services General Reference guide*.
2269
2739
  #
2270
2740
  # If you use tags as part of your security strategy, then adding or
2271
2741
  # removing a tag can change permissions. If successfully completing this
2272
2742
  # operation would result in you losing your permissions for this secret,
2273
2743
  # then the operation is blocked and returns an Access Denied error.
2274
2744
  #
2275
- # **Minimum permissions**
2745
+ # Secrets Manager generates a CloudTrail log entry when you call this
2746
+ # action. Do not include sensitive information in request parameters
2747
+ # because it might be logged. For more information, see [Logging Secrets
2748
+ # Manager events with CloudTrail][2].
2276
2749
  #
2277
- # To run this command, you must have the following permissions:
2750
+ # <b>Required permissions: </b> `secretsmanager:TagResource`. For more
2751
+ # information, see [ IAM policy actions for Secrets Manager][3] and
2752
+ # [Authentication and access control in Secrets Manager][4].
2278
2753
  #
2279
- # * secretsmanager:TagResource
2280
2754
  #
2281
- # ^
2282
2755
  #
2283
- # **Related operations**
2756
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas
2757
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2758
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2759
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2284
2760
  #
2285
- # * To remove one or more tags from the collection attached to a secret,
2286
- # use UntagResource.
2761
+ # @option params [required, String] :secret_id
2762
+ # The identifier for the secret to attach tags to. You can specify
2763
+ # either the Amazon Resource Name (ARN) or the friendly name of the
2764
+ # secret.
2287
2765
  #
2288
- # * To view the list of tags attached to a secret, use DescribeSecret.
2766
+ # For an ARN, we recommend that you specify a complete ARN rather than a
2767
+ # partial ARN. See [Finding a secret from a partial ARN][1].
2289
2768
  #
2290
- # @option params [required, String] :secret_id
2291
- # The identifier for the secret that you want to attach tags to. You can
2292
- # specify either the Amazon Resource Name (ARN) or the friendly name of
2293
- # the secret.
2294
- #
2295
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
2296
- # complete ARN. You can specify a partial ARN too—for example, if you
2297
- # don’t include the final hyphen and six random characters that Secrets
2298
- # Manager adds at the end of the ARN when you created the secret. A
2299
- # partial ARN match can work as long as it uniquely matches only one
2300
- # secret. However, if your secret has a name that ends in a hyphen
2301
- # followed by six characters (before Secrets Manager adds the hyphen and
2302
- # six characters to the ARN) and you try to use that as a partial ARN,
2303
- # then those characters cause Secrets Manager to assume that you’re
2304
- # specifying a complete ARN. This confusion can cause unexpected
2305
- # results. To avoid this situation, we recommend that you don’t create
2306
- # secret names that end with a hyphen followed by six characters.
2307
2769
  #
2308
- # </note>
2770
+ #
2771
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
2309
2772
  #
2310
2773
  # @option params [required, Array<Types::Tag>] :tags
2311
- # The tags to attach to the secret. Each element in the list consists of
2312
- # a `Key` and a `Value`.
2774
+ # The tags to attach to the secret as a JSON text string argument. Each
2775
+ # element in the list consists of a `Key` and a `Value`.
2313
2776
  #
2314
- # This parameter to the API requires a JSON text string argument. For
2315
- # information on how to format a JSON parameter for the various command
2316
- # line tool environments, see [Using JSON for Parameters][1] in the *AWS
2317
- # CLI User Guide*. For the AWS CLI, you can also use the syntax: `--Tags
2318
- # Key="Key1",Value="Value1",Key="Key2",Value="Value2"[,…]`
2777
+ # For storing multiple values, we recommend that you use a JSON text
2778
+ # string argument and specify key/value pairs. For more information, see
2779
+ # [Specifying parameter values for the Amazon Web Services CLI][1] in
2780
+ # the Amazon Web Services CLI User Guide.
2319
2781
  #
2320
2782
  #
2321
2783
  #
2322
- # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
2784
+ # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html
2323
2785
  #
2324
2786
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2325
2787
  #
@@ -2364,7 +2826,7 @@ module Aws::SecretsManager
2364
2826
  req.send_request(options)
2365
2827
  end
2366
2828
 
2367
- # Removes one or more tags from the specified secret.
2829
+ # Removes specific tags from a secret.
2368
2830
  #
2369
2831
  # This operation is idempotent. If a requested tag is not attached to
2370
2832
  # the secret, no error is returned and the secret metadata is unchanged.
@@ -2374,53 +2836,45 @@ module Aws::SecretsManager
2374
2836
  # would result in you losing your permissions for this secret, then the
2375
2837
  # operation is blocked and returns an Access Denied error.
2376
2838
  #
2377
- # **Minimum permissions**
2839
+ # Secrets Manager generates a CloudTrail log entry when you call this
2840
+ # action. Do not include sensitive information in request parameters
2841
+ # because it might be logged. For more information, see [Logging Secrets
2842
+ # Manager events with CloudTrail][1].
2378
2843
  #
2379
- # To run this command, you must have the following permissions:
2844
+ # <b>Required permissions: </b> `secretsmanager:UntagResource`. For more
2845
+ # information, see [ IAM policy actions for Secrets Manager][2] and
2846
+ # [Authentication and access control in Secrets Manager][3].
2380
2847
  #
2381
- # * secretsmanager:UntagResource
2382
2848
  #
2383
- # ^
2384
2849
  #
2385
- # **Related operations**
2850
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2851
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2852
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2386
2853
  #
2387
- # * To add one or more tags to the collection attached to a secret, use
2388
- # TagResource.
2854
+ # @option params [required, String] :secret_id
2855
+ # The ARN or name of the secret.
2389
2856
  #
2390
- # * To view the list of tags attached to a secret, use DescribeSecret.
2857
+ # For an ARN, we recommend that you specify a complete ARN rather than a
2858
+ # partial ARN. See [Finding a secret from a partial ARN][1].
2391
2859
  #
2392
- # @option params [required, String] :secret_id
2393
- # The identifier for the secret that you want to remove tags from. You
2394
- # can specify either the Amazon Resource Name (ARN) or the friendly name
2395
- # of the secret.
2396
- #
2397
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
2398
- # complete ARN. You can specify a partial ARN too—for example, if you
2399
- # don’t include the final hyphen and six random characters that Secrets
2400
- # Manager adds at the end of the ARN when you created the secret. A
2401
- # partial ARN match can work as long as it uniquely matches only one
2402
- # secret. However, if your secret has a name that ends in a hyphen
2403
- # followed by six characters (before Secrets Manager adds the hyphen and
2404
- # six characters to the ARN) and you try to use that as a partial ARN,
2405
- # then those characters cause Secrets Manager to assume that you’re
2406
- # specifying a complete ARN. This confusion can cause unexpected
2407
- # results. To avoid this situation, we recommend that you don’t create
2408
- # secret names that end with a hyphen followed by six characters.
2409
2860
  #
2410
- # </note>
2861
+ #
2862
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
2411
2863
  #
2412
2864
  # @option params [required, Array<String>] :tag_keys
2413
2865
  # A list of tag key names to remove from the secret. You don't specify
2414
2866
  # the value. Both the key and its associated value are removed.
2415
2867
  #
2416
- # This parameter to the API requires a JSON text string argument. For
2417
- # information on how to format a JSON parameter for the various command
2418
- # line tool environments, see [Using JSON for Parameters][1] in the *AWS
2419
- # CLI User Guide*.
2868
+ # This parameter requires a JSON text string argument.
2869
+ #
2870
+ # For storing multiple values, we recommend that you use a JSON text
2871
+ # string argument and specify key/value pairs. For more information, see
2872
+ # [Specifying parameter values for the Amazon Web Services CLI][1] in
2873
+ # the Amazon Web Services CLI User Guide.
2420
2874
  #
2421
2875
  #
2422
2876
  #
2423
- # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
2877
+ # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html
2424
2878
  #
2425
2879
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2426
2880
  #
@@ -2454,136 +2908,98 @@ module Aws::SecretsManager
2454
2908
  req.send_request(options)
2455
2909
  end
2456
2910
 
2457
- # Modifies many of the details of the specified secret. If you include a
2458
- # `ClientRequestToken` and *either* `SecretString` or `SecretBinary`
2459
- # then it also creates a new version attached to the secret.
2911
+ # Modifies the details of a secret, including metadata and the secret
2912
+ # value. To change the secret value, you can also use PutSecretValue.
2460
2913
  #
2461
- # To modify the rotation configuration of a secret, use RotateSecret
2914
+ # To change the rotation configuration of a secret, use RotateSecret
2462
2915
  # instead.
2463
2916
  #
2464
- # <note markdown="1"> The Secrets Manager console uses only the `SecretString` parameter and
2465
- # therefore limits you to encrypting and storing only a text string. To
2466
- # encrypt and store binary data as part of the version of a secret, you
2467
- # must use either the AWS CLI or one of the AWS SDKs.
2468
- #
2469
- # </note>
2470
- #
2471
- # * If a version with a `VersionId` with the same value as the
2472
- # `ClientRequestToken` parameter already exists, the operation results
2473
- # in an error. You cannot modify an existing version, you can only
2474
- # create a new version.
2475
- #
2476
- # * If you include `SecretString` or `SecretBinary` to create a new
2477
- # secret version, Secrets Manager automatically attaches the staging
2478
- # label `AWSCURRENT` to the new version.
2479
- #
2480
- # <note markdown="1"> * If you call an operation that needs to encrypt or decrypt the
2481
- # `SecretString` or `SecretBinary` for a secret in the same account as
2482
- # the calling user and that secret doesn't specify a AWS KMS
2483
- # encryption key, Secrets Manager uses the account's default AWS
2484
- # managed customer master key (CMK) with the alias
2485
- # `aws/secretsmanager`. If this key doesn't already exist in your
2486
- # account then Secrets Manager creates it for you automatically. All
2487
- # users and roles in the same AWS account automatically have access to
2488
- # use the default CMK. Note that if an Secrets Manager API call
2489
- # results in AWS having to create the account's AWS-managed CMK, it
2490
- # can result in a one-time significant delay in returning the result.
2491
- #
2492
- # * If the secret is in a different AWS account from the credentials
2493
- # calling an API that requires encryption or decryption of the secret
2494
- # value then you must create and use a custom AWS KMS CMK because you
2495
- # can't access the default CMK for the account using credentials from
2496
- # a different AWS account. Store the ARN of the CMK in the secret when
2497
- # you create the secret or when you update it by including it in the
2498
- # `KMSKeyId`. If you call an API that must encrypt or decrypt
2499
- # `SecretString` or `SecretBinary` using credentials from a different
2500
- # account then the AWS KMS key policy must grant cross-account access
2501
- # to that other account's user or role for both the
2502
- # kms:GenerateDataKey and kms:Decrypt operations.
2503
- #
2504
- # </note>
2917
+ # To change a secret so that it is managed by another service, you need
2918
+ # to recreate the secret in that service. See [Secrets Manager secrets
2919
+ # managed by other Amazon Web Services services][1].
2920
+ #
2921
+ # We recommend you avoid calling `UpdateSecret` at a sustained rate of
2922
+ # more than once every 10 minutes. When you call `UpdateSecret` to
2923
+ # update the secret value, Secrets Manager creates a new version of the
2924
+ # secret. Secrets Manager removes outdated versions when there are more
2925
+ # than 100, but it does not remove versions created less than 24 hours
2926
+ # ago. If you update the secret value more than once every 10 minutes,
2927
+ # you create more versions than Secrets Manager removes, and you will
2928
+ # reach the quota for secret versions.
2929
+ #
2930
+ # If you include `SecretString` or `SecretBinary` to create a new secret
2931
+ # version, Secrets Manager automatically moves the staging label
2932
+ # `AWSCURRENT` to the new version. Then it attaches the label
2933
+ # `AWSPREVIOUS` to the version that `AWSCURRENT` was removed from.
2934
+ #
2935
+ # If you call this operation with a `ClientRequestToken` that matches an
2936
+ # existing version's `VersionId`, the operation results in an error.
2937
+ # You can't modify an existing version, you can only create a new
2938
+ # version. To remove a version, remove all staging labels from it. See
2939
+ # UpdateSecretVersionStage.
2940
+ #
2941
+ # Secrets Manager generates a CloudTrail log entry when you call this
2942
+ # action. Do not include sensitive information in request parameters
2943
+ # except `SecretBinary` or `SecretString` because it might be logged.
2944
+ # For more information, see [Logging Secrets Manager events with
2945
+ # CloudTrail][2].
2946
+ #
2947
+ # <b>Required permissions: </b> `secretsmanager:UpdateSecret`. For more
2948
+ # information, see [ IAM policy actions for Secrets Manager][3] and
2949
+ # [Authentication and access control in Secrets Manager][4]. If you use
2950
+ # a customer managed key, you must also have `kms:GenerateDataKey`,
2951
+ # `kms:Encrypt`, and `kms:Decrypt` permissions on the key. If you change
2952
+ # the KMS key and you don't have `kms:Encrypt` permission to the new
2953
+ # key, Secrets Manager does not re-encrypt existing secret versions with
2954
+ # the new key. For more information, see [ Secret encryption and
2955
+ # decryption][5].
2956
+ #
2957
+ # When you enter commands in a command shell, there is a risk of the
2958
+ # command history being accessed or utilities having access to your
2959
+ # command parameters. This is a concern if the command includes the
2960
+ # value of a secret. Learn how to [Mitigate the risks of using
2961
+ # command-line tools to store Secrets Manager secrets][6].
2962
+ #
2963
+ #
2964
+ #
2965
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html
2966
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
2967
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
2968
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2969
+ # [5]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/security-encryption.html
2970
+ # [6]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/security_cli-exposure-risks.html
2505
2971
  #
2506
- # **Minimum permissions**
2507
- #
2508
- # To run this command, you must have the following permissions:
2509
- #
2510
- # * secretsmanager:UpdateSecret
2511
- #
2512
- # * kms:GenerateDataKey - needed only if you use a custom AWS KMS key to
2513
- # encrypt the secret. You do not need this permission to use the
2514
- # account's AWS managed CMK for Secrets Manager.
2515
- #
2516
- # * kms:Decrypt - needed only if you use a custom AWS KMS key to encrypt
2517
- # the secret. You do not need this permission to use the account's
2518
- # AWS managed CMK for Secrets Manager.
2972
+ # @option params [required, String] :secret_id
2973
+ # The ARN or name of the secret.
2519
2974
  #
2520
- # **Related operations**
2975
+ # For an ARN, we recommend that you specify a complete ARN rather than a
2976
+ # partial ARN. See [Finding a secret from a partial ARN][1].
2521
2977
  #
2522
- # * To create a new secret, use CreateSecret.
2523
2978
  #
2524
- # * To add only a new version to an existing secret, use PutSecretValue.
2525
2979
  #
2526
- # * To get the details for a secret, use DescribeSecret.
2980
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
2527
2981
  #
2528
- # * To list the versions contained in a secret, use
2529
- # ListSecretVersionIds.
2982
+ # @option params [String] :client_request_token
2983
+ # If you include `SecretString` or `SecretBinary`, then Secrets Manager
2984
+ # creates a new version for the secret, and this parameter specifies the
2985
+ # unique identifier for the new version.
2530
2986
  #
2531
- # @option params [required, String] :secret_id
2532
- # Specifies the secret that you want to modify or to which you want to
2533
- # add a new version. You can specify either the Amazon Resource Name
2534
- # (ARN) or the friendly name of the secret.
2535
- #
2536
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
2537
- # complete ARN. You can specify a partial ARN too—for example, if you
2538
- # don’t include the final hyphen and six random characters that Secrets
2539
- # Manager adds at the end of the ARN when you created the secret. A
2540
- # partial ARN match can work as long as it uniquely matches only one
2541
- # secret. However, if your secret has a name that ends in a hyphen
2542
- # followed by six characters (before Secrets Manager adds the hyphen and
2543
- # six characters to the ARN) and you try to use that as a partial ARN,
2544
- # then those characters cause Secrets Manager to assume that you’re
2545
- # specifying a complete ARN. This confusion can cause unexpected
2546
- # results. To avoid this situation, we recommend that you don’t create
2547
- # secret names that end with a hyphen followed by six characters.
2987
+ # <note markdown="1"> If you use the Amazon Web Services CLI or one of the Amazon Web
2988
+ # Services SDKs to call this operation, then you can leave this
2989
+ # parameter empty. The CLI or SDK generates a random UUID for you and
2990
+ # includes it as the value for this parameter in the request.
2548
2991
  #
2549
2992
  # </note>
2550
2993
  #
2551
- # @option params [String] :client_request_token
2552
- # (Optional) If you want to add a new version to the secret, this
2553
- # parameter specifies a unique identifier for the new version that helps
2554
- # ensure idempotency.
2555
- #
2556
- # If you use the AWS CLI or one of the AWS SDK to call this operation,
2557
- # then you can leave this parameter empty. The CLI or SDK generates a
2558
- # random UUID for you and includes that in the request. If you don't
2559
- # use the SDK and instead generate a raw HTTP request to the Secrets
2560
- # Manager service endpoint, then you must generate a
2561
- # `ClientRequestToken` yourself for new versions and include that value
2994
+ # If you generate a raw HTTP request to the Secrets Manager service
2995
+ # endpoint, then you must generate a `ClientRequestToken` and include it
2562
2996
  # in the request.
2563
2997
  #
2564
- # You typically only need to interact with this value if you implement
2565
- # your own retry logic and want to ensure that a given secret is not
2566
- # created twice. We recommend that you generate a [UUID-type][1] value
2567
- # to ensure uniqueness within the specified secret.
2568
- #
2569
- # Secrets Manager uses this value to prevent the accidental creation of
2570
- # duplicate versions if there are failures and retries during the Lambda
2571
- # rotation function's processing.
2572
- #
2573
- # * If the `ClientRequestToken` value isn't already associated with a
2574
- # version of the secret then a new version of the secret is created.
2575
- #
2576
- # * If a version with this value already exists and that version's
2577
- # `SecretString` and `SecretBinary` values are the same as those in
2578
- # the request then the request is ignored (the operation is
2579
- # idempotent).
2580
- #
2581
- # * If a version with this value already exists and that version's
2582
- # `SecretString` and `SecretBinary` values are different from the
2583
- # request then an error occurs because you cannot modify an existing
2584
- # secret value.
2585
- #
2586
- # This value becomes the `VersionId` of the new version.
2998
+ # This value helps ensure idempotency. Secrets Manager uses this value
2999
+ # to prevent the accidental creation of duplicate versions if there are
3000
+ # failures and retries during a rotation. We recommend that you generate
3001
+ # a [UUID-type][1] value to ensure uniqueness of your versions within
3002
+ # the specified secret.
2587
3003
  #
2588
3004
  # **A suitable default value is auto-generated.** You should normally
2589
3005
  # not need to pass this option.**
@@ -2593,64 +3009,69 @@ module Aws::SecretsManager
2593
3009
  # [1]: https://wikipedia.org/wiki/Universally_unique_identifier
2594
3010
  #
2595
3011
  # @option params [String] :description
2596
- # (Optional) Specifies an updated user-provided description of the
2597
- # secret.
3012
+ # The description of the secret.
2598
3013
  #
2599
3014
  # @option params [String] :kms_key_id
2600
- # (Optional) Specifies an updated ARN or alias of the AWS KMS customer
2601
- # master key (CMK) to be used to encrypt the protected text in new
2602
- # versions of this secret.
2603
- #
2604
- # You can only use the account's default CMK to encrypt and decrypt if
2605
- # you call this operation using credentials from the same account that
2606
- # owns the secret. If the secret is in a different account, then you
2607
- # must create a custom CMK and provide the ARN of that CMK in this
2608
- # field. The user making the call must have permissions to both the
2609
- # secret and the CMK in their respective accounts.
2610
- #
2611
- # @option params [String, IO] :secret_binary
2612
- # (Optional) Specifies updated binary data that you want to encrypt and
2613
- # store in the new version of the secret. To use this parameter in the
2614
- # command-line tools, we recommend that you store your binary data in a
2615
- # file and then use the appropriate technique for your tool to pass the
2616
- # contents of the file as a parameter. Either `SecretBinary` or
2617
- # `SecretString` must have a value, but not both. They cannot both be
2618
- # empty.
2619
- #
2620
- # This parameter is not accessible using the Secrets Manager console.
3015
+ # The ARN, key ID, or alias of the KMS key that Secrets Manager uses to
3016
+ # encrypt new secret versions as well as any existing versions with the
3017
+ # staging labels `AWSCURRENT`, `AWSPENDING`, or `AWSPREVIOUS`. If you
3018
+ # don't have `kms:Encrypt` permission to the new key, Secrets Manager
3019
+ # does not re-encrypt existing secret versions with the new key. For
3020
+ # more information about versions and staging labels, see [Concepts:
3021
+ # Version][1].
3022
+ #
3023
+ # A key alias is always prefixed by `alias/`, for example
3024
+ # `alias/aws/secretsmanager`. For more information, see [About
3025
+ # aliases][2].
3026
+ #
3027
+ # If you set this to an empty string, Secrets Manager uses the Amazon
3028
+ # Web Services managed key `aws/secretsmanager`. If this key doesn't
3029
+ # already exist in your account, then Secrets Manager creates it for you
3030
+ # automatically. All users and roles in the Amazon Web Services account
3031
+ # automatically have access to use `aws/secretsmanager`. Creating
3032
+ # `aws/secretsmanager` can result in a one-time significant delay in
3033
+ # returning the result.
3034
+ #
3035
+ # You can only use the Amazon Web Services managed key
3036
+ # `aws/secretsmanager` if you call this operation using credentials from
3037
+ # the same Amazon Web Services account that owns the secret. If the
3038
+ # secret is in a different account, then you must use a customer managed
3039
+ # key and provide the ARN of that KMS key in this field. The user making
3040
+ # the call must have permissions to both the secret and the KMS key in
3041
+ # their respective accounts.
3042
+ #
3043
+ #
3044
+ #
3045
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version
3046
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html
3047
+ #
3048
+ # @option params [String, StringIO, File] :secret_binary
3049
+ # The binary data to encrypt and store in the new version of the secret.
3050
+ # We recommend that you store your binary data in a file and then pass
3051
+ # the contents of the file as a parameter.
3052
+ #
3053
+ # Either `SecretBinary` or `SecretString` must have a value, but not
3054
+ # both.
3055
+ #
3056
+ # You can't access this parameter in the Secrets Manager console.
3057
+ #
3058
+ # Sensitive: This field contains sensitive information, so the service
3059
+ # does not include it in CloudTrail log entries. If you create your own
3060
+ # log entries, you must also avoid logging the information in this
3061
+ # field.
2621
3062
  #
2622
3063
  # @option params [String] :secret_string
2623
- # (Optional) Specifies updated text data that you want to encrypt and
2624
- # store in this new version of the secret. Either `SecretBinary` or
2625
- # `SecretString` must have a value, but not both. They cannot both be
2626
- # empty.
2627
- #
2628
- # If you create this secret by using the Secrets Manager console then
2629
- # Secrets Manager puts the protected secret text in only the
2630
- # `SecretString` parameter. The Secrets Manager console stores the
2631
- # information as a JSON structure of key/value pairs that the default
2632
- # Lambda rotation function knows how to parse.
2633
- #
2634
- # For storing multiple values, we recommend that you use a JSON text
2635
- # string argument and specify key/value pairs. For information on how to
2636
- # format a JSON parameter for the various command line tool
2637
- # environments, see [Using JSON for Parameters][1] in the *AWS CLI User
2638
- # Guide*. For example:
2639
- #
2640
- # `[\{"username":"bob"\},\{"password":"abc123xyz456"\}]`
2641
- #
2642
- # If your command-line tool or SDK requires quotation marks around the
2643
- # parameter, you should use single quotes to avoid confusion with the
2644
- # double quotes required in the JSON text. You can also 'escape' the
2645
- # double quote character in the embedded JSON text by prefacing each
2646
- # with a backslash. For example, the following string is surrounded by
2647
- # double-quotes. All of the embedded double quotes are escaped:
2648
- #
2649
- # `"[\{"username":"bob"\},\{"password":"abc123xyz456"\}]"`
3064
+ # The text data to encrypt and store in the new version of the secret.
3065
+ # We recommend you use a JSON structure of key/value pairs for your
3066
+ # secret value.
2650
3067
  #
3068
+ # Either `SecretBinary` or `SecretString` must have a value, but not
3069
+ # both.
2651
3070
  #
2652
- #
2653
- # [1]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json
3071
+ # Sensitive: This field contains sensitive information, so the service
3072
+ # does not include it in CloudTrail log entries. If you create your own
3073
+ # log entries, you must also avoid logging the information in this
3074
+ # field.
2654
3075
  #
2655
3076
  # @return [Types::UpdateSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2656
3077
  #
@@ -2734,18 +3155,17 @@ module Aws::SecretsManager
2734
3155
  req.send_request(options)
2735
3156
  end
2736
3157
 
2737
- # Modifies the staging labels attached to a version of a secret. Staging
2738
- # labels are used to track a version as it progresses through the secret
2739
- # rotation process. You can attach a staging label to only one version
2740
- # of a secret at a time. If a staging label to be added is already
2741
- # attached to another version, then it is moved--removed from the other
2742
- # version first and then attached to this one. For more information
2743
- # about staging labels, see [Staging Labels][1] in the *AWS Secrets
2744
- # Manager User Guide*.
3158
+ # Modifies the staging labels attached to a version of a secret. Secrets
3159
+ # Manager uses staging labels to track a version as it progresses
3160
+ # through the secret rotation process. Each staging label can be
3161
+ # attached to only one version at a time. To add a staging label to a
3162
+ # version when it is already attached to another version, Secrets
3163
+ # Manager first removes it from the other version first and then
3164
+ # attaches it to this one. For more information about versions and
3165
+ # staging labels, see [Concepts: Version][1].
2745
3166
  #
2746
3167
  # The staging labels that you specify in the `VersionStage` parameter
2747
- # are added to the existing list of staging labels--they don't replace
2748
- # it.
3168
+ # are added to the existing list of staging labels for the version.
2749
3169
  #
2750
3170
  # You can move the `AWSCURRENT` staging label to this version by
2751
3171
  # including it in this call.
@@ -2760,62 +3180,48 @@ module Aws::SecretsManager
2760
3180
  # then the version is considered to be 'deprecated' and can be deleted
2761
3181
  # by Secrets Manager.
2762
3182
  #
2763
- # **Minimum permissions**
2764
- #
2765
- # To run this command, you must have the following permissions:
3183
+ # Secrets Manager generates a CloudTrail log entry when you call this
3184
+ # action. Do not include sensitive information in request parameters
3185
+ # because it might be logged. For more information, see [Logging Secrets
3186
+ # Manager events with CloudTrail][2].
2766
3187
  #
2767
- # * secretsmanager:UpdateSecretVersionStage
3188
+ # <b>Required permissions: </b>
3189
+ # `secretsmanager:UpdateSecretVersionStage`. For more information, see [
3190
+ # IAM policy actions for Secrets Manager][3] and [Authentication and
3191
+ # access control in Secrets Manager][4].
2768
3192
  #
2769
- # ^
2770
3193
  #
2771
- # **Related operations**
2772
3194
  #
2773
- # * To get the list of staging labels that are currently associated with
2774
- # a version of a secret, use ` DescribeSecret ` and examine the
2775
- # `SecretVersionsToStages` response value.
3195
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version
3196
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
3197
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
3198
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
2776
3199
  #
2777
- # ^
3200
+ # @option params [required, String] :secret_id
3201
+ # The ARN or the name of the secret with the version and staging
3202
+ # labelsto modify.
2778
3203
  #
3204
+ # For an ARN, we recommend that you specify a complete ARN rather than a
3205
+ # partial ARN. See [Finding a secret from a partial ARN][1].
2779
3206
  #
2780
3207
  #
2781
- # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/terms-concepts.html#term_staging-label
2782
3208
  #
2783
- # @option params [required, String] :secret_id
2784
- # Specifies the secret with the version whose list of staging labels you
2785
- # want to modify. You can specify either the Amazon Resource Name (ARN)
2786
- # or the friendly name of the secret.
2787
- #
2788
- # <note markdown="1"> If you specify an ARN, we generally recommend that you specify a
2789
- # complete ARN. You can specify a partial ARN too—for example, if you
2790
- # don’t include the final hyphen and six random characters that Secrets
2791
- # Manager adds at the end of the ARN when you created the secret. A
2792
- # partial ARN match can work as long as it uniquely matches only one
2793
- # secret. However, if your secret has a name that ends in a hyphen
2794
- # followed by six characters (before Secrets Manager adds the hyphen and
2795
- # six characters to the ARN) and you try to use that as a partial ARN,
2796
- # then those characters cause Secrets Manager to assume that you’re
2797
- # specifying a complete ARN. This confusion can cause unexpected
2798
- # results. To avoid this situation, we recommend that you don’t create
2799
- # secret names that end with a hyphen followed by six characters.
2800
- #
2801
- # </note>
3209
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen
2802
3210
  #
2803
3211
  # @option params [required, String] :version_stage
2804
3212
  # The staging label to add to this version.
2805
3213
  #
2806
3214
  # @option params [String] :remove_from_version_id
2807
- # Specifies the secret version ID of the version that the staging label
2808
- # is to be removed from. If the staging label you are trying to attach
2809
- # to one version is already attached to a different version, then you
2810
- # must include this parameter and specify the version that the label is
2811
- # to be removed from. If the label is attached and you either do not
2812
- # specify this parameter, or the version ID does not match, then the
2813
- # operation fails.
3215
+ # The ID of the version that the staging label is to be removed from. If
3216
+ # the staging label you are trying to attach to one version is already
3217
+ # attached to a different version, then you must include this parameter
3218
+ # and specify the version that the label is to be removed from. If the
3219
+ # label is attached and you either do not specify this parameter, or the
3220
+ # version ID does not match, then the operation fails.
2814
3221
  #
2815
3222
  # @option params [String] :move_to_version_id
2816
- # (Optional) The secret version ID that you want to add the staging
2817
- # label to. If you want to remove a label from a version, then do not
2818
- # specify this parameter.
3223
+ # The ID of the version to add the staging label to. To remove a label
3224
+ # from a version, then do not specify this parameter.
2819
3225
  #
2820
3226
  # If the staging label is already attached to a different version of the
2821
3227
  # secret, then you must also specify the `RemoveFromVersionId`
@@ -2904,20 +3310,115 @@ module Aws::SecretsManager
2904
3310
  req.send_request(options)
2905
3311
  end
2906
3312
 
3313
+ # Validates that a resource policy does not grant a wide range of
3314
+ # principals access to your secret. A resource-based policy is optional
3315
+ # for secrets.
3316
+ #
3317
+ # The API performs three checks when validating the policy:
3318
+ #
3319
+ # * Sends a call to [Zelkova][1], an automated reasoning engine, to
3320
+ # ensure your resource policy does not allow broad access to your
3321
+ # secret, for example policies that use a wildcard for the principal.
3322
+ #
3323
+ # * Checks for correct syntax in a policy.
3324
+ #
3325
+ # * Verifies the policy does not lock out a caller.
3326
+ #
3327
+ # Secrets Manager generates a CloudTrail log entry when you call this
3328
+ # action. Do not include sensitive information in request parameters
3329
+ # because it might be logged. For more information, see [Logging Secrets
3330
+ # Manager events with CloudTrail][2].
3331
+ #
3332
+ # <b>Required permissions: </b> `secretsmanager:ValidateResourcePolicy`
3333
+ # and `secretsmanager:PutResourcePolicy`. For more information, see [
3334
+ # IAM policy actions for Secrets Manager][3] and [Authentication and
3335
+ # access control in Secrets Manager][4].
3336
+ #
3337
+ #
3338
+ #
3339
+ # [1]: https://aws.amazon.com/blogs/security/protect-sensitive-data-in-the-cloud-with-automated-reasoning-zelkova/
3340
+ # [2]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html
3341
+ # [3]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions
3342
+ # [4]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html
3343
+ #
3344
+ # @option params [String] :secret_id
3345
+ # The ARN or name of the secret with the resource-based policy you want
3346
+ # to validate.
3347
+ #
3348
+ # @option params [required, String] :resource_policy
3349
+ # A JSON-formatted string that contains an Amazon Web Services
3350
+ # resource-based policy. The policy in the string identifies who can
3351
+ # access or manage this secret and its versions. For example policies,
3352
+ # see [Permissions policy examples][1].
3353
+ #
3354
+ #
3355
+ #
3356
+ # [1]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html
3357
+ #
3358
+ # @return [Types::ValidateResourcePolicyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3359
+ #
3360
+ # * {Types::ValidateResourcePolicyResponse#policy_validation_passed #policy_validation_passed} => Boolean
3361
+ # * {Types::ValidateResourcePolicyResponse#validation_errors #validation_errors} => Array&lt;Types::ValidationErrorsEntry&gt;
3362
+ #
3363
+ #
3364
+ # @example Example: To validate a resource-based policy to a secret
3365
+ #
3366
+ # # The following example shows how to validate a resource-based policy to a secret.
3367
+ #
3368
+ # resp = client.validate_resource_policy({
3369
+ # resource_policy: "{\n\"Version\":\"2012-10-17\",\n\"Statement\":[{\n\"Effect\":\"Allow\",\n\"Principal\":{\n\"AWS\":\"arn:aws:iam::123456789012:root\"\n},\n\"Action\":\"secretsmanager:GetSecretValue\",\n\"Resource\":\"*\"\n}]\n}",
3370
+ # secret_id: "MyTestDatabaseSecret",
3371
+ # })
3372
+ #
3373
+ # resp.to_h outputs the following:
3374
+ # {
3375
+ # policy_validation_passed: true,
3376
+ # validation_errors: [
3377
+ # ],
3378
+ # }
3379
+ #
3380
+ # @example Request syntax with placeholder values
3381
+ #
3382
+ # resp = client.validate_resource_policy({
3383
+ # secret_id: "SecretIdType",
3384
+ # resource_policy: "NonEmptyResourcePolicyType", # required
3385
+ # })
3386
+ #
3387
+ # @example Response structure
3388
+ #
3389
+ # resp.policy_validation_passed #=> Boolean
3390
+ # resp.validation_errors #=> Array
3391
+ # resp.validation_errors[0].check_name #=> String
3392
+ # resp.validation_errors[0].error_message #=> String
3393
+ #
3394
+ # @see http://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/ValidateResourcePolicy AWS API Documentation
3395
+ #
3396
+ # @overload validate_resource_policy(params = {})
3397
+ # @param [Hash] params ({})
3398
+ def validate_resource_policy(params = {}, options = {})
3399
+ req = build_request(:validate_resource_policy, params)
3400
+ req.send_request(options)
3401
+ end
3402
+
2907
3403
  # @!endgroup
2908
3404
 
2909
3405
  # @param params ({})
2910
3406
  # @api private
2911
3407
  def build_request(operation_name, params = {})
2912
3408
  handlers = @handlers.for(operation_name)
3409
+ tracer = config.telemetry_provider.tracer_provider.tracer(
3410
+ Aws::Telemetry.module_to_tracer_name('Aws::SecretsManager')
3411
+ )
2913
3412
  context = Seahorse::Client::RequestContext.new(
2914
3413
  operation_name: operation_name,
2915
3414
  operation: config.api.operation(operation_name),
2916
3415
  client: self,
2917
3416
  params: params,
2918
- config: config)
3417
+ config: config,
3418
+ tracer: tracer
3419
+ )
2919
3420
  context[:gem_name] = 'aws-sdk-secretsmanager'
2920
- context[:gem_version] = '1.31.0'
3421
+ context[:gem_version] = '1.113.0'
2921
3422
  Seahorse::Client::Request.new(handlers, context)
2922
3423
  end
2923
3424