Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_db_instance read replica created with wrong security group #8758

Closed
jdubeau123 opened this issue Sep 9, 2016 · 1 comment
Closed

aws_db_instance read replica created with wrong security group #8758

jdubeau123 opened this issue Sep 9, 2016 · 1 comment

Comments

@jdubeau123
Copy link

jdubeau123 commented Sep 9, 2016

It looks like terraform is creating a db instance from the configs below with the wrong security group. I'm passing in a specific security group id that is from a non-default security group I have created, but upon initial creation of the aws_db_instance it actually has the VPC default security group instead of the one I specified.

Terraform Version

Terraform v0.7.1

Affected Resource(s)

  • aws_db_instance

Terraform Configuration Files

variable "db_sg_id" {}

variable "name" {}

variable "vpc_id" {}

variable "db_readonly_subnet_ids" {
type = "list"
}

variable "db_readonly_instance_class" {}

variable "db_master_arn" {}

variable "db_readonly_num_instances" {}

resource "aws_db_instance" "db_readonly" {
count = "${var.db_readonly_num_instances}"
instance_class = "${var.db_readonly_instance_class}"
publicly_accessible = false
replicate_source_db = "${var.db_master_arn}"
vpc_security_group_ids = ["${var.db_sg_id}"]
backup_retention_period = 0
db_subnet_group_name = "${aws_db_subnet_group.slave_postgres.name}"
}

resource "aws_db_subnet_group" "slave_postgres" {
name = "postgres_slave_subnet_group"
description = "Subnets for read replica"
subnet_ids = ["${var.db_readonly_subnet_ids}"]

tags {
Name = "${var.name}_postgres_slave_subnet_group"
}
}

Expected Behavior

aws_db_instance should have been created with the specified (non-default) security group.

Actual Behavior

It was actually created with the VPC default security group

Steps to Reproduce

"terraform apply" after specifying variables

Important Factoids

This aws_db_instance is in a different region than the replicate_source_db. I also have a read-only slave that is in the same region as the replicate_source_db, and this one is created with the correct security group.

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants