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
preguntada hace un año745 visualizaciones
2 Respuestas
3
Respuesta aceptada

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
EXPERTO
respondido hace un año
  • 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
EXPERTO
respondido hace un año
  • thanks ! not sure how to apply it to inside a greengrass component yet.. still looking

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas