@@ -9,10 +9,10 @@ export class AlloraStack extends cdk.Stack {
9
9
super ( scope , id , props ) ;
10
10
11
11
// Parameters
12
- const resourceNamePrefixParam = new cdk . CfnParameter ( this , 'ResourceNamePrefix' , {
13
- type : 'String' ,
14
- description : 'Prefix for resource names to override AWS auto-generated naming convention' ,
15
- } ) ;
12
+ // const resourceNamePrefixParam = new cdk.CfnParameter(this, 'ResourceNamePrefix', {
13
+ // type: 'String',
14
+ // description: 'Prefix for resource names to override AWS auto-generated naming convention',
15
+ // });
16
16
17
17
const instanceSizeParam = new cdk . CfnParameter ( this , 'InstanceSize' , {
18
18
type : 'String' ,
@@ -21,33 +21,26 @@ export class AlloraStack extends cdk.Stack {
21
21
} ) ;
22
22
23
23
// Create VPC
24
- const vpc = new ec2 . Vpc ( this , 'Vec4AlloraWorker1Vpc ' , {
24
+ const vpc = new ec2 . Vpc ( this , 'AlloraWorkerxVpc ' , {
25
25
maxAzs : 1 ,
26
26
natGateways : 0 ,
27
27
subnetConfiguration : [ {
28
28
cidrMask : 24 ,
29
- name : `Vec4AlloraWorker1PublicSubnet ` ,
29
+ name : `AlloraWorkerxPublicSubnet ` ,
30
30
subnetType : ec2 . SubnetType . PUBLIC ,
31
31
} ]
32
32
} ) ;
33
33
34
- // Create and attach Internet Gateway
35
- // const igw = new ec2.CfnInternetGateway(this, 'Vec4AlloraWorker1IGW');
36
- // new ec2.CfnVPCGatewayAttachment(this, 'Vec4AlloraWorker1VpcIgwAttachment', {
37
- // vpcId: vpc.vpcId,
38
- // internetGatewayId: igw.ref,
39
- // });
40
-
41
34
// Security Group with inbound TCP port 9010 open
42
- const securityGroup = new ec2 . SecurityGroup ( this , 'Vec4AlloraWorker1SecurityGroup ' , {
35
+ const securityGroup = new ec2 . SecurityGroup ( this , 'AlloraWorkerxSecurityGroup ' , {
43
36
vpc,
44
37
allowAllOutbound : true ,
45
38
description : 'Allow inbound TCP 9010' ,
46
39
} ) ;
47
40
securityGroup . addIngressRule ( ec2 . Peer . anyIpv4 ( ) , ec2 . Port . tcp ( 9010 ) , 'Allow inbound TCP 9010' ) ;
48
41
49
42
// EC2 Instance
50
- const instance = new ec2 . Instance ( this , 'Vec4AlloraWorker1Instance ' , {
43
+ const instance = new ec2 . Instance ( this , 'AlloraWorkerxInstance ' , {
51
44
vpc,
52
45
instanceType : new ec2 . InstanceType ( instanceSizeParam . valueAsString ) ,
53
46
machineImage : ec2 . MachineImage . genericLinux ( {
@@ -66,16 +59,10 @@ export class AlloraStack extends cdk.Stack {
66
59
} ) ;
67
60
68
61
// Elastic IP
69
- const eip = new ec2 . CfnEIP ( this , 'Vec4AlloraWorker1EIP ' ) ;
70
- new ec2 . CfnEIPAssociation ( this , 'Vec4AlloraWorker1EIPAssociation ' , {
62
+ const eip = new ec2 . CfnEIP ( this , 'AlloraWorkerxEIP ' ) ;
63
+ new ec2 . CfnEIPAssociation ( this , 'AlloraWorkerxEIPAssociation ' , {
71
64
eip : eip . ref ,
72
65
instanceId : instance . instanceId ,
73
66
} ) ;
74
-
75
- // Add Tags for resource naming convention
76
- // cdk.Tags.of(vpc).add('Name', `${resourceNamePrefixParam.valueAsString}-Vpc`);
77
- // cdk.Tags.of(securityGroup).add('Name', `${resourceNamePrefixParam.valueAsString}-SecurityGroup`);
78
- // cdk.Tags.of(instance).add('Name', `${resourceNamePrefixParam.valueAsString}-Instance`);
79
- // cdk.Tags.of(eip).add('Name', `${resourceNamePrefixParam.valueAsString}-EIP`);
80
67
}
81
68
}
0 commit comments