Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preset Mapping of VPC Standards #9

Open
fozzy77 opened this issue Sep 10, 2021 · 0 comments
Open

Preset Mapping of VPC Standards #9

fozzy77 opened this issue Sep 10, 2021 · 0 comments

Comments

@fozzy77
Copy link

fozzy77 commented Sep 10, 2021

I though this might be an option to introduce, rather than fixing the CIDR mask , it being built dynamically to encompass the use of mapping , do you think this would be of any benefit. This seems to work as expected on a local test

Mappings:
EnvMap:
Small:
subnetbits: "5"
cidrsize: "23"
Medium:
subnetbits: "6"
cidrsize: "22"
Large:
subnetbits: "7"
cidrsize: "21"

By removing the CIDR from parameters and replace with
Size:
Type: String
Description: Enter Small,Medium or Large
AllowedValues:
- Small
- Medium
- Large

Subnets to utilise something like
PrivateSubnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
AvailabilityZone: !Select [ 0, !GetAZs '' ]
CidrBlock: !Select
- 0
- Fn::Cidr:
- !GetAtt AllocateCidr.cidr
- 9
- !FindInMap [EnvMap, !Ref Size, subnetbits]
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: !Sub ${Environment} Private Subnet (AZ1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant