Direkt zum Inhalt

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 ?

gefragt vor 3 Jahren1555 Aufrufe

2 Antworten
4
Akzeptierte Antwort

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
EXPERTE

beantwortet vor 3 Jahren

EXPERTE

überprüft vor 2 Jahren

  • 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

EXPERTE

beantwortet vor 3 Jahren

  • thanks ! not sure how to apply it to inside a greengrass component yet.. still looking

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.