1

I work for an independent software vendor. We have an application that creates AWS Lambda functions whenever a new variant of our application is deployed. For each instance of the application, the same functions are created, just with different configuration.

For example, one of our lambda functions does some processing and then inserts the results into an SQS queue. We already use IAM roles for credentials to the queue, but the name of the queue and region is based on the customer and where the AWS Lambda function is deployed.

The AWS Lambda functions are written in Java.

Where can we specify configuration for queue name? ... region?

NOTE: We hope that we will not need to specify the region. Our intent is to dynamically determine what region the function is running in and use that.

1
  • Have you considered parsing the region from the "Host" header of the API Gateway request? Commented Jul 1, 2016 at 3:16

1 Answer 1

1

You can specify your queue configuration as environment variables and then read them from your lambda function. You can find a more detailed explanation in here.

You can read the current region from the environment variables as per code below.

System.getenv("AWS_DEFAULT_REGION");

However, if there are any sensitive data you may want to consider Keywhiz or a similar system for distributing and managing secrets. Diogo Monica wrote last March 2017 an interesting article about Why you shouldn't use ENV variables for secret data which you may find useful.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.