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

terraform import aws_rds_cluster_instance fails with unexpected EOF error #3959

Closed
kronos opened this issue Mar 28, 2018 · 3 comments
Closed
Labels
service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@kronos
Copy link

kronos commented Mar 28, 2018

Terraform Version

Terraform v0.11.5
+ provider.aws v1.12.0

Affected Resource(s)

  • aws_rds_cluster_instance

Debug Output

https://gist.github.com/kronos/228520eca6f64469753b41b14779e79c

Expected Behavior

Imported aws_rds_cluster_instance

Actual Behavior

module.rds.aws_rds_cluster_instance.cluster_instances: Importing from ID "postgres-development"...
module.rds.aws_rds_cluster_instance.cluster_instances: Import complete!
  Imported aws_rds_cluster_instance (ID: postgres-development)
module.rds.aws_rds_cluster_instance.cluster_instances: Refreshing state... (ID: postgres-development)

Error: module.rds.aws_rds_cluster_instance.cluster_instances (import id: postgres-development): 1 error(s) occurred:

* import module.rds.aws_rds_cluster_instance.cluster_instances result: postgres-development: aws_rds_cluster_instance.cluster_instances: unexpected EOF

Steps to Reproduce

  1. Try to create a rds cluster with one instance with terraform (it will create aws_rds_cluster but fail to create instance with error below)
 InvalidParameterCombination: RDS does not support creating a DB instance with the following combination: DBInstanceClass=db.t2.micro, Engine=aurora-postgresql, EngineVersion=9.6.6, LicenseModel=postgresql-license. For supported combinations of instance class and database engine version, see the documentation.
  1. Create it manually in amazon web interface

  2. Try to import it with command

terraform import module.rds.aws_rds_cluster_instance.cluster_instances postgres-development
  1. Just in case, a piece of my config:
resource "aws_rds_cluster" "postgres" {
  cluster_identifier     = "postgres-${var.env}"
  engine                 = "aurora-postgresql"
  database_name          = "equipage"
  port                   = "${var.port}"
  master_username        = "${var.username}"
  master_password        = "${var.password}"
  vpc_security_group_ids = ["${aws_security_group.postgres-sg.id}"]
  db_subnet_group_name   = "${aws_db_subnet_group.postgres-subnet.name}"
  skip_final_snapshot    = true

  lifecycle {
    ignore_changes = ["master_password"]
  }
}

resource "aws_rds_cluster_instance" "cluster_instances" {
  count                = "${var.instance_count}"
  identifier           = "postgres-instance-${var.env}"
  cluster_identifier   = "${aws_rds_cluster.postgres.id}"
  instance_class       = "${var.instance_class}"
  engine               = "aurora-postgresql"
  db_subnet_group_name = "${aws_db_subnet_group.postgres-subnet.name}"
}
@bflad
Copy link
Contributor

bflad commented Mar 28, 2018

Hi @kronos 👋 are you positive the new database instance you created was a member of the Aurora cluster? The debug output shows the cluster as having no members:

2018-03-28T21:54:57.069+0300 [DEBUG] plugin.terraform-provider-aws_v1.12.0_x4:         <DBClusterMembers/>

Non-Aurora database instances need to be managed by the aws_db_instance resource.

@bflad bflad added the service/rds Issues and PRs that pertain to the rds service. label Mar 28, 2018
@kronos
Copy link
Author

kronos commented Mar 28, 2018

Hello, Brian. No, I'm negative, thank you, I understand my mistake.

@ghost
Copy link

ghost commented Apr 6, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

No branches or pull requests

2 participants