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
posta un anno fa745 visualizzazioni
2 Risposte
3
Risposta accettata

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
ESPERTO
con risposta un anno fa
  • 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
ESPERTO
con risposta un anno fa
  • thanks ! not sure how to apply it to inside a greengrass component yet.. still looking

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande