英文:
AWS Aurora RDS Parameter Group - Is it possible to export from one account and import to another?
问题
我希望有一种简单的方法可以将参数组从一个账户导出到另一个账户。在AWS控制台中似乎无法实现这一点。
我查看了AWS CLI的RDS命令文档,其中有一个DESCRIBE命令,我已经用它来创建一个文本或JSON输出文件。但我没有看到导入参数组的方法。
感谢任何帮助/建议。
英文:
I was hoping that there might be an easy way to export a parameter group from one account to another account. This doesn't seem possible via the aws console.
I checked the aws cli rds command documentation, and there is the DESCRIBE command, which i have used to create a text or json output file. But i am not seeing a way to import that pg.
Thanks for any help/suggestions.
答案1
得分: 2
在我的情况下,我需要对PostgreSQL数据库执行相同的过渡操作,这里我已经完成了以下步骤:
1. 从源数据库参数组中导出参数:
aws rds describe-db-parameters --db-parameter-group-name <My-Parameter-Group-Name> >> My-Parameters.json
2. 编辑My-Parameters.json,将第一个键Parameters更改为DBParameterGroupName。
编辑后的参数JSON示例部分:
{
"DBParameterGroupName": [
{
"ParameterName": "application_name",
"Description": "Sets the application name to be reported in statistics and logs.",
"Source": "engine-default",
"ApplyType": "dynamic",
"DataType": "string",
"IsModifiable": true,
"ApplyMethod": "pending-reboot"
},
......
3. 在目标位置创建新的参数组:
aws rds create-db-parameter-group \
--db-parameter-group-name "<My-New-Parameter-Group-Name>" \
--db-parameter-group-family "postgres13" \
--description "<My-Parameter-Group-Description>" \
--cli-input-json file://My-Parameters.json \
--region <Preferred-Region>
这些是您要求的翻译部分,没有其他内容。
英文:
In my case, I have to do the same transition for PostgreSQL database, and here I have done the following :
1. Export Parameters from the Source Database Parameter Group:
aws rds describe-db-parameters --db-parameter-group-name <My-Parameter-Group-Name> >> My-Parameters.json
2. Edited My-Parameters.json by changing the first key i.e. Parameters with DBParameterGroupName
Example portion of Parameters json after EDIT:
{
"DBParameterGroupName": [
{
"ParameterName": "application_name",
"Description": "Sets the application name to be reported in statistics and logs.",
"Source": "engine-default",
"ApplyType": "dynamic",
"DataType": "string",
"IsModifiable": true,
"ApplyMethod": "pending-reboot"
},
......
3.
Created the new parameter group in the destination:
aws rds create-db-parameter-group \
--db-parameter-group-name "<My-New-Parameter-Group-Name>" \
--db-parameter-group-family "postgres13" \
--description "<My-Parameter-Group-Description>" \
--cli-input-json file://My-Parameters.json \
--region <Preferred-Region>
答案2
得分: 1
抱歉,我应该在发布这个问题之前更深入地查看一下 AWS CLI 命令。抱歉!
发布后,我注意到创建命令可以接受一个 JSON 输入文件!
那将满足我的需求。
aws rds create-db-parameter-group \
--db-parameter-group-name <group-name> \
--db-parameter-group-family <group-family> \
--description <group-description> \
--cli-input-json file://<path-to-file>
英文:
Ah...I should have looked a little deeper at the aws cli commands, before posting this question. Sorry!
After posting, I just noticed that the create command accepts a json input file!
That will do what i need.
aws rds create-db-parameter-group \
--db-parameter-group-name <group-name> \
--db-parameter-group-family <group-family> \
--description <group-description> \
--cli-input-json file://<path-to-file>
答案3
得分: 0
Great that you found a solution, also, you could evaluate use AWS Cloudformation Templates to deploy your configurations for multiples accounts in more easy way. Below you can find more information for AWS RDS Parameters Groups using AWS Cloudformation.
Also here is a blog for best practices to deploy AWS Resources using AWS Cloudformation.
Best practices to deploy Amazon Aurora databases with AWS CloudFormation
Best Regards
英文:
Great that you found a solution, also, you could evaluate use AWS Cloudformation Templates to deploy your configurations for multiples accounts in more easy way. Below you can find more information for AWS RDS Parameters Groups using AWS Cloudformation.
Also here is a blog for best practices to deploy AWS Resources using AWS Cloudformation.
Best practices to deploy Amazon Aurora databases with AWS CloudFormation
Best Regards
答案4
得分: 0
我希望上面的答案可以起作用,但我从帐户1导出了参数,然后进行创建操作,结果出现了“参数验证失败:输入中的未知参数:“Parameters”,必须是以下之一:DBParameterGroupName、DBParameterGroupFamily、Description、Tags”,因为 JSON 中没有您在命令行中添加的内容。
看起来 AWS 提供了一个导出工具,然后无法重新导入,这似乎非常愚蠢。
英文:
I wish the answer above would work, but I exported the parameters from account 1, then did the create and it gave me Parameter validation failed:
because the JSON doesn't have the stuff you put at the command line.
Unknown parameter in input: "Parameters", must be one of: DBParameterGroupName, DBParameterGroupFamily, Description, Tags
Seems very dumb of AWS to provide an export tool that then won't re-import.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论