@studion/infra-code-blocks 0.5.3 → 0.6.0
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
CHANGED
|
@@ -68,10 +68,14 @@ $ pulumi up
|
|
|
68
68
|
|
|
69
69
|
### Project
|
|
70
70
|
|
|
71
|
-
Project component makes it
|
|
71
|
+
Project component makes it easy to spin up project infrastructure,
|
|
72
72
|
hiding infrastructure complexity.
|
|
73
73
|
<br>
|
|
74
74
|
The component creates its own VPC used for resources within the project.
|
|
75
|
+
<br><br>
|
|
76
|
+
Services are created only if specified in the `services` list.
|
|
77
|
+
<br>
|
|
78
|
+
If `services` is an empty list, VPC is the only service created by default.
|
|
75
79
|
|
|
76
80
|
```ts
|
|
77
81
|
new Project(name: string, args: ProjectArgs, opts?: pulumi.CustomResourceOptions);
|
|
@@ -96,7 +96,7 @@ class Database extends pulumi.ComponentResource {
|
|
|
96
96
|
performanceInsightsRetentionPeriod: 7,
|
|
97
97
|
}
|
|
98
98
|
: {};
|
|
99
|
-
const instance = new aws.rds.Instance(`${this.name}-rds`, Object.assign(Object.assign({ identifierPrefix: `${this.name}-`, engine: 'postgres', engineVersion: '15.5', allocatedStorage: argsWithDefaults.allocatedStorage, maxAllocatedStorage: argsWithDefaults.maxAllocatedStorage, instanceClass: argsWithDefaults.instanceClass, dbName: argsWithDefaults.dbName, username: argsWithDefaults.username, password: this.password.value, dbSubnetGroupName: this.dbSubnetGroup.name, vpcSecurityGroupIds: [this.dbSecurityGroup.id], storageEncrypted: true, kmsKeyId: this.kms.arn, multiAz: argsWithDefaults.multiAz, publiclyAccessible: false, skipFinalSnapshot: argsWithDefaults.skipFinalSnapshot, applyImmediately: argsWithDefaults.applyImmediately, autoMinorVersionUpgrade: true, maintenanceWindow: 'Mon:07:00-Mon:07:30', finalSnapshotIdentifier: `${this.name}-final-snapshot-${stack}`, backupWindow: '06:00-06:30', backupRetentionPeriod: 14, parameterGroupName: argsWithDefaults.parameterGroupName }, monitoringOptions), { tags: Object.assign(Object.assign({}, constants_1.commonTags), argsWithDefaults.tags) }), { parent: this, dependsOn: [this.password] });
|
|
99
|
+
const instance = new aws.rds.Instance(`${this.name}-rds`, Object.assign(Object.assign({ identifierPrefix: `${this.name}-`, engine: 'postgres', engineVersion: '15.5', allocatedStorage: argsWithDefaults.allocatedStorage, maxAllocatedStorage: argsWithDefaults.maxAllocatedStorage, instanceClass: argsWithDefaults.instanceClass, dbName: argsWithDefaults.dbName, username: argsWithDefaults.username, password: this.password.value, dbSubnetGroupName: this.dbSubnetGroup.name, vpcSecurityGroupIds: [this.dbSecurityGroup.id], storageEncrypted: true, kmsKeyId: this.kms.arn, multiAz: argsWithDefaults.multiAz, publiclyAccessible: false, skipFinalSnapshot: argsWithDefaults.skipFinalSnapshot, applyImmediately: argsWithDefaults.applyImmediately, autoMinorVersionUpgrade: true, maintenanceWindow: 'Mon:07:00-Mon:07:30', finalSnapshotIdentifier: `${this.name}-final-snapshot-${stack}`, backupWindow: '06:00-06:30', backupRetentionPeriod: 14, caCertIdentifier: 'rds-ca-rsa2048-g1', parameterGroupName: argsWithDefaults.parameterGroupName }, monitoringOptions), { tags: Object.assign(Object.assign({}, constants_1.commonTags), argsWithDefaults.tags) }), { parent: this, dependsOn: [this.password] });
|
|
100
100
|
return instance;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -2,6 +2,7 @@ import * as pulumi from '@pulumi/pulumi';
|
|
|
2
2
|
import { EcsService, EcsServiceArgs } from './ecs-service';
|
|
3
3
|
import { Password } from './password';
|
|
4
4
|
export type MongoArgs = Pick<EcsServiceArgs, 'size' | 'clusterId' | 'clusterName' | 'vpcId' | 'vpcCidrBlock' | 'tags'> & {
|
|
5
|
+
privateSubnetIds: pulumi.Input<pulumi.Input<string>[]>;
|
|
5
6
|
/**
|
|
6
7
|
* Username for the master DB user.
|
|
7
8
|
*/
|
|
@@ -11,11 +12,18 @@ export type MongoArgs = Pick<EcsServiceArgs, 'size' | 'clusterId' | 'clusterName
|
|
|
11
12
|
* The value will be stored as a secret in AWS Secret Manager.
|
|
12
13
|
*/
|
|
13
14
|
password?: pulumi.Input<string>;
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Mongo Docker image. Defaults to mongo:7.0.3.
|
|
17
|
+
*/
|
|
18
|
+
image?: pulumi.Input<string>;
|
|
15
19
|
/**
|
|
16
20
|
* Exposed service port. Defaults to 27017.
|
|
17
21
|
*/
|
|
18
22
|
port?: pulumi.Input<number>;
|
|
23
|
+
/**
|
|
24
|
+
* Persistent storage volume path. Defaults to '/data/db'.
|
|
25
|
+
*/
|
|
26
|
+
persistentStorageVolumePath?: pulumi.Input<string>;
|
|
19
27
|
};
|
|
20
28
|
export declare class Mongo extends pulumi.ComponentResource {
|
|
21
29
|
name: string;
|
package/dist/components/mongo.js
CHANGED
|
@@ -18,11 +18,15 @@ const password_1 = require("./password");
|
|
|
18
18
|
class Mongo extends pulumi.ComponentResource {
|
|
19
19
|
constructor(name, args, opts = {}) {
|
|
20
20
|
super('studion:Mongo', name, args, opts);
|
|
21
|
+
const image = args.image ||
|
|
22
|
+
'mongo:7.0.3@sha256:238b1636bdd7820c752b91bec8a669f92568eb313ad89a1fc4a92903c1b40489';
|
|
21
23
|
const port = args.port || 27017;
|
|
24
|
+
const persistentStorageVolumePath = args.persistentStorageVolumePath || '/data/db';
|
|
22
25
|
const { username, password, privateSubnetIds } = args, ecsServiceArgs = __rest(args, ["username", "password", "privateSubnetIds"]);
|
|
23
26
|
this.name = name;
|
|
24
27
|
this.password = new password_1.Password(`${this.name}-mongo-password`, { value: password }, { parent: this });
|
|
25
|
-
this.service = new ecs_service_1.EcsService(name, Object.assign(Object.assign({}, ecsServiceArgs), { port,
|
|
28
|
+
this.service = new ecs_service_1.EcsService(name, Object.assign(Object.assign({}, ecsServiceArgs), { port,
|
|
29
|
+
image, desiredCount: 1, autoscaling: { enabled: false }, enableServiceAutoDiscovery: true, persistentStorageVolumePath, dockerCommand: ['mongod', '--port', port.toString()], assignPublicIp: false, subnetIds: privateSubnetIds, environment: [
|
|
26
30
|
{
|
|
27
31
|
name: 'MONGO_INITDB_ROOT_USERNAME',
|
|
28
32
|
value: username,
|