# Use Ansible variable in AWS Cloudformation template

**URL:** <https://forum.ansible.com/t/use-ansible-variable-in-aws-cloudformation-template/35851>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 12, 2021, 12:04pm UTC](https://forum.ansible.com/t/use-ansible-variable-in-aws-cloudformation-template/35851 "2021-10-12T12:04:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony1](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@Tony1](https://forum.ansible.com/u/Tony1)\
**Post date:** [October 12, 2021, 12:04pm UTC](https://forum.ansible.com/t/use-ansible-variable-in-aws-cloudformation-template/35851/1 "2021-10-12T12:04:18Z")

</div>

Hi,

I am trying to use an ansible variable in my AWS cloudformation template, see below red where I am trying to use the variable from Ansible.

Parameters:

Environment:  
Description: ‘Environment definition.’  
Type: ‘String’  
Default: ‘Dev’

Resources:

VPC:  
Type: ‘AWS::EC2::VPC’  
Properties:  
CidrBlock:  
“{{ ansible variable here }}”  
EnableDnsSupport: true  
EnableDnsHostnames: true  
InstanceTenancy: ‘default’  
Tags:

- Key: ‘Environment’  
Value:  
Ref: ‘Environment’

Does anyone know how to pass this on to Ansible?

Thank you!
