Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Missing Environment Variables Error.

Darshan Gerra March 11, 2020

Hello,

I have created Environments in deployments namely Development and Production which are using different aws accounts for deployment purposes.

I have added variables in development environment :

dev_env.png

and this is my pipeline snippet :
pipe_snip.png


this is giving me error  - AWS_ACCESS_KEY_ID variable is missing.
I have tried to add in repository variables and it worked, but my requirement is environment specific since we are using different aws accounts for production and development.

repo_vars.png

Let me know what I'm missing.

Thanks.



1 answer

1 accepted

0 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 11, 2020

Hello @Darshan Gerra ,

It looks like the step with AWS pipe is missing deployment: Deployment property. The previous step, in turn, shouldn't have it as it doesn't actually do deploy.

Hope this helps.

Cheers,
Daniil

Darshan Gerra March 12, 2020

Thanks Daniil,

adding deployment: Development in first step works, and i'm getting another error in another step. Require your expertise and help.

Pipeline snippet : 

bitbucket_pipe.png

Error : 
error.png

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 12, 2020

Same thing: if your variables are defined for a specific environment, they are not visible unless your step is marked as deployment step to that environment. Moreover, you can only define a particular deployment environment once per pipeline. That is, you can't mark two or more steps as deployment steps to the very same environment within one pipeline.

So if the second step you added is meant to do something around the same environment (Development in your case), you need to consolidate two steps into one which would call both pipes in its script.

Hope this makes sense. Let me know if you have any questions.

Cheers,
Daniil

Darshan Gerra March 12, 2020

Thanks Daniil,

I have tried to merge steps and it worked. One thing I want to know on this : if I have s3 deployment , lambda deployments, docker images deployment to ec2 using code-deploy in my application, So should I include all these in a single step??

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 12, 2020

Well, if they all are part of a single deployment to a single environment from the very same repository, then yes, they all should happen within one step marked as deployment step for that environment.

You can split your pipeline into multiple if that makes sense. In that case each pipeline would only deploy its own component. Again, constraint is: one deployment step into a given environment within a pipeline.

Another option is to move your deployment logic into external script. But you won't be able to easily use pipes there, so this is probably not a desired option I guess, by the look of your current script.

Cheers,
Daniil

Darshan Gerra March 13, 2020

Understood, I have merged all deployments into a single step.

Thanks alot Daniil.

Like Daniil Penkin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events