in infra/topologies.py [0:0]
def __init__(self:IVpcRivStack, scope:Construct, id:str, **kwargs)->None:
super().__init__(scope, id, **kwargs)
core.Tags.of(self).add('riv_stack',self.riv_stack_name)
self.networking = VpcNetworkingConstruct(self,self.riv_stack_name,
cidr=self.cidr_block,
subnet_configuration=self.subnet_configuration)
if config.use_isolated_subnets:
'''
Configure the base networking for the environment.
**IMPORTANT** ISOLATED subnets cannot reach the public internet.
This means that customers must whitelist any AWS services
by creating VPC-endpoints to securely route the traffic.
'''
self.networking.endpoints.add_ssm_support()
self.networking.endpoints.add_kms_support()
self.networking.endpoints.add_rekognition_support()
self.networking.endpoints.add_textract_support()
if config.use_automated_backup:
'''
Create default backup policy for all resources
'''
self.backup_policy = BackupStrategyConstruct(self,'Backup',
riv_stack=self)
# Create default security group...
self.security_group = ec2.SecurityGroup(self,'SecurityGroup',
description='Default-SG for {} RIV stack'.format(self.riv_stack_name),
vpc= self.vpc,
allow_all_outbound=True)
self.security_group.add_ingress_rule(
peer= ec2.Peer.any_ipv4(),
connection= ec2.Port.all_icmp(),
description='Grant icmp from anywhere')