@studion/infra-code-blocks 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,18 @@ class Ec2SSMConnect extends pulumi.ComponentResource {
17
17
  toPort: 22,
18
18
  cidrBlocks: ['0.0.0.0/0'],
19
19
  },
20
+ {
21
+ protocol: 'tcp',
22
+ fromPort: 80,
23
+ toPort: 80,
24
+ cidrBlocks: ['0.0.0.0/0'],
25
+ },
26
+ {
27
+ protocol: 'tcp',
28
+ fromPort: 443,
29
+ toPort: 443,
30
+ cidrBlocks: ['0.0.0.0/0'],
31
+ },
20
32
  ],
21
33
  egress: [
22
34
  { protocol: '-1', fromPort: 0, toPort: 0, cidrBlocks: ['0.0.0.0/0'] },
@@ -44,6 +56,21 @@ class Ec2SSMConnect extends pulumi.ComponentResource {
44
56
  const ssmProfile = new aws.iam.InstanceProfile(`${name}-ssm-profile`, {
45
57
  role: role.name,
46
58
  }, { parent: this, dependsOn: [ssmPolicyAttachment] });
59
+ this.sshKeyPair = new aws.ec2.KeyPair(`${name}-ec2-keypair`, {
60
+ publicKey: args.sshPublicKey,
61
+ }, { parent: this });
62
+ this.ec2 = new aws.ec2.Instance(`${name}-ec2`, {
63
+ ami: 'ami-067d1e60475437da2',
64
+ associatePublicIpAddress: false,
65
+ instanceType: 't2.micro',
66
+ keyName: this.sshKeyPair.keyName,
67
+ iamInstanceProfile: ssmProfile.name,
68
+ subnetId,
69
+ vpcSecurityGroupIds: [this.ec2SecurityGroup.id],
70
+ tags: {
71
+ Name: `${name}-ec2`,
72
+ },
73
+ }, { parent: this });
47
74
  this.ssmVpcEndpoint = new aws.ec2.VpcEndpoint(`${name}-ssm-vpc-endpoint`, {
48
75
  vpcId: args.vpc.vpcId,
49
76
  ipAddressType: 'ipv4',
@@ -52,7 +79,7 @@ class Ec2SSMConnect extends pulumi.ComponentResource {
52
79
  subnetIds: [subnetId],
53
80
  securityGroupIds: [this.ec2SecurityGroup.id],
54
81
  privateDnsEnabled: true,
55
- }, { parent: this });
82
+ }, { parent: this, dependsOn: [this.ec2] });
56
83
  this.ec2MessagesVpcEndpoint = new aws.ec2.VpcEndpoint(`${name}-ec2messages-vpc-endpoint`, {
57
84
  vpcId: args.vpc.vpcId,
58
85
  ipAddressType: 'ipv4',
@@ -61,7 +88,7 @@ class Ec2SSMConnect extends pulumi.ComponentResource {
61
88
  subnetIds: [subnetId],
62
89
  securityGroupIds: [this.ec2SecurityGroup.id],
63
90
  privateDnsEnabled: true,
64
- }, { parent: this });
91
+ }, { parent: this, dependsOn: [this.ec2] });
65
92
  this.ssmMessagesVpcEndpoint = new aws.ec2.VpcEndpoint(`${name}-ssmmessages-vpc-endpoint`, {
66
93
  vpcId: args.vpc.vpcId,
67
94
  ipAddressType: 'ipv4',
@@ -70,22 +97,7 @@ class Ec2SSMConnect extends pulumi.ComponentResource {
70
97
  subnetIds: [subnetId],
71
98
  securityGroupIds: [this.ec2SecurityGroup.id],
72
99
  privateDnsEnabled: true,
73
- }, { parent: this });
74
- this.sshKeyPair = new aws.ec2.KeyPair(`${name}-ec2-keypair`, {
75
- publicKey: args.sshPublicKey,
76
- }, { parent: this });
77
- this.ec2 = new aws.ec2.Instance(`${name}-ec2`, {
78
- ami: 'ami-067d1e60475437da2',
79
- associatePublicIpAddress: false,
80
- instanceType: 't2.micro',
81
- keyName: this.sshKeyPair.keyName,
82
- iamInstanceProfile: ssmProfile.name,
83
- subnetId,
84
- vpcSecurityGroupIds: [this.ec2SecurityGroup.id],
85
- tags: {
86
- Name: `${name}-ec2`,
87
- },
88
- }, { parent: this });
100
+ }, { parent: this, dependsOn: [this.ec2] });
89
101
  this.registerOutputs();
90
102
  }
91
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studion/infra-code-blocks",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Studion common infra components",
5
5
  "keywords": [
6
6
  "infrastructure",