Skip to content

Instantly share code, notes, and snippets.

@twasink

twasink/Globals.yaml

Created Jan 15, 2019
Embed
What would you like to do?
Baby's First CloudFormation Stack
---
AWSTemplateFormatVersion: '2010-09-09'
Description:
Global configuration that could be used by multiple related stacks
# Metadata: # no metadata
Parameters:
Environment:
Type: String
Description:
Stack Environment Prefix.
Resources:
# We need at least one resource. The VPC is the logical one to include here.
VPC:
Type: AWS::EC2::VPC
Properties:
# The range of ip addresses used in the VPC. Subnets will be inside this.
# Using the /16 lets me easily have subnets that don't overlap without
# needing to remember bit masks.
CidrBlock: 10.0.0.0/16 # 10.0.0.0 -> 10.0.255.255
EnableDnsSupport: true # If false, the servers don't seem to get access to DNS at all.
InstanceTenancy: default
Tags:
- Key: Name
Value: !Sub "${Environment} VPC"
Outputs:
VPC:
Description: The ID for the Virtual Private Cloud; needed by more or less everything.
Value: !Ref VPC
Export:
Name: !Sub "${Environment}::VPC"
@twasink

This comment has been minimized.

Copy link
Owner Author

@twasink twasink commented Jan 15, 2019

An example 'global' CloudFormation stack, defining resources that we don't want to have to remove and recreate unnecessarily. See https://twasink.net/2019/01/11/ail-babys-first-cloudformation-stack/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.