-
Notifications
You must be signed in to change notification settings - Fork 254
Deployed stack to ECS created in wrong region #1056
Comments
@robogeek I logged the following issue on Friday which looks like it is related to this one. I closed the issue after managing to figure out a work around, but now that I'm seeing this, I'm wondering if I should have left it open. In any event, check what worked for me and see if it helps you. |
I tested a few scenarios:
=> application is deployed in expected region us-west-2 [x] using an aws profile
=> application is deployed in expected region eu-north-1 Please note: if you created a docker context for an existing aws profile, I'm not sure how you ended with a context to have both "ecs": {
"Profile": "notes-app",
"Region": "us-west-2"
} Seems this context was created with an earlier release of the ECS integration. We don't store region in docker context anymore (as demonstrated by your second context) |
I had the same problem and got around it by creating a new docker ecs context with a different name (re-creating the context with the same name did not work). |
I was able to do some exploring today, but results are inconclusive. I tried to delete my ECS contexts and create two new ones, one created from a profile, the other created to use environment variables. With a simple Compose file
It deployed the cluster to my preferred region ( But with another, that's slightly more complex, it still ignores the preferred region and uses Inconclusive... And @gorrog I had seen your report but your solution didn't work for me. |
I hardly can imagine how the compose file complexity can impact setting up the AWS go SDK.... |
My above workaround actually does not work. I am running the |
Region should be set:
|
Thanks, that was the problem. I was setting the |
|
I was having the same problem, not sure why I got this config, but I ended up with this: ~/.aws/config:
~/.aws/credentials:
There was a mismatch in my case, I had to edit the config and change |
If it makes any difference I do not have a |
Here's the results from four rounds of The two contexts used are:
The Compose file used was the one I showed above for
The test was run on macOS using Docker for Mac. Then I reran the test on my Windows laptop. The Docker commands were run inside a WSL2 Ubuntu instance. But that instance is connected to the Docker for Windows installed on that machine. It gave the same behavior. |
@ndeloof I delivered the situation where this issue arose - namely, the difference between deploying with a context configured for from environment versus one configured with a specific AWS Profile. The details are in the previous comment. Using the context configured with a specific profile, it deployed to the wrong region. Using the from environment context it deployed to the expected region. I don't know if you saw this and am making it clearer what was reported. |
should help to diagnose #1084 #1056 Signed-off-by: Nicolas De Loof <[email protected]>
should help to diagnose #1084 #1056 Signed-off-by: Nicolas De Loof <[email protected]>
I had the same problem, and what @jordisala1991 mentioned above worked for me. Nevertheless I agree with @robogeek that the AWS Region should be a setting per Docker context, not per user. |
I think the problem is when you initially setup credentials it does it wrong. (see jordisala1991). You need to manually change your credentials for the default in the config. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html . For whatever reason it is using a different format for default and additional profiles. Remove the keyword "profile" before default. Seems to work then. |
I'm having the same problem. Posted the region issue over on StackOverflow here: https://stackoverflow.com/questions/68304238/change-aws-region-for-docker-cli-context-using-ecs I also posted about the issue in the Docker Slack channel for AWS called The ideal solution, in my opinion, would be to have a region specifier on the Docker context itself. Example
|
We’ll be looking into this next sprint. |
Hey folks - I've asked the team to push this back one sprint due to competing priorities, but we still have it on our radar. Thanks! |
@stephanierifai how long are those sprints in your team? Has the issue been picked up by now by any chance? :) |
Hi sorry yes, we did some investigating but no resolution quite yet. Will keep you updated. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
FYI - I ran into this issue myself with the same fix (remove |
This issue has been automatically marked as not stale anymore due to the recent activity. |
Any progress on this folks? |
I was able to fix it using
It seems the all "select a profile" thing ain't properly working |
Description
I have an ECS Context that references one of my profiles (not the
default
profile, because I do not use thedefault
profile). The Context explicitly lists the AWS region, as does the AWS Profile. Further I've set AWS_PROFILE and AWS_REGION. The deployed cluster is created inus-east-1
when I've specifiedus-west-2
.Steps to reproduce the issue:
docker context use ecs
docker compose up
(possibly with--project-name todo
)Describe the results you received:
The deployed stack ends up in the
us-east-1
region. The load balancer URL shown bydocker compose ps
containsus-east-1
and inspecting the infrastructure on the AWS Management Console website shows it is inus-east-1
.Describe the results you expected:
I expected it to respect the declaration of
us-west-2
Additional information you deem important (e.g. issue happens only occasionally):
This happens every time.
Output of
docker version
:I just updated to Docker Desktop for macOS 3.0.1. This behavior happened for several previous releases. I don't remember if it happened this way when I first used the ECS Context last summer.
Output of
docker context show
:I have two ECS contexts that are both referring to the same AWS Profile. I created the second just now to see if there would be any significant difference.
Output of
docker info
:Additional environment details (AWS ECS, Azure ACI, local, etc.):
The text was updated successfully, but these errors were encountered: