Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ type ProjectArgs = {
| EcsServiceOptions
)[];
enableSSMConnect?: pulumi.Input<boolean>;
numberOfAvailabilityZones?: number;
};
```

| Argument | Description |
| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------: |
| services \* | Service list. |
| 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. |
| numberOfAvailabilityZones | Default is 2 which is recommended. If building a dev server, we can reduce to 1 availability zone to reduce hosting cost. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for also thinking about updating documentation ❤️


```ts
type DatabaseServiceOptions = {
Expand Down
9 changes: 6 additions & 3 deletions src/components/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export type ProjectArgs = {
| EcsServiceOptions
)[];
enableSSMConnect?: pulumi.Input<boolean>;
numberOfAvailabilityZones?: number;
};

export class MissingEcsCluster extends Error {
Expand All @@ -141,7 +142,7 @@ export class Project extends pulumi.ComponentResource {
super('studion:Project', name, {}, opts);
this.name = name;

this.vpc = this.createVpc();
this.vpc = this.createVpc(args.numberOfAvailabilityZones);
this.createServices(args.services);

if (args.enableSSMConnect) {
Expand All @@ -155,11 +156,13 @@ export class Project extends pulumi.ComponentResource {
this.registerOutputs();
}

private createVpc() {
private createVpc(
numberOfAvailabilityZones: ProjectArgs['numberOfAvailabilityZones'] = 2,
) {
const vpc = new awsx.ec2.Vpc(
`${this.name}-vpc`,
{
numberOfAvailabilityZones: 2,
numberOfAvailabilityZones,
enableDnsHostnames: true,
enableDnsSupport: true,
subnetSpecs: [
Expand Down