[ aws . secretsmanager ]
Links a primary secret in your account to a replica secret in a different Amazon Web Services account and starts replication to this replica. The replica secret must already exist in the other Amazon Web Services account. Create the replica with CreateSecret and set its CrossAccountPrimaryARN field set to this primary secret’s ARN. When you call AssociateCrossAccountReplica, Secrets Manager calls AcceptCrossAccountReplication on the replica secret on your behalf.
The primary and replica secrets must be in the same Amazon Web Services Region and partition, and you must call this operation from the account that owns the primary secret. A primary secret can have at most one cross-account replica. This operation is idempotent, so you can call it again for the same replica to repair replication. If the association fails, Secrets Manager does not modify either the primary or replica secret.
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:AssociateCrossAccountReplica,secretsmanager:GetSecretValueon the primary secret, andsecretsmanager:AcceptCrossAccountReplicationon the replica secret. You must also havekms:Decryptpermission for the Key Management Service (KMS) key that encrypts the primary secret, andkms:Encryptpermission for the Amazon Web Services KMS key that encrypts the replica secret. If you supplyReplicationRoleARN, you also neediam:PassRolefor that role. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
See also: AWS API Documentation
associate-cross-account-replica
--secret-id <value>
--cross-account-replica-arn <value>
[--replica-restriction <value>]
[--replication-role-arn <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
--secret-id (string) [required]
The ARN or name of the primary secret in your account to replicate.
For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret from a partial ARN .
Constraints:
- min:
1- max:
2048
--cross-account-replica-arn (string) [required]
The ARN of the replica secret in the other Amazon Web Services account. The replica secret must be in the same Region and partition as the primary secret. Additionally, the replica account owner must have created the replica secret as a cross-account replica of the primary secret. For more information see CreateSecret .
Constraints:
- min:
20- max:
2048
--replica-restriction (string)
Whether the replica account must belong to the same Amazon Web Services organization as the primary account:
SameOrg, which requires the replica account to be in the same organization as the primary account. This is the default.NoRestriction, which allows the replica account to be in any organization.Possible values:
SameOrgNoRestriction
--replication-role-arn (string)
The ARN of an IAM role in the primary account that Secrets Manager assumes to perform replication. If you don’t include this field, Secrets Manager replicates using the credentials of caller who updates the primary secret. For more information, see Cross-account replication permissions .
Constraints:
- min:
20- max:
2048
--cli-input-json | --cli-input-yaml (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.
--generate-cli-skeleton (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug (boolean)
Turn on debug logging.
--endpoint-url (string)
Override command’s default URL with the given URL.
--no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate (boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output (string)
The formatting style for command output.
--query (string)
A JMESPath query to use in filtering the response data.
--profile (string)
Use a specific profile from your credential file.
--region (string)
The region to use. Overrides config/env settings.
--version (string)
Display the version of this tool.
--color (string)
Turn on/off color output.
--no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format (string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.
--no-cli-pager (boolean)
Disable cli pager for output.
--cli-auto-prompt (boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt (boolean)
Disable automatically prompt for CLI input parameters.
--cli-error-format (string)
The formatting style for error output. By default, errors are displayed in enhanced format.
--help (boolean)
Display help for the command/subcommand.
ARN -> (string)
The ARN of the primary secret.
Constraints:
- min:
20- max:
2048
CrossAccountReplicaARN -> (string)
The ARN of the replica secret in the other account.
Constraints:
- min:
20- max:
2048
ReplicationStatus -> (string)
The status of replication to the replica secret. Possible values:
InSync, which indicates that replication to the replica completed successfully and the replica is up to date.Failed, which indicates that replication to the replica did not succeed.InProgress, which indicates that Secrets Manager is replicating to the replica.Pending, which indicates that replication has not yet started.Detached, which indicates that primary secret is no longer linked to the replica secret.Possible values:
InSyncFailedInProgressPendingDetached