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

Enable IAM (temporary) credentials #172

Open
pgorla opened this issue Sep 14, 2020 · 0 comments
Open

Enable IAM (temporary) credentials #172

pgorla opened this issue Sep 14, 2020 · 0 comments

Comments

@pgorla
Copy link

pgorla commented Sep 14, 2020

I'm having trouble with my AWS credentials in tlp-cluster. Unless there's another part I'm missing, I think this is because the AWS SDK is expecting keys with root access, whereas my credentials are temporary and generated by gimme-aws-credentials that expire in an hour, which are IAM credentials, and which give me aws_access_key_id, aws_secret_access_key, aws_session_token, and aws_security_token.

This may be related to #45.

This is the line in User.kt where the command is failing

val ec2 = EC2(awsAccessKey, awsSecret, region)

I'm not familiar with Kotlin or the AWS SDK, or what roles mean, but this doc looked relevant.
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html#using-temp-creds-sdk

Here is the clipped error I am seeing.

Attempting to validate credentials and generate tlp-cluster login keys
Exception in thread "main" software.amazon.awssdk.services.ec2.model.Ec2Exception: AWS was not able to validate the provided access credentials (Service: Ec2, Status Code: 401, Request ID: 7800404c-8ba7-4feb-a2f2-47efaa070b1f)
        at
<snip>
        at com.thelastpickle.tlpcluster.configuration.User$Companion.createInteractively(User.kt:60)
        at com.thelastpickle.tlpcluster.Context$userConfig$2.invoke(Context.kt:61)
        at com.thelastpickle.tlpcluster.Context$userConfig$2.invoke(Context.kt:15)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at com.thelastpickle.tlpcluster.Context.getUserConfig(Context.kt)
        at com.thelastpickle.tlpcluster.commands.Init.initializeDirectory(Init.kt:152)
        at com.thelastpickle.tlpcluster.commands.Init.execute(Init.kt:82)
        at com.thelastpickle.tlpcluster.MainKt.main(Main.kt:51)
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

1 participant