@studion/infra-code-blocks 0.4.3 → 0.4.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.
- package/README.md +2 -0
- package/dist/components/project.d.ts +1 -0
- package/dist/components/project.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -94,6 +94,7 @@ type ProjectArgs = {
|
|
|
94
94
|
| EcsServiceOptions
|
|
95
95
|
)[];
|
|
96
96
|
enableSSMConnect?: pulumi.Input<boolean>;
|
|
97
|
+
numberOfAvailabilityZones?: number;
|
|
97
98
|
};
|
|
98
99
|
```
|
|
99
100
|
|
|
@@ -101,6 +102,7 @@ type ProjectArgs = {
|
|
|
101
102
|
| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
102
103
|
| services \* | Service list. |
|
|
103
104
|
| enableSSMConnect | Setup ec2 instance and SSM in order to connect to the database in the private subnet. Please refer to the [SSM Connect](#ssm-connect) section for more info. |
|
|
105
|
+
| numberOfAvailabilityZones | Default is 2 which is recommended. If building a dev server, we can reduce to 1 availability zone to reduce hosting cost. |
|
|
104
106
|
|
|
105
107
|
```ts
|
|
106
108
|
type DatabaseServiceOptions = {
|
|
@@ -48,6 +48,7 @@ export type EcsServiceOptions = {
|
|
|
48
48
|
export type ProjectArgs = {
|
|
49
49
|
services: (DatabaseServiceOptions | RedisServiceOptions | StaticSiteServiceOptions | WebServerServiceOptions | NuxtSSRServiceOptions | MongoServiceOptions | EcsServiceOptions)[];
|
|
50
50
|
enableSSMConnect?: pulumi.Input<boolean>;
|
|
51
|
+
numberOfAvailabilityZones?: number;
|
|
51
52
|
};
|
|
52
53
|
export declare class MissingEcsCluster extends Error {
|
|
53
54
|
constructor();
|
|
@@ -37,7 +37,7 @@ class Project extends pulumi.ComponentResource {
|
|
|
37
37
|
super('studion:Project', name, {}, opts);
|
|
38
38
|
this.services = {};
|
|
39
39
|
this.name = name;
|
|
40
|
-
this.vpc = this.createVpc();
|
|
40
|
+
this.vpc = this.createVpc(args.numberOfAvailabilityZones);
|
|
41
41
|
this.createServices(args.services);
|
|
42
42
|
if (args.enableSSMConnect) {
|
|
43
43
|
this.ec2SSMConnect = new ec2_ssm_connect_1.Ec2SSMConnect(`${name}-ssm-connect`, {
|
|
@@ -48,9 +48,9 @@ class Project extends pulumi.ComponentResource {
|
|
|
48
48
|
}
|
|
49
49
|
this.registerOutputs();
|
|
50
50
|
}
|
|
51
|
-
createVpc() {
|
|
51
|
+
createVpc(numberOfAvailabilityZones = 2) {
|
|
52
52
|
const vpc = new awsx.ec2.Vpc(`${this.name}-vpc`, {
|
|
53
|
-
numberOfAvailabilityZones
|
|
53
|
+
numberOfAvailabilityZones,
|
|
54
54
|
enableDnsHostnames: true,
|
|
55
55
|
enableDnsSupport: true,
|
|
56
56
|
subnetSpecs: [
|