選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

AWS::SecretsManager::SecretTargetAttachment

焦點模式

在本頁面

AWS::SecretsManager::SecretTargetAttachment - AWS CloudFormation
此頁面尚未翻譯為您的語言。 請求翻譯
篩選條件查看

The AWS::SecretsManager::SecretTargetAttachment resource completes the final link between a Secrets Manager secret and the associated database by adding the database connection information to the secret JSON. If you want to turn on automatic rotation for a database credential secret, the secret must contain the database connection information. For more information, see JSON structure of Secrets Manager database credential secrets.

A single secret resource can only have one target attached to it.

When you remove a SecretTargetAttachment from a stack, Secrets Manager removes the database connection information from the secret with a PutSecretValue call.

For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret.

For Amazon Redshift admin user credentials, see AWS::Redshift::Cluster.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::SecretsManager::SecretTargetAttachment", "Properties" : { "SecretId" : String, "TargetId" : String, "TargetType" : String } }

YAML

Type: AWS::SecretsManager::SecretTargetAttachment Properties: SecretId: String TargetId: String TargetType: String

Properties

SecretId

The ARN or name of the secret. To reference a secret also created in this template, use the see Ref function with the secret's logical ID. This field is unique for each target attachment definition.

Required: Yes

Type: String

Update requires: Replacement

TargetId

The ID of the database or cluster.

Required: Yes

Type: String

Update requires: No interruption

TargetType

A string that defines the type of service or database associated with the secret. This value instructs Secrets Manager how to update the secret with the details of the service or database. This value must be one of the following:

  • AWS::RDS::DBInstance

  • AWS::RDS::DBCluster

  • AWS::Redshift::Cluster

  • AWS::RedshiftServerless::Namespace

  • AWS::DocDB::DBInstance

  • AWS::DocDB::DBCluster

  • AWS::DocDBElastic::Cluster

Required: Yes

Type: String

Update requires: No interruption

Return values

Ref

When you pass the logical ID of an AWS::SecretsManager::SecretTargetAttachment resource to the intrinsic Ref function, the function returns the ARN of the secret, such as:

arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c

You can use the ARN to reference a secret you created in one part of the stack template from within the definition of another resource from a different part of the same template.

For more information about using the Ref function, see Ref.

Fn::GetAtt

See also

下一個主題:

Next

上一個主題:

Tag
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。