`AWS::RDS::DBProxy AuthFormat` 的秘密必须包含什么
What does the secret have to contain for `AWS::RDS::DBProxy AuthFormat`
要使用 CloudFormation 创建 AWS::RDS::DBProxy
,您需要提供 SecretsManager Secret 作为身份验证方法。在下面的示例中,它是 BootstrapProxySecretArn
:
指向的秘密
Resources:
TestDBProxy:
Type: AWS::RDS::DBProxy
Properties:
DBProxyName: !Ref ProxyName
EngineFamily: MYSQL
RoleArn:
!Ref BootstrapSecretReaderRoleArn
Auth:
- {AuthScheme: SECRETS, SecretArn: !Ref BootstrapProxySecretArn, IAMAuth: DISABLED}
VpcSubnetIds:
但是 CloudFormation 文档没有解释这个秘密需要包含什么。它是包含该数据库用户名密码的秘密吗?
秘密管理器的不同数据库的模板是here。对于 MySQL 它将是:
{
"engine": "mysql",
"host": "<required: instance host name/resolvable DNS name>",
"username": "<required: username>",
"password": "<required: password>",
"dbname": "<optional: database name. If not specified, defaults to None>",
"port": "<optional: TCP port number. If not specified, defaults to 3306>"
}
或者,您始终可以使用 AWS 控制台自动为您的数据库创建密钥,并检查其结构,然后您可以在 CloudFormation 中重复使用。
要使用 CloudFormation 创建 AWS::RDS::DBProxy
,您需要提供 SecretsManager Secret 作为身份验证方法。在下面的示例中,它是 BootstrapProxySecretArn
:
Resources:
TestDBProxy:
Type: AWS::RDS::DBProxy
Properties:
DBProxyName: !Ref ProxyName
EngineFamily: MYSQL
RoleArn:
!Ref BootstrapSecretReaderRoleArn
Auth:
- {AuthScheme: SECRETS, SecretArn: !Ref BootstrapProxySecretArn, IAMAuth: DISABLED}
VpcSubnetIds:
但是 CloudFormation 文档没有解释这个秘密需要包含什么。它是包含该数据库用户名密码的秘密吗?
秘密管理器的不同数据库的模板是here。对于 MySQL 它将是:
{
"engine": "mysql",
"host": "<required: instance host name/resolvable DNS name>",
"username": "<required: username>",
"password": "<required: password>",
"dbname": "<optional: database name. If not specified, defaults to None>",
"port": "<optional: TCP port number. If not specified, defaults to 3306>"
}
或者,您始终可以使用 AWS 控制台自动为您的数据库创建密钥,并检查其结构,然后您可以在 CloudFormation 中重复使用。