import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { AssociateCrossAccountReplicaRequest, AssociateCrossAccountReplicaResponse } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; /** * @public * * The input for {@link AssociateCrossAccountReplicaCommand}. */ export interface AssociateCrossAccountReplicaCommandInput extends AssociateCrossAccountReplicaRequest { } /** * @public * * The output of {@link AssociateCrossAccountReplicaCommand}. */ export interface AssociateCrossAccountReplicaCommandOutput extends AssociateCrossAccountReplicaResponse, __MetadataBearer { } declare const AssociateCrossAccountReplicaCommand_base: { new (input: AssociateCrossAccountReplicaCommandInput): import("@smithy/core/client").CommandImpl; new (input: AssociateCrossAccountReplicaCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions; }; /** *

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:GetSecretValue on the primary secret, and * secretsmanager:AcceptCrossAccountReplication on the replica secret. You * must also have kms:Decrypt permission for the Key Management Service * (KMS) key that encrypts the primary secret, and * kms:Encrypt permission for the Amazon Web Services KMS key that encrypts the replica * secret. If you supply ReplicationRoleARN, you also need * iam:PassRole for that role. For more information, see * IAM policy actions for Secrets Manager and Authentication * and access control in Secrets Manager.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { SecretsManagerClient, AssociateCrossAccountReplicaCommand } from "@aws-sdk/client-secrets-manager"; // ES Modules import * // const { SecretsManagerClient, AssociateCrossAccountReplicaCommand } = require("@aws-sdk/client-secrets-manager"); // CommonJS import * // import type { SecretsManagerClientConfig } from "@aws-sdk/client-secrets-manager"; * const config = {}; // type is SecretsManagerClientConfig * const client = new SecretsManagerClient(config); * const input = { // AssociateCrossAccountReplicaRequest * SecretId: "STRING_VALUE", // required * CrossAccountReplicaARN: "STRING_VALUE", // required * ReplicaRestriction: "SameOrg" || "NoRestriction", * ReplicationRoleARN: "STRING_VALUE", * }; * const command = new AssociateCrossAccountReplicaCommand(input); * const response = await client.send(command); * // { // AssociateCrossAccountReplicaResponse * // ARN: "STRING_VALUE", * // CrossAccountReplicaARN: "STRING_VALUE", * // ReplicationStatus: "InSync" || "Failed" || "InProgress" || "Pending" || "Detached", * // }; * * ``` * * @param AssociateCrossAccountReplicaCommandInput - {@link AssociateCrossAccountReplicaCommandInput} * @returns {@link AssociateCrossAccountReplicaCommandOutput} * @see {@link AssociateCrossAccountReplicaCommandInput} for command's `input` shape. * @see {@link AssociateCrossAccountReplicaCommandOutput} for command's `response` shape. * @see {@link SecretsManagerClientResolvedConfig | config} for SecretsManagerClient's `config` shape. * * @throws {@link InternalServiceError} (server fault) *

An error occurred on the server side.

* * @throws {@link InvalidParameterException} (client fault) *

The parameter name or value is invalid.

* * @throws {@link InvalidRequestException} (client fault) *

A parameter value is not valid for the current state of the * resource.

*

Possible causes:

* * * @throws {@link LimitExceededException} (client fault) *

The request failed because it would exceed one of the Secrets Manager quotas.

* * @throws {@link ResourceNotFoundException} (client fault) *

Secrets Manager can't find the resource that you asked for.

* * @throws {@link SecretsManagerServiceException} *

Base exception class for all service exceptions from SecretsManager service.

* * * @example To replicate a secret to another account * ```javascript * // The following example links a primary secret to a replica secret in another AWS account and starts replication. The replica secret was previously created in the other account using CreateSecret with the CrossAccountPrimaryARN set to this primary secret. * const input = { * CrossAccountReplicaARN: "arn:aws:secretsmanager:us-west-2:222222222222:secret:MyReplicaSecret-a1b2c3", * SecretId: "MyTestDatabaseSecret" * }; * const command = new AssociateCrossAccountReplicaCommand(input); * const response = await client.send(command); * /* response is * { * ARN: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3", * CrossAccountReplicaARN: "arn:aws:secretsmanager:us-west-2:222222222222:secret:MyReplicaSecret-a1b2c3", * ReplicationStatus: "InProgress" * } * *\/ * ``` * * @public */ export declare class AssociateCrossAccountReplicaCommand extends AssociateCrossAccountReplicaCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: AssociateCrossAccountReplicaRequest; output: AssociateCrossAccountReplicaResponse; }; sdk: { input: AssociateCrossAccountReplicaCommandInput; output: AssociateCrossAccountReplicaCommandOutput; }; }; }