Skip to content

Instantly share code, notes, and snippets.

@a-nldisr
Last active February 4, 2020 17:24
Show Gist options
  • Save a-nldisr/cc7c555f516cfb40204342ccb3291ed3 to your computer and use it in GitHub Desktop.
Save a-nldisr/cc7c555f516cfb40204342ccb3291ed3 to your computer and use it in GitHub Desktop.
- name: 'Register Test VPC into a var'
ec2_vpc_net_facts:
filters:
"tag:Name": test-vpc
register: vpctest
# You probably need to change the IP for something at your side
- name: 'Creating Customer Gateway'
ec2_customer_gateway:
state: present
name: "test-cgw"
region: us-east-1
routing: static
ip_address: "8.8.8.8"
register: cgwtest
- name: 'Creating Virtual Private Gateway in Test'
ec2_vpc_vgw:
state: present
region: "us-east-1"
vpc_id: "{{ vpctest.vpcs[0].vpc_id }}"
name: "test-vgw"
type: ipsec.1
register: vgwtest
- name: 'Creating Virtual Private Network connection in Test with minimal specs'
ec2_vpc_vpn:
state: present
region: "us-east-1"
vpn_gateway_id: "{{ vgwtest.vgw.id }}"
customer_gateway_id: "{{ cgwtest.gateway.customer_gateway.customer_gateway_id }}"
static_only: yes
tags:
Name: "test-vpn"
# Replace the VPN id with the one you generated above.
- name: 'Adjust the VPN with tunnel options utilizing'
ec2_vpc_vpn:
state: present
filters:
vpn: "vpn-XXXXXX"
static_only: true
tunnel_options:
-
TunnelInsideCidr: '169.254.100.1/30'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment