Skip to content

Commit dc6637d

Browse files
committed
allora stack
1 parent 9cc8fc4 commit dc6637d

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore artifacts:
2+
build
3+
dist
4+
coverage
5+
cdk.out/*

lib/allora/lib/allora-stack.ts

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export class AlloraStack extends cdk.Stack {
99
super(scope, id, props);
1010

1111
// 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+
// });
1616

1717
const instanceSizeParam = new cdk.CfnParameter(this, 'InstanceSize', {
1818
type: 'String',
@@ -21,33 +21,26 @@ export class AlloraStack extends cdk.Stack {
2121
});
2222

2323
// Create VPC
24-
const vpc = new ec2.Vpc(this, 'Vec4AlloraWorker1Vpc', {
24+
const vpc = new ec2.Vpc(this, 'AlloraWorkerxVpc', {
2525
maxAzs: 1,
2626
natGateways: 0,
2727
subnetConfiguration: [{
2828
cidrMask: 24,
29-
name: `Vec4AlloraWorker1PublicSubnet`,
29+
name: `AlloraWorkerxPublicSubnet`,
3030
subnetType: ec2.SubnetType.PUBLIC,
3131
}]
3232
});
3333

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-
4134
// Security Group with inbound TCP port 9010 open
42-
const securityGroup = new ec2.SecurityGroup(this, 'Vec4AlloraWorker1SecurityGroup', {
35+
const securityGroup = new ec2.SecurityGroup(this, 'AlloraWorkerxSecurityGroup', {
4336
vpc,
4437
allowAllOutbound: true,
4538
description: 'Allow inbound TCP 9010',
4639
});
4740
securityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(9010), 'Allow inbound TCP 9010');
4841

4942
// EC2 Instance
50-
const instance = new ec2.Instance(this, 'Vec4AlloraWorker1Instance', {
43+
const instance = new ec2.Instance(this, 'AlloraWorkerxInstance', {
5144
vpc,
5245
instanceType: new ec2.InstanceType(instanceSizeParam.valueAsString),
5346
machineImage: ec2.MachineImage.genericLinux({
@@ -66,16 +59,10 @@ export class AlloraStack extends cdk.Stack {
6659
});
6760

6861
// 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', {
7164
eip: eip.ref,
7265
instanceId: instance.instanceId,
7366
});
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`);
8067
}
8168
}

0 commit comments

Comments
 (0)