You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments. They generate extra noise for issue followers and do not help prioritize the request.
Tell us about your request
It would be great if there were a simple way to reference the AWSEBWorkerQueue resource for a Worker environment created in a CloudFormation template.
For example, something like !GetAtt MyWorkerEnvironment.AWSEBWorkerQueue would be nice.
The docs for AWS::ElasticBeanstalk::Environment only mention EndpoinURL as a return value, so I was silently hoping that !GetAtt MyWorkerEnvironment.EndpointURL would return the SQS queue url. However, unfortunately, stack creation just fails altogether with an error:
Attribute 'EndpointURL' does not exist
Similarly, being able to access the AWSEBV2LoadBalancer for a WebServer environment would be of great help in setting up HTTPS configuration.
Is this request specific to an Elastic Beanstalk platform?
no
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
In a single CloudFormation template that creates both a WebServer and a Worker environment, I am trying to get the worker's SQS queue url (or name), and assign it to an environment property for the webserver.
Ideally, I would like to be able to use something like Fn::GetAtt to get the SQS url from the worker resource, for example:
Resources:
MyWorkerEnvironment:
Type: AWS::ElasticBeanstalk::Environment# ...MyWebServerEnvironment:
Type: AWS::ElasticBeanstalk::EnvironmentDependsOn: MyWorkerEnvironment# ...Properties:
# ...OptionSettings:
- Namespace: aws:elasticbeanstalk:application:environmentOptionName: WORKER_QUEUEValue: !GetAtt MyWorkerEnvironment.AWSEBWorkerQueue # <-- this would be great, but does not work
This seems like a very basic issue that everyone using webservers and workers with cloudformation will run into at some point.
Are you currently working around this issue?
I've found, and tested, several alternatives:
the manual approach: create the stack, copy the SQS queue url, and paste it into an environment property (or hardcode it)
These all work, but all suffer from various drawbacks.
I also noticed that the stack created by AWS::ElasticBeanstalk::Environment for the worker environment already has an output called AWSEBWorkerQueueURL. However, I could not figure out how to get that into my template.
Additional context
n/a
Attachments
n/a
The text was updated successfully, but these errors were encountered:
Actually, it would be great if other resources could also be accessed from the template that defines the AWS::ElasticBeanstalk::Environment. For example, AWSEBV2LoadBalancer would be very convenient.
dennisvang
changed the title
Enable reference to AWSEBWorkerQueue in a CloudFormation template
Enable reference to AWSEBWorkerQueue and AWSEBV2LoadBalancer in a CloudFormation template
Jul 15, 2024
As a workaround, it is relatively easy to create a custom worker queue and dead-letter queue, with configurations matching those of the default worker queue/dlq, and then specifying the WorkerQueueURL in the worker environment configuration.
Community Note
Tell us about your request
It would be great if there were a simple way to reference the
AWSEBWorkerQueue
resource for aWorker
environment created in a CloudFormation template.For example, something like
!GetAtt MyWorkerEnvironment.AWSEBWorkerQueue
would be nice.The docs for AWS::ElasticBeanstalk::Environment only mention
EndpoinURL
as a return value, so I was silently hoping that!GetAtt MyWorkerEnvironment.EndpointURL
would return the SQS queue url. However, unfortunately, stack creation just fails altogether with an error:Similarly, being able to access the
AWSEBV2LoadBalancer
for aWebServer
environment would be of great help in setting up HTTPS configuration.Is this request specific to an Elastic Beanstalk platform?
no
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
In a single CloudFormation template that creates both a
WebServer
and aWorker
environment, I am trying to get the worker's SQS queue url (or name), and assign it to an environment property for the webserver.Ideally, I would like to be able to use something like
Fn::GetAtt
to get the SQS url from the worker resource, for example:This seems like a very basic issue that everyone using webservers and workers with cloudformation will run into at some point.
Are you currently working around this issue?
I've found, and tested, several alternatives:
the manual approach: create the stack, copy the SQS queue url, and paste it into an environment property (or hardcode it)
use an environment manifest file, i.e.
env.yaml
, to link the environments, as in the example:use
ElasticBeanstalk.Client.describe_environment_resources()
fromboto3
in the app (or use the aws cli equivalent), for example (simplified):use
.ebextensions
to export the value ofAWSEBWorkerQueue
to CloudFormation, then useFn::ImportValue
in the CloudFormation template, as in:.ebextensions/resources.config
and in
my-cloudformation-template.yml
These all work, but all suffer from various drawbacks.
I also noticed that the stack created by
AWS::ElasticBeanstalk::Environment
for the worker environment already has an output calledAWSEBWorkerQueueURL
. However, I could not figure out how to get that into my template.Additional context
n/a
Attachments
n/a
The text was updated successfully, but these errors were encountered: