# Passing environment variables to aws ssh connection

**URL:** <https://discuss.circleci.com/t/passing-environment-variables-to-aws-ssh-connection/41567>\
**Category:** Deployments\
**Tags:** envars, aws, awscli, circle-yml\
**Created:** [October 19, 2021, 9:03am UTC](https://discuss.circleci.com/t/passing-environment-variables-to-aws-ssh-connection/41567 "2021-10-19T09:03:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsasikiran](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/gsasikiran/32/28395_2.png) [@gsasikiran](https://discuss.circleci.com/u/gsasikiran)\
**Post date:** [October 19, 2021, 9:03am UTC](https://discuss.circleci.com/t/passing-environment-variables-to-aws-ssh-connection/41567/1 "2021-10-19T09:03:20Z")

</div>

We are connecting to aws ec2 instance with ssh key and command from circleci. So, currently we are running ssh commands for every job to connect to aws. So, this opens a new shell everytime we run a ssh command to connect. So, we would like to know

1. if there is a solution to connect to aws with single shell command without running ssh multiple times for multiple jobs?
2. How can we pass the environment variables to aws once for all to run?
