bentoml / aws-ec2-deploy

Fast model deployment on AWS EC2
Apache License 2.0
14 stars 9 forks source link

Error or terraform comand: VPCIdNotSpecified: No default VPC for this used #31

Open migueldft opened 2 years ago

migueldft commented 2 years ago

I am getting an error when trying to run terraform apply -var-file=bentoctl.tfvars -auto-approve

error creating Security Group (test-bentoml-ec2-bentoml-sg): VPCIdNotSpecified: No default VPC for this user │ status code: 400, request id: 7bacdb7e-b1a5-408f-8cc2-dfbaa66de321 │ │ with aws_security_group.allow_bentoml, │ on main.tf line 96, in resource "aws_security_group" "allow_bentoml": │ 96: resource "aws_security_group" "allow_bentoml" {

How can I eddit to add an default VPC ID ? not sure if this is the problem though

jjmachan commented 2 years ago

It should use the default VPC by default so I think that the default VPC is not available locally in your system. Can you try the instructions here https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html#create-default-vpc to create a new VPC?.

You can also create a VPC and attach it to the security group. Look into the main.tf file that is generated. check out https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group#vpc_id