brikis98 / terraform-up-and-running-code

Code samples for the book "Terraform: Up & Running" by Yevgeniy Brikman
http://www.terraformupandrunning.com/
MIT License
2.9k stars 1.92k forks source link

Support for 0.14 and was >3 #67

Closed christo-ph closed 3 years ago

christo-ph commented 3 years ago

Hi,

I am looking for working examples of the current versions of terraform and AWS Provider. When trying to apply the code I am getting (Deploying a Load Balancer from chapter 2) errors:


Error: Error creating Auto Scaling Group: ValidationError: The subnet ID 'vpc-XXXXX' does not exist
        status code: 400, request id: 87fa912f-1465-4066-83a8-41cd7d7397ba

  on main.tf line 32, in resource "aws_autoscaling_group" "example":
  32: resource "aws_autoscaling_group" "example" {
christo-ph commented 3 years ago

The error was due to an wrong variable (that was mean):

resource "aws_autoscaling_group" "example" {
  launch_configuration = aws_launch_configuration.example.name
  vpc_zone_identifier  = data.aws_subnet_ids.default.ids

I had wrongly used (missing s): vpc_zone_identifier = data.aws_subnet_ids.default.id

brikis98 commented 3 years ago

Ah, yup, that'll do it. Thx for including the resolution!