-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): use dedicated subnets in All-In-AWS-Infrastructure-Ba…
…sic example
- Loading branch information
Showing
11 changed files
with
280 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/lib/subnets.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from aws_cdk.aws_ec2 import SubnetConfiguration, SubnetType | ||
|
||
|
||
# Subnets for undistinguished render farm back-end infrastructure | ||
INFRASTRUCTURE = SubnetConfiguration( | ||
name='Infrastructure', | ||
subnet_type=SubnetType.PRIVATE, | ||
# 1,022 IP addresses | ||
cidr_mask=22 | ||
) | ||
|
||
# Subnets for publicly accessible infrastructure | ||
PUBLIC = SubnetConfiguration( | ||
name='Public', | ||
subnet_type=SubnetType.PUBLIC, | ||
# 14 IP addresses. We only require one ENI per internet gateway per AZ, but leave some extra room | ||
# should there be a need for externally accessible ENIs | ||
cidr_mask=28 | ||
) | ||
|
||
# Subnets for the Render Queue Application Load Balancer (ALB). | ||
# | ||
# It is considered good practice to put a load blanacer in dedicated subnets. Additionally, the subnets | ||
# must have a CIDR block with a bitmask of at least /27 and at least 8 free IP addresses per subnet. | ||
# ALBs can scale up to a maximum of 100 IP addresses distributed across all subnets. Assuming only 2 AZs | ||
# (the minimum) we should have 50 IPs per subnet = CIDR mask of /26 | ||
# | ||
# See: | ||
# - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#subnets-load-balancer | ||
# - https://github.com/aws/aws-rfdk/blob/release/packages/aws-rfdk/lib/deadline/README.md#render-queue-subnet-placement | ||
RENDER_QUEUE_ALB = SubnetConfiguration( | ||
name='RenderQueueALB', | ||
subnet_type=SubnetType.PRIVATE, | ||
# 62 IP addresses | ||
cidr_mask=26 | ||
) | ||
|
||
# Subnets for the Usage-Based Licensing | ||
USAGE_BASED_LICENSING = SubnetConfiguration( | ||
name='UsageBasedLicensing', | ||
subnet_type=SubnetType.PRIVATE, | ||
# 14 IP addresses | ||
cidr_mask=28 | ||
) | ||
|
||
# Subnets for the Worker instances | ||
WORKERS = SubnetConfiguration( | ||
name='Workers', | ||
subnet_type=SubnetType.PRIVATE, | ||
# 4,094 IP addresses | ||
cidr_mask=20 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.