Environment variables for credentials are not working
albac opened this issue · comments
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.
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.
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!
Hello,
Same problem for me, any idea how to resolve this issue?
Thanks.
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.