Giter Site home page Giter Site logo

Error: Error creating DB Subnet Group: DBSubnetGroupAlreadyExists: The DB subnet group 'my-cool-project-vpc' already exists. about manning-code HOT 5 CLOSED

terraform-in-action avatar terraform-in-action commented on July 25, 2024
Error: Error creating DB Subnet Group: DBSubnetGroupAlreadyExists: The DB subnet group 'my-cool-project-vpc' already exists.

from manning-code.

Comments (5)

scottwinkler avatar scottwinkler commented on July 25, 2024

I suspect this is a user error. There is no reason for the DB subnet group with that name to exist unless it was deployed either by yourself or another person in your AWS account. Are you sure the code is exactly the same as what I have here?

from manning-code.

maina360 avatar maina360 commented on July 25, 2024

from manning-code.

maina360 avatar maina360 commented on July 25, 2024

So I found out what the issue was. When I first ran the code, I got this error that need me to add sensitive = true to the output in the root module outputs.tf

++++++++++++
From
++++++++

output "db_password" {
value = module.database.db_config.password
}

+++++++++++
To
+++++++
output "db_password" {
sensitive = true
value = module.database.db_config.password
}

After seeing that error I ran, destroy command but the RDS subnet group never got destroyed, not sure why and that was causing the issue I opened. Anyway, after figuring that out there was another error with the resource "random_password" "password"
++++++++++++++++++++++
code with issue
++++++++++++++++
resource "random_password" "password" { #A
length = 16
special = true
override_special = "_%@/'""
}

for this one I had to remove the extra \ on there to fix the issue then I ran a destroy again and apply and this time everything worked well.
+++++++++++++++++++
Changes made
++++++++++++++++++
resource "random_password" "password" { #A
length = 16
special = true
override_special = "_%@"
}

So you might want to modify the two resources I mentioned for future users. Thank you!

from manning-code.

scottwinkler avatar scottwinkler commented on July 25, 2024

Hmm not sure what is going on in the second part but adding sensitive to the output is definitely something I can fix In the errata. Thanks

from manning-code.

maina360 avatar maina360 commented on July 25, 2024

No problem, thank you for writing this awesome book. I hope I can pick up quick and get better at Terraform.

from manning-code.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.