-
Notifications
You must be signed in to change notification settings - Fork 25
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
Assume AWS role when executing AWS API #9
Comments
In the sbt console, I have confirmed that the system property is being set:
|
Hi @neowulf33, I'm not sure why I'm executing my tasks like this:
Let me know if that works for you. |
Hi @sbilinski, Thank you for the tip. Unfortunately, it didn't work as the error message hasn't changed which is:
I get the same error when I execute a AWS CLI without providing the correct profile. |
Hi @sbilinski , Do you know if the |
I'm not sure what could go wrong here, since repository creation is just a direct call to the Amazon SDK. That being said, does it work if you put your Also, double check if you have a proper policy attached. I'm using the predefined |
I have pulled the credentials into the I am able to create a repository without specifying the profile using the AWS CLI SDK:
The role doesn't get switched when executing the sbt task, though. |
I suppose the role is inherited from the
Does the |
Sorry, no, I see that there are other |
Credential providers are taken in order, until some value is found. Maybe you should check if there is no Same goes for |
I believe those are getting picked up as evident from the incorrect credentials. However, the |
Please see my PR #10 for a fix for this. |
@neowulf33: Given the content of the PR and the comment above, I think the main issue is that you need to assume the role before you run any plugin commands (different responsibility). For reference:
Let me know, if you've managed to resolve the issue. |
Thank you for the references. However, please note that the generated credentials are short lived and will have to be re-run before executing the AWS commands - which may not be ideal when automating the build process and pushing the docker images to ECR.
|
Assuming that your CI services will run in the cloud, you can assume role on the instance itself and use the When running on-premises, I'd probably setup a dedicated AWS user for CI purposes (with a proper Amazon ECR policy) or do exactly what you did, but in a dedicated task (i.e outside of the plugin; maybe even outside of |
Hi! |
@michaelgroening Try attaching |
The
shared
role doesn't get assumed when executing the following:I have the following in my aws files:
I see this line in
AWS.scala
:Any pointers would be be helpful! I see Thank you!
The text was updated successfully, but these errors were encountered: