1

I plan to set Instance profile credentials to allow the elastic beanstak + docker to read dynamoDB in the same region.

I am trying to add as few environment variables as possible.

I am wondering if it is possible to let the sdk to set the region according to it's EC2's region? or I do need a extra variable in the app and set it at deployment time?

Thanks for the guidance.

void
  • 345
  • 3
  • 13

1 Answers1

0

You should be able to derive the Region from the EC2 Instance Metadata. You'll have to trim region from the Availability zone (like us-east-1a => us-east-1) and query the EC2 Instance Metadata API, but definitely doable: Instance Metadata Categories (look for placement/availability-zone)

Related:

Randy Wallace
  • 131
  • 1
  • 5
  • thank you for the guidance! We also have plan to move to eks and would like approach work without code change? – void Apr 28 '20 at 06:44