내용으로 건너뛰기

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 ?

질문됨 3년 전1.6천회 조회

2개 답변
4
수락된 답변

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
전문가

답변함 3년 전

전문가

검토됨 2년 전

  • 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

전문가

답변함 3년 전

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

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠