Data engineering c2w3lab1 issue with subnets

When creating a post, please add:

  • Module # must be added in the tags option of the post. (ex: Module-1)
  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook)

I seem to be having issues with the VPC and subnets that are meant to be part of the terraform data. The link of classroom assignment is here.

The exact error I am getting is pasted below. Any help is appreciated.

Error: no matching EC2 VPC found

│ with module.bastion_host.data.aws_vpc.main,
│ on modules/bastion_host/network.tf line 1, in data “aws_vpc” “main”:
│ 1: data “aws_vpc” “main” {

Hi,

Terraform is attempting to look up an existing VPC using the ID provided in var.vpc_id (referenced in network.tf), but it seems unable to find a match.

Please double-check where vpc_id is defined and ensure that the value is correct and corresponds to an existing VPC.