title: How can I add an IP address in a AWS CLI with out exporting
body: <p>I am running below command to ingress in aws-cli, it is working fine if I provide an IP address, but I want it to know the IP and pass it.
  I was trying something like below but it is not helping</p>
  <pre><code>aws ec2 authorize-security-group-ingress --group-id sg-123456778 --protocol tcp --port 22 --cidr echo &quot;$(curl https://checkip.amazonaws.com)/32&quot; --profile xyzzy
  </code></pre>
  <p>If I am doing below then it works but I want it to be done by above way.</p>
  <pre><code>IP=`echo &quot;$(curl https://checkip.amazonaws.com)/32&quot;`
  aws ec2 authorize-security-group-ingress --group-id sg-123456778 --protocol tcp --port 22 --cidr $IP --profile xyzzy
  </code></pre>