You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
}
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.
The text was updated successfully, but these errors were encountered:
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
locked and limited conversation to collaborators
Apr 10, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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)
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.
The text was updated successfully, but these errors were encountered: