How to retrieve current region inside a docker started up by a greengrass component

0

This seems trivial, but i'm having problems finding how i can retrieve the region that my greengrass component started docker is running in.

I know i can pass in environment variables into the docker container at startup, but even when i am at a terminal on the greengrass device, there isn't something like AWS_REGION defined in the environment, so it is not possible to pass that on.

I have the aws-cli installed, but it doesn't seem to be configured so

aws configure get region

returns nothing. Surely a running greengrass device must know what region it is running in ? How can i retrieve this ?

clogwog
asked a year ago706 views
2 Answers
3
Accepted Answer

AWS_REGION environment variable is available to you, but you need to tell docker to pass it through. Add -e AWS_REGION to the docker command to pass through that environment variable.

Cheers,

Michael

AWS
EXPERT
answered a year ago
  • thank you !! that works

0

I have never used greengrass but a couple of ideas:-

Using this method in ECS, you are able ot obtain the AZ at least https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-metadata.html

profile picture
EXPERT
answered a year ago
  • thanks ! not sure how to apply it to inside a greengrass component yet.. still looking

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions