Unable to create rds global database in aws using Terraform












1















I am trying to create an rds global database in aws using Terraform. The primary cluster gets created but the secondary cluster fails with the following error-



* aws_rds_cluster.secondary: error creating RDS cluster: 
InvalidParameterCombination: Cannot specify user name for cross
region replication cluster
status code: 400, request id: 10b82a78-898c-49e6-b28f-
0a318fdc226f


I tried by removing master_username but I got the below error-



* aws_rds_cluster.secondary: provider.aws: aws_rds_cluster: : 
"master_username": required field is not set


My Terraform Module to create rds global database in aws-



resource "aws_rds_global_cluster" "rdsglobal" {
provider = "aws.primary"

global_cluster_identifier = "${var.global_database_id}"
storage_encrypted = "${var.storage_encrypted}"
}

resource "aws_rds_cluster_instance" "primary" {
provider = "aws.primary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.primary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "primary" {
provider = "aws.primary"
cluster_identifier = "${var.primary_cluster_id}"
database_name = "${var.db_name}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
storage_encrypted = "${var.storage_encrypted}"
backup_retention_period = "${var.backup_retention_period}"
skip_final_snapshot = "${var.skip_final_snapshot}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


resource "aws_rds_cluster_instance" "secondary" {
provider = "aws.secondary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.secondary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "secondary" {
depends_on = ["aws_rds_cluster_instance.primary"]
provider = "aws.secondary"
cluster_identifier = "${var.secondary_cluster_id}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.secondary_security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


Reference: https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html










share|improve this question























  • I was able to create the rds global database using aws cli but not able to do the same using Terraform. Any help will be greatly appreciated.

    – jroy
    Dec 31 '18 at 12:50













  • I don't have an answer, but that error message is given when you try to create a cross region read replica and you specify master username/password. This is the tech that's behind global rds clusters. The documentation for adding a seconday cluster (docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/…) does not show specifying the root user/pass. It might be a change in the API. I would suggest creating an issue with the AWS Terraform provider.

    – Eric M. Johnson
    Dec 31 '18 at 19:51











  • Thanks @EricM.Johnson

    – jroy
    Jan 1 at 23:00
















1















I am trying to create an rds global database in aws using Terraform. The primary cluster gets created but the secondary cluster fails with the following error-



* aws_rds_cluster.secondary: error creating RDS cluster: 
InvalidParameterCombination: Cannot specify user name for cross
region replication cluster
status code: 400, request id: 10b82a78-898c-49e6-b28f-
0a318fdc226f


I tried by removing master_username but I got the below error-



* aws_rds_cluster.secondary: provider.aws: aws_rds_cluster: : 
"master_username": required field is not set


My Terraform Module to create rds global database in aws-



resource "aws_rds_global_cluster" "rdsglobal" {
provider = "aws.primary"

global_cluster_identifier = "${var.global_database_id}"
storage_encrypted = "${var.storage_encrypted}"
}

resource "aws_rds_cluster_instance" "primary" {
provider = "aws.primary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.primary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "primary" {
provider = "aws.primary"
cluster_identifier = "${var.primary_cluster_id}"
database_name = "${var.db_name}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
storage_encrypted = "${var.storage_encrypted}"
backup_retention_period = "${var.backup_retention_period}"
skip_final_snapshot = "${var.skip_final_snapshot}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


resource "aws_rds_cluster_instance" "secondary" {
provider = "aws.secondary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.secondary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "secondary" {
depends_on = ["aws_rds_cluster_instance.primary"]
provider = "aws.secondary"
cluster_identifier = "${var.secondary_cluster_id}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.secondary_security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


Reference: https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html










share|improve this question























  • I was able to create the rds global database using aws cli but not able to do the same using Terraform. Any help will be greatly appreciated.

    – jroy
    Dec 31 '18 at 12:50













  • I don't have an answer, but that error message is given when you try to create a cross region read replica and you specify master username/password. This is the tech that's behind global rds clusters. The documentation for adding a seconday cluster (docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/…) does not show specifying the root user/pass. It might be a change in the API. I would suggest creating an issue with the AWS Terraform provider.

    – Eric M. Johnson
    Dec 31 '18 at 19:51











  • Thanks @EricM.Johnson

    – jroy
    Jan 1 at 23:00














1












1








1








I am trying to create an rds global database in aws using Terraform. The primary cluster gets created but the secondary cluster fails with the following error-



* aws_rds_cluster.secondary: error creating RDS cluster: 
InvalidParameterCombination: Cannot specify user name for cross
region replication cluster
status code: 400, request id: 10b82a78-898c-49e6-b28f-
0a318fdc226f


I tried by removing master_username but I got the below error-



* aws_rds_cluster.secondary: provider.aws: aws_rds_cluster: : 
"master_username": required field is not set


My Terraform Module to create rds global database in aws-



resource "aws_rds_global_cluster" "rdsglobal" {
provider = "aws.primary"

global_cluster_identifier = "${var.global_database_id}"
storage_encrypted = "${var.storage_encrypted}"
}

resource "aws_rds_cluster_instance" "primary" {
provider = "aws.primary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.primary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "primary" {
provider = "aws.primary"
cluster_identifier = "${var.primary_cluster_id}"
database_name = "${var.db_name}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
storage_encrypted = "${var.storage_encrypted}"
backup_retention_period = "${var.backup_retention_period}"
skip_final_snapshot = "${var.skip_final_snapshot}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


resource "aws_rds_cluster_instance" "secondary" {
provider = "aws.secondary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.secondary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "secondary" {
depends_on = ["aws_rds_cluster_instance.primary"]
provider = "aws.secondary"
cluster_identifier = "${var.secondary_cluster_id}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.secondary_security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


Reference: https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html










share|improve this question














I am trying to create an rds global database in aws using Terraform. The primary cluster gets created but the secondary cluster fails with the following error-



* aws_rds_cluster.secondary: error creating RDS cluster: 
InvalidParameterCombination: Cannot specify user name for cross
region replication cluster
status code: 400, request id: 10b82a78-898c-49e6-b28f-
0a318fdc226f


I tried by removing master_username but I got the below error-



* aws_rds_cluster.secondary: provider.aws: aws_rds_cluster: : 
"master_username": required field is not set


My Terraform Module to create rds global database in aws-



resource "aws_rds_global_cluster" "rdsglobal" {
provider = "aws.primary"

global_cluster_identifier = "${var.global_database_id}"
storage_encrypted = "${var.storage_encrypted}"
}

resource "aws_rds_cluster_instance" "primary" {
provider = "aws.primary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.primary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "primary" {
provider = "aws.primary"
cluster_identifier = "${var.primary_cluster_id}"
database_name = "${var.db_name}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
storage_encrypted = "${var.storage_encrypted}"
backup_retention_period = "${var.backup_retention_period}"
skip_final_snapshot = "${var.skip_final_snapshot}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


resource "aws_rds_cluster_instance" "secondary" {
provider = "aws.secondary"
count = "${var.instance_count}"
identifier = "${var.db_name}-${count.index+1}"
cluster_identifier = "${aws_rds_cluster.secondary.id}"
instance_class = "${var.instance_class}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
publicly_accessible = "${var.publicly_accessible}"

}

resource "aws_rds_cluster" "secondary" {
depends_on = ["aws_rds_cluster_instance.primary"]
provider = "aws.secondary"
cluster_identifier = "${var.secondary_cluster_id}"
port = "${var.port}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
master_username = "${var.master_username}"
master_password = "${random_string.password.result}"
vpc_security_group_ids = ["${var.secondary_security_group_ids}"]
db_subnet_group_name = "${var.db_subnet_group_name}"
engine_mode = "${var.engine_mode}"
global_cluster_identifier = "${aws_rds_global_cluster.rdsglobal.id}"

}


Reference: https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html







terraform






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 31 '18 at 12:48









jroyjroy

61




61













  • I was able to create the rds global database using aws cli but not able to do the same using Terraform. Any help will be greatly appreciated.

    – jroy
    Dec 31 '18 at 12:50













  • I don't have an answer, but that error message is given when you try to create a cross region read replica and you specify master username/password. This is the tech that's behind global rds clusters. The documentation for adding a seconday cluster (docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/…) does not show specifying the root user/pass. It might be a change in the API. I would suggest creating an issue with the AWS Terraform provider.

    – Eric M. Johnson
    Dec 31 '18 at 19:51











  • Thanks @EricM.Johnson

    – jroy
    Jan 1 at 23:00



















  • I was able to create the rds global database using aws cli but not able to do the same using Terraform. Any help will be greatly appreciated.

    – jroy
    Dec 31 '18 at 12:50













  • I don't have an answer, but that error message is given when you try to create a cross region read replica and you specify master username/password. This is the tech that's behind global rds clusters. The documentation for adding a seconday cluster (docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/…) does not show specifying the root user/pass. It might be a change in the API. I would suggest creating an issue with the AWS Terraform provider.

    – Eric M. Johnson
    Dec 31 '18 at 19:51











  • Thanks @EricM.Johnson

    – jroy
    Jan 1 at 23:00

















I was able to create the rds global database using aws cli but not able to do the same using Terraform. Any help will be greatly appreciated.

– jroy
Dec 31 '18 at 12:50







I was able to create the rds global database using aws cli but not able to do the same using Terraform. Any help will be greatly appreciated.

– jroy
Dec 31 '18 at 12:50















I don't have an answer, but that error message is given when you try to create a cross region read replica and you specify master username/password. This is the tech that's behind global rds clusters. The documentation for adding a seconday cluster (docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/…) does not show specifying the root user/pass. It might be a change in the API. I would suggest creating an issue with the AWS Terraform provider.

– Eric M. Johnson
Dec 31 '18 at 19:51





I don't have an answer, but that error message is given when you try to create a cross region read replica and you specify master username/password. This is the tech that's behind global rds clusters. The documentation for adding a seconday cluster (docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/…) does not show specifying the root user/pass. It might be a change in the API. I would suggest creating an issue with the AWS Terraform provider.

– Eric M. Johnson
Dec 31 '18 at 19:51













Thanks @EricM.Johnson

– jroy
Jan 1 at 23:00





Thanks @EricM.Johnson

– jroy
Jan 1 at 23:00












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53987708%2funable-to-create-rds-global-database-in-aws-using-terraform%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53987708%2funable-to-create-rds-global-database-in-aws-using-terraform%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas