blob: 7fc31e7de0b7f814a64da36a97d7b1e6d8a271ed [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
- name: "{{ env }}: Create virtual private cloud"
ec2_vpc:
region: "{{ region }}"
internet_gateway: True
resource_tags:
Name: "{{ env }}-virtual-private-cloud"
env: "{{ env }}"
cidr_block: 10.0.0.0/16
dns_hostnames: yes
dns_support: yes
subnets:
- cidr: 10.0.0.0/24
resource_tags:
tier: web
- cidr: 10.0.1.0/24
resource_tags:
tier: hdp
- cidr: 10.0.2.0/24
resource_tags:
tier: sensors
route_tables:
- subnets:
- 10.0.0.0/24
- 10.0.1.0/24
- 10.0.2.0/24
routes:
- dest: 0.0.0.0/0
gw: igw
register: vpc
- name: "[{{ env }}] Created vpc with id={{ vpc.vpc_id }}"
set_fact:
vpc_id: "{{ vpc.vpc_id }}"