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

Error applying the tf template in 02-Overview exercise #7

Open
carlos-salinas opened this issue Apr 22, 2022 · 3 comments
Open

Error applying the tf template in 02-Overview exercise #7

carlos-salinas opened this issue Apr 22, 2022 · 3 comments

Comments

@carlos-salinas
Copy link

It seems there are missing the definitions of VPC and Subnet resources in the template, because the executing fails as you can see the in the snippet below:

aws_instance.example: Creating...
Error: Error launching source instance: VPCIdNotSpecified: No default VPC for this user. GroupName is only supported for EC2-Classic and default VPC.     status code: 400, request id: ef9266e7-f56a-44fd-b0b3-65cf029252fc
 
with aws_instance.example,
on main.tf line 14, in resource "aws_instance" "example":
14: resource "aws_instance" "example" {

As workaround, I have added the required resources manually.

@sidpalas
Copy link
Owner

I think I created an EC2 instance via the web UI before setting up terraform, which created the default VPC/subnets.

Adding new VPC + subnets within the terraform configuration would be a great addition. Any interest in creating a pull request with that?

@Apurva14A
Copy link

Also there is need to provide the private key ,as it is required for instance creation.

tzujui added a commit to tzujui/devops-directive-terraform-course that referenced this issue Aug 21, 2024
Addressed VPCIdNotSpecified error mentioned in sidpalas#7
@tzujui
Copy link

tzujui commented Aug 23, 2024

I think I created an EC2 instance via the web UI before setting up terraform, which created the default VPC/subnets.

Adding new VPC + subnets within the terraform configuration would be a great addition. Any interest in creating a pull request with that?

Hi Sid,
I created a PR to fix this error!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants