Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue ? #60

Open
yellow-sock opened this issue Aug 30, 2022 · 1 comment
Open

Issue ? #60

yellow-sock opened this issue Aug 30, 2022 · 1 comment

Comments

@yellow-sock
Copy link

ubuntu@DESKTOP-I7DBFAI:~$ aws ecs describe-tasks --profile=dma --region=eu-west-1 --cluster=mps-corporate-web --tasks=2fb8c764dcaf4b819f51d2c2b6fbcf70
{
    "tasks": [
        {
            "attachments": [
                {
                    "id": "af9341d2-fa6c-4af2-9964-1e40007caeed",
                    "type": "ElasticNetworkInterface",
                    "status": "ATTACHED",
                    "details": [
                        {
                            "name": "subnetId",
                            "value": "subnet-0a7ce6575e6d811ff"
                        },
... etc

so that command is working, but:

ubuntu@DESKTOP-I7DBFAI:~$ export AWS_PROFILE=dma
ubuntu@DESKTOP-I7DBFAI:~$ export AWS_REGION=eu-west-1
ubuntu@DESKTOP-I7DBFAI:~$ check-ecs-exec.sh mps-corporate-web 2fb8c764dcaf4b819f51d2c2b6fbcf70
-------------------------------------------------------------
Prerequisites for check-ecs-exec.sh v0.7
-------------------------------------------------------------
  jq      | OK (/usr/bin/jq)
  AWS CLI | OK (/usr/local/bin/aws)

-------------------------------------------------------------
Prerequisites for the AWS CLI to use ECS Exec
-------------------------------------------------------------

An error occurred (ClusterNotFoundException) when calling the DescribeTasks operation: Cluster not found.
ubuntu@DESKTOP-I7DBFAI:~$

Am I doing something wrong?

We use several aws accounts: the subaccount (in which the cluster is) is accessed with a role as can be seen in the aws config

ubuntu@DESKTOP-I7DBFAI:~/.aws$ cat config
[default]
[profile dma]
role_arn = arn:aws:iam::059416150415:role/DMAAccessRole
source_profile = default
ubuntu@DESKTOP-I7DBFAI:~/.aws$

check-ecs-exec.sh works if I test a cluster in our main aws account in the same region - basically ignoring export AWS_PROFILE=dma.

@yellow-sock yellow-sock changed the title Bug ? Issue ? Aug 30, 2022
@davidjeddy
Copy link

Ran into this same problem. The tool is reading the region from ~/.aws/config for the profile given (or default if non provided).

ENH: CLI argument --region to explicitly set the region targeted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants