steampipe-plugin-aws: Error in role assumtion when using alternative `credential_source` in aws config.

Describe the bug With setting up the aws config file to use alternative credential source, specificly in my test ecs.

[user@host ~]$ cat .aws/config 
[default]
output = json

[profile myaccount]
role_arn = arn:aws:iam::000000000001:role/MyRoleName
credential_source = EcsContainer

The aws cli works fine, and able to use the role configured

[user@host ~]$ aws sts get-caller-identity --profile myaccount
{
    "UserId": "AKIA2UC3BSXMEKZTLGM3:botocore-session-blablabla",
    "Account": "000000000001",
    "Arn": "arn:aws:sts::000000000001:assumed-role/MyRoleName/botocore-session-blablabla"
}

but when setting up in steampipe

[user@host ~]$ cat .steampipe/config/aws.spc 
connection "myaccount" {
  plugin = "aws"
  regions = ["*"]
  profile = "myaccount"
}

It fails on missing AWS_CONTAINER_CREDENTIALS_RELATIVE_URI

[user@host ~]$ steampipe query 
Welcome to Steampipe v0.24.2
For more information, type .help
> select * from myaccount.aws_account

Error: myaccount: EcsContainer was specified as the credential_source, but 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set (SQLSTATE HV000)

> .quit

While I tried to guess the right value and setting it as an ENV variable, I could not make it work.

Steampipe version (steampipe -v) v0.24.2

Plugin version (steampipe plugin list) 0.147.0

To reproduce See main description above. I used CloudShell but any ECS cluster should do.

Expected behavior Same as the cli just assume the role and collect data cross account.

Additional context I try to use aggregator in cloudshell for AWS Orgs.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Hey @ParthaI I am happy to confirm that it works with 1.14.0-rc.1 the diff to my script above looks like this.

7c7
<   steampipe plugin install aws
---
>   steampipe plugin install aws@v1.14.0-rc.1
22c22
<   plugin = "aws"
---
>   plugin = "aws@v1.14.0-rc.1"
41c41
<   plugin = "aws"
---
>   plugin = "aws@v1.14.0-rc.1"

I will keep it as is for now, and with the release of the 1.14 it will become usable in Cloudshell.

Hey @kisst , AWS plugin v1.14.1 is now available which has the fix from the RC version. If you’re still seeing any issues after upgrading your plugin version, please let us know!

Hi @kisst, I tested this in CloudShell and was able to successfully reproduce the same error.

Here are my findings:

  • Our current plugin uses AWS SDK for Go v2 version v1.27.0, and we rely on config.WithSharedConfigProfile(profile) to delegate profile-based authentication to the SDK. We do not implement any custom authentication handling ourselves.
  • However, it appears that the SDK version we are using does not support the type of authentication method used in this case.
  • Specifically, version v1.27.0 only supports ContainerCredentialsRelativePath and does not support the AWS_CONTAINER_CREDENTIALS_FULL_URI fallback mechanism.
  • Support for ContainerCredentialsEndpoint was introduced in SDK version v1.31.0 and above.
  • I’ve verified that using SDK >= v1.31.0 resolves the issue — a standalone Go program running in CloudShell with that version correctly retrieves the credentials, whereas versions prior to that reproduce the error.

Unfortunately, we’re currently unable to upgrade to v1.31.0 or higher due to some breaking changes and deprecated functions that would need to be addressed within the plugin. At this time, I don’t have a confirmed ETA for when the SDK upgrade will be completed.

Thank you for your understanding and patience!