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

503 temporary service unavailabale #250

Closed
ranjeetrj opened this issue Nov 20, 2023 · 4 comments
Closed

503 temporary service unavailabale #250

ranjeetrj opened this issue Nov 20, 2023 · 4 comments

Comments

@ranjeetrj
Copy link

Describe the Bug

I created elastic beanstalk env with the shared load balancer using this repo code and when I hit the DNS URL of beanstalk env or route 53 url I got a 503 error on the browser.

But if I add "associate_public_ip_address = true" this parameter is in main.tf block, it's working perfectly.

May I know if am i missing something or if it is default behavior?

The actual problem is instance is not reachable as I haven't assigned a public IP to this.
SO I just wanted to know. do I need to assign a public IP to an instance in shared load balancer env?
If I didn't assign then the health check would fail.

Expected Behavior

The shared load balancer should work except for this parameter ""associate_public_ip_address = true""

Steps to Reproduce

Create your own vpc
Go inside the shared-alb folder, and in main.tf change vpc_id, subnet_id,security_group_id
execute the below commands,
terraform init
terraform plan
terraform apply

Screenshots

module.elastic_beanstalk_environment.aws_elastic_beanstalk_environment.default[0]: Still creating... [17m51s elapsed]

│ Error: creating Elastic Beanstalk Environment (e-j4zkjtqr7y): 2 errors occurred:
│ * 2023-11-20 08:14:29.361 +0000 UTC Stack named 'awseb-e-j4zkjtqr7y-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBInstanceLaunchWaitCondition].
│ * 2023-11-20 08:14:29.465 +0000 UTC The EC2 instances failed to communicate with AWS Elastic Beanstalk, either because of configuration problems with the VPC or a failed EC2 instance. Check your VPC configuration and try launching the environment again.



│ with module.elastic_beanstalk_environment.aws_elastic_beanstalk_environment.default[0],
│ on ....\main.tf line 602, in resource "aws_elastic_beanstalk_environment" "default":
│ 602: resource "aws_elastic_beanstalk_environment" "default" {

Environment

No response

Additional Context

No response

@ranjeetrj ranjeetrj added the bug 🐛 An issue with the system label Nov 20, 2023
@joe-niland
Copy link
Member

I'm guessing the issue is with your VPC. Can you share the full Terraform code, including the vpc config?

@ranjeetrj
Copy link
Author

Sure here it is,
For creating vpc I have used my own model. I have deployed Beanstalk env in a public subnet.

terra-vpc-demo.zip
shared-alb.zip

@joe-niland
Copy link
Member

From looking at your files, and the error message above, it seems that the issue is that your VPC doesn't have a NAT gateway or VPC endpoint. This means your instances can't communicate with the Elastic Beanstalk service to signal that they're healthy.

I will close now as it's not a bug with the module.

I suggest you check the examples directory again and implement your module based on them. For example, using the dynamic-subnets module will save you a lot of time.

@joe-niland joe-niland removed the bug 🐛 An issue with the system label Nov 21, 2023
@ranjeetrj
Copy link
Author

ranjeetrj commented Nov 28, 2023 via email

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