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

Environment variables for credentials are not working #48

Open
albac opened this issue Dec 19, 2015 · 4 comments
Open

Environment variables for credentials are not working #48

albac opened this issue Dec 19, 2015 · 4 comments

Comments

@albac
Copy link

albac commented Dec 19, 2015

I am trying to use environment variables for credentials, I am able to inject and show the environment variables in a post install script, but codedeploy plugin is not able to use them, showing the following error:
is not authorized to perform: codedeploy:ListApplications on resource.. (Service: AmazonCodeDeploy; Status Code: 400; Error Code: AccessDeniedException; Request ID: ..)

I does work when I explicitly use the key id and access key on the form.

I am using 1.8 version of the plugin I am not sure if this is has been fixed on 1.9 looking at the changes appear that is not. In any case I will try the latest plugin later and will update this.

@Jmcfar
Copy link
Contributor

Jmcfar commented Jan 6, 2016

Hi,

Can you clarify on what your setup looks like? My understanding is that plugins cannot pass environment variables across the plugin / action boundary, so when the CodeDeploy plugin gets invoked, the only properties set are those on configured the job or provided by Jenkins setup itself.

@zzhao60
Copy link

zzhao60 commented Mar 5, 2016

Hi, we have the same problem as albac. After using EnvInject Plugin to inject access and secrete keys, the codedeploy plugin is not be able to use them. Would you please let me know how to solve this problem? The problem we have is that we have three environments to deploy to and need to set the credential based on the other parameters. Thanks!

@fattouchsquall
Copy link

Hello,
Same problem for me, any idea how to resolve this issue?
Thanks.

@albac
Copy link
Author

albac commented May 24, 2017

Sorry I had not time to test this more, but the work around has been ok for me so far.
Basically what I did is to uncheck "Use instance credentials" and on both forms value for "AWS Access Key Id" and "AWS Secret Key" passed environment variables. It is not great because I need to inject the keys first in to environment variables, but I am planning to move away from this to cross role functionality soon anyway and maybe use a different language to make this calls. Hope it helps in the mean time for you.

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

No branches or pull requests

4 participants