replicate_secret_to_regions
async
¶
replicate_secret_to_regions(
secret_id: SecretIdType,
add_replica_regions: AddReplicaRegionListType,
*,
config_overrides: Optional[AsyncSecretsManagerClientConfig] = None,
force_overwrite_replica_secret: Optional[BooleanType] = None,
) -> ReplicateSecretToRegionsResponse
Replicates the secret to a new Regions. See Multi-Region secrets.
Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail.
Required permissions: secretsmanager:ReplicateSecretToRegions. If the primary secret is encrypted with a KMS key other than aws/secretsmanager, you also need kms:Decrypt permission to the key. To encrypt the replicated secret with a KMS key other than aws/secretsmanager, you need kms:GenerateDataKey and kms:Encrypt to the key. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.
Parameters:
-
secret_id(SecretIdType) –The ARN or name of the secret to replicate.
-
add_replica_regions(AddReplicaRegionListType) –A list of Regions in which to replicate the secret.
-
force_overwrite_replica_secret(Optional[BooleanType], default:None) –Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.
Raises:
-
InternalServiceError–An error occurred on the server side.
-
InvalidParameterException–The parameter name or value is invalid.
-
InvalidRequestException–A parameter value is not valid for the current state of the resource.
Possible causes:
-
The secret is scheduled for deletion.
-
You tried to enable rotation on a secret that doesn't already have a Lambda function ARN configured and you didn't include such an ARN as a parameter in this call.
-
The secret is managed by another service, and you must use that service to update it. For more information, see Secrets managed by other Amazon Web Services services.
-
-
ResourceNotFoundException–Secrets Manager can't find the resource that you asked for.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Example The following example replicates a secret to eu-west-3. The replica is encrypted with the AWS managed key aws/secretsmanager.
>>> await client.replicate_secret_to_regions(secret_id='MyTestSecret', add_replica_regions=[{'Region': 'eu-west-3'}], force_overwrite_replica_secret=True)
Source code in docs_src/capo_secrets_manager/_services/async_secrets_manager.py
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 | |