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

main example bugs - InvalidAMIID.NotFound and subnets in the same Availability Zone #27

Open
inspiraller opened this issue Sep 15, 2024 · 2 comments

Comments

@inspiraller
Copy link

Great demo.
I notice when going over the first example - there are some bugs to tidy up.

using file: https://github.com/sidpalas/devops-directive-terraform-course/blob/main/03-basics/web-app/main.tf

terraform apply

Error launching source instance: InvalidAMIID.NotFound: The image id '[ami-011899242bb902164]' does not exist
│ status code: 400, request id: 49825571-43a7-4e3c-9bdf-a5791485af2e

│ with aws_instance.instance_2,
│ on main.tf line 25, in resource "aws_instance" "instance_2":
│ 25: resource "aws_instance" "instance_2" {

error creating application Load Balancer: InvalidConfigurationRequest: A load balancer cannot be attached to multiple subnets in the same Availability Zone
│ status code: 400, request id: cc1296fe-9fc3-4759-94cd-e911975f3c69

│ with aws_lb.load_balancer,
│ on main.tf line 150, in resource "aws_lb" "load_balancer":
│ 150: resource "aws_lb" "load_balancer" {

@ujwalchangappa
Copy link

Please provide a valid AMI ID while creating instance. Click on launch instance and below you will find AMI id, use that ami id in your main.tf

@inspiraller
Copy link
Author

@ujwalchangappa Hi thanks for reply.
Yes I changed the AMI id which clears that error, but I still get the other error:
error creating application Load Balancer: InvalidConfigurationRequest: A load balancer cannot be attached to multiple subnets in the same Availability Zone
│ status code: 400, request id: cc1296fe-9fc3-4759-94cd-e911975f3c69

│ with aws_lb.load_balancer,
│ on main.tf line 150, in resource "aws_lb" "load_balancer":
│ 150: resource "aws_lb" "load_balancer" {

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

2 participants