Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Fargate Region Support #553

Closed
dejonghe opened this issue May 8, 2020 · 1 comment
Closed

Fargate Region Support #553

dejonghe opened this issue May 8, 2020 · 1 comment
Assignees
Labels
component: core An issue related to core functionality - credentials, region resolution status: in-progress An issue that being worked on theme: ecs

Comments

@dejonghe
Copy link

dejonghe commented May 8, 2020

Is your feature request related to a problem? Please describe.
When running in Fargate, EC2 Metadata is not available, which causes looking up the region to fail. Based on the implementation of getRegion() or getCurrentRegion() this is nothing this is not a bug of spring-cloud-aws. Note the "If not in EC2 return null" in the following doc.
https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/regions/Regions.html

In Fargate, EC2 Metadata is not available however, the environment variable AWS_REGION is, and is also set on most local testing environments.

Describe the solution you'd like
In the following function of spring-cloud-aws test if the returned value of getRegion() is null and if so check for the environment variable AWS_REGION and use that.

https://github.com/spring-cloud/spring-cloud-aws/blob/master/spring-cloud-aws-core/src/main/java/org/springframework/cloud/aws/core/region/RegionProvider.java

Describe alternatives you've considered
Currently the work around is to set the property of "static region" as follows;
cloud.aws.region.static=${AWS_REGION}

Additional context
I looked for others that might have raise this issue but did not find thing. Basically this caused a bit of a run around when trying to deploy to Fargate, and I think by implimenting this small change it would save many people quite a bit of hassle if / when they deploy to Fargate.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 8, 2020
@maciejwalkowiak maciejwalkowiak added theme: ecs component: core An issue related to core functionality - credentials, region resolution labels May 29, 2020
@giova333
Copy link
Contributor

@maciejwalkowiak this pr should fix the problem #559

maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue May 31, 2020
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue May 31, 2020
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue May 31, 2020
@maciejwalkowiak maciejwalkowiak added status: in-progress An issue that being worked on and removed status: waiting-for-triage An issue we've not yet triaged labels May 31, 2020
@maciejwalkowiak maciejwalkowiak self-assigned this May 31, 2020
maciejwalkowiak added a commit that referenced this issue May 31, 2020
tmnuwan12 pushed a commit to tmnuwan12/spring-cloud-aws that referenced this issue Jun 7, 2020
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: core An issue related to core functionality - credentials, region resolution status: in-progress An issue that being worked on theme: ecs
Development

No branches or pull requests

4 participants