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
1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 | |