Merge branch 'master' of https://git.paco.to/nick/sciencefair
commit
866bb3fd8f
|
@ -8,3 +8,4 @@ __pycache__
|
||||||
# CDK asset staging directory
|
# CDK asset staging directory
|
||||||
.cdk.staging
|
.cdk.staging
|
||||||
cdk.out
|
cdk.out
|
||||||
|
cdk.context.json
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"availability-zones:account=096320175891:region=us-east-2": [
|
|
||||||
"us-east-2a",
|
|
||||||
"us-east-2b",
|
|
||||||
"us-east-2c"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -11,13 +11,14 @@ class SciInstancesStack(cdk.Stack):
|
||||||
super().__init__(vpcStack, construct_id, env=env, **kwargs)
|
super().__init__(vpcStack, construct_id, env=env, **kwargs)
|
||||||
|
|
||||||
thisVpc = vpcStack.vpc
|
thisVpc = vpcStack.vpc
|
||||||
|
imageId = ec2.LookupMachineImage(name='debian-11-amd64-20221219-1234', windows=False)
|
||||||
ec2instance = ec2.Instance(self, f"i-{thing}",
|
ec2instance = ec2.Instance(self, f"i-{thing}",
|
||||||
vpc=vpcStack.vpc,
|
vpc=vpcStack.vpc,
|
||||||
instance_type=ec2.InstanceType("t2.nano"),
|
instance_type=ec2.InstanceType("t2.nano"),
|
||||||
machine_image=ec2.AmazonLinuxImage(),
|
machine_image=imageId,
|
||||||
block_devices=[ec2.BlockDevice(
|
block_devices=[ec2.BlockDevice(
|
||||||
device_name="/dev/sda1",
|
device_name="/dev/sda1",
|
||||||
volume=ec2.BlockDeviceVolume.ebs(50),
|
volume=ec2.BlockDeviceVolume.ebs(6),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
security_group = vpcStack.SciSG,
|
security_group = vpcStack.SciSG,
|
||||||
|
@ -29,18 +30,13 @@ class VpcBasisStack(cdk.Stack):
|
||||||
super().__init__(scope, construct_id, **kwargs)
|
super().__init__(scope, construct_id, **kwargs)
|
||||||
|
|
||||||
self.vpc = ec2.Vpc(self, 'out-vpc',
|
self.vpc = ec2.Vpc(self, 'out-vpc',
|
||||||
cidr = "172.17.0.0/18",
|
ip_addresses=ec2.IpAddresses.cidr('172.19.19.0/24'),
|
||||||
max_azs = 3,
|
max_azs = 1,
|
||||||
subnet_configuration=[
|
subnet_configuration=[
|
||||||
ec2.SubnetConfiguration(
|
ec2.SubnetConfiguration(
|
||||||
name = 'pub',
|
name = 'pub',
|
||||||
subnet_type = ec2.SubnetType.PUBLIC,
|
subnet_type = ec2.SubnetType.PUBLIC,
|
||||||
cidr_mask = 26
|
cidr_mask = 26
|
||||||
),
|
|
||||||
ec2.SubnetConfiguration(
|
|
||||||
name = 'pri',
|
|
||||||
subnet_type = ec2.SubnetType.PRIVATE_WITH_NAT,
|
|
||||||
cidr_mask = 20
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
nat_gateways = 3
|
nat_gateways = 3
|
||||||
|
|
Loading…
Reference in New Issue