ECS example credential requirements? #692
-
I'm trying to understand why I'm seeing issues trying to use the I'm running in an EC2 instance with an InstanceRole. If I use the $ aws sts get-caller-identity
{
"UserId": "AROA4RJ566GXXXXXXHAXJ:i-9999999999",
"Account": "99999999999",
"Arn": "arn:aws:sts::99999999999:assumed-role/InstanceAdmin/i-02f48f9c69b226118"
} If I use the $ aws ecs list-clusters
{
"clusterArns": [
"arn:aws:ecs:us-east-2:99999999999:cluster/bottlerocket"
]
} But if I try to run the $ cargo run --bin describe-clusters
Finished dev [unoptimized + debuginfo] target(s) in 0.50s
Running `/home/stmcg/src/scratch/aws-sdk-rust/target/debug/describe-clusters`
Found 0 clusters: I tried adding a print statement to double check I'm using the correct region: println!("Region: {:?}", shared_config.region()); And that did print out what I expected: Region: Some(Region("us-east-2")) I also tried setting credential environment variables to see if it was something with using an instance role, but no luck with that either: $ export AWS_ACCESS_KEY_ID=...
$ export AWS_SECRET_ACCESS_KEY=...
$ export AWS_SESSION_TOKEN=....
$ cargo run --bin describe-clusters
Finished dev [unoptimized + debuginfo] target(s) in 0.50s
Running `/home/stmcg/src/scratch/aws-sdk-rust/target/debug/describe-clusters`
Found 0 clusters: Since the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It looks like the CLI command you're using is a different operation: |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
It looks like the CLI command you're using is a different operation:
ListClusters
vs.DescribeClusters
, which explains the different results. That said, I think the example is broken since the comment in it says that it lists the clusters rather than describing a given set of them. Filed awsdocs/aws-doc-sdk-examples#4106 to fix the example.