@studion/infra-code-blocks 0.0.2 → 0.0.3

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.
@@ -1,14 +1,19 @@
1
1
  import * as pulumi from '@pulumi/pulumi';
2
2
  import * as upstash from '@upstash/pulumi';
3
3
  export type RedisArgs = {
4
+ /**
5
+ * Redis database name.
6
+ */
4
7
  dbName: pulumi.Input<string>;
8
+ /**
9
+ * Region of the database. Possible values are: "global", "eu-west-1", "us-east-1", "us-west-1", "ap-northeast-1" , "eu-central1".
10
+ */
5
11
  region?: pulumi.Input<string>;
6
12
  };
7
13
  export interface RedisOptions extends pulumi.ComponentResourceOptions {
8
14
  provider: upstash.Provider;
9
15
  }
10
- export type RedisInstance = upstash.RedisDatabase;
11
16
  export declare class Redis extends pulumi.ComponentResource {
12
- instance: RedisInstance;
17
+ instance: upstash.RedisDatabase;
13
18
  constructor(name: string, args: RedisArgs, opts: RedisOptions);
14
19
  }
@@ -3,12 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Redis = void 0;
4
4
  const pulumi = require("@pulumi/pulumi");
5
5
  const upstash = require("@upstash/pulumi");
6
+ const defaults = {
7
+ region: 'us-east-1',
8
+ };
6
9
  class Redis extends pulumi.ComponentResource {
7
10
  constructor(name, args, opts) {
8
- super('studion:redis:Instance', name, {}, opts);
11
+ super('studion:Redis', name, {}, opts);
12
+ const argsWithDefaults = Object.assign({}, defaults, args);
9
13
  this.instance = new upstash.RedisDatabase(name, {
10
- databaseName: args.dbName,
11
- region: args.region || 'us-east-1',
14
+ databaseName: argsWithDefaults.dbName,
15
+ region: argsWithDefaults.region,
12
16
  eviction: true,
13
17
  tls: true,
14
18
  }, { provider: opts.provider, parent: this });
@@ -0,0 +1,20 @@
1
+ import * as aws from '@pulumi/aws';
2
+ import * as pulumi from '@pulumi/pulumi';
3
+ import { AcmCertificate } from './acm-certificate';
4
+ export type StaticSiteArgs = {
5
+ /**
6
+ * The domain which will be used to access the static site.
7
+ * The domain or subdomain must belong to the provided hostedZone.
8
+ */
9
+ domain: pulumi.Input<string>;
10
+ /**
11
+ * The ID of the hosted zone.
12
+ */
13
+ hostedZoneId: pulumi.Input<string>;
14
+ };
15
+ export declare class StaticSite extends pulumi.ComponentResource {
16
+ certificate: AcmCertificate;
17
+ bucket: aws.s3.Bucket;
18
+ cloudfront: aws.cloudfront.Distribution;
19
+ constructor(name: string, args: StaticSiteArgs, opts?: pulumi.ComponentResourceOptions);
20
+ }
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StaticSite = void 0;
4
+ const aws = require("@pulumi/aws");
5
+ const pulumi = require("@pulumi/pulumi");
6
+ const acm_certificate_1 = require("./acm-certificate");
7
+ class StaticSite extends pulumi.ComponentResource {
8
+ constructor(name, args, opts = {}) {
9
+ super('studion:StaticSite', name, {}, opts);
10
+ const certificate = new acm_certificate_1.AcmCertificate(`${args.domain}-acm-certificate`, {
11
+ domain: args.domain,
12
+ hostedZoneId: args.hostedZoneId,
13
+ }, { parent: this });
14
+ const bucket = new aws.s3.Bucket(`${name}-bucket`, {
15
+ bucket: name,
16
+ website: {
17
+ indexDocument: 'index.html',
18
+ errorDocument: 'index.html',
19
+ },
20
+ }, { parent: this });
21
+ const bucketPublicAccessBlock = new aws.s3.BucketPublicAccessBlock(`${name}-bucket-access-block`, {
22
+ bucket: bucket.id,
23
+ blockPublicAcls: false,
24
+ blockPublicPolicy: false,
25
+ ignorePublicAcls: false,
26
+ restrictPublicBuckets: false,
27
+ }, { parent: this });
28
+ const siteBucketPolicy = new aws.s3.BucketPolicy(`${name}-bucket-policy`, {
29
+ bucket: bucket.bucket,
30
+ policy: bucket.bucket.apply(publicReadPolicy),
31
+ }, { parent: this, dependsOn: [bucketPublicAccessBlock] });
32
+ function publicReadPolicy(bucketName) {
33
+ return {
34
+ Version: '2012-10-17',
35
+ Statement: [
36
+ {
37
+ Effect: 'Allow',
38
+ Principal: '*',
39
+ Action: ['s3:GetObject'],
40
+ Resource: [`arn:aws:s3:::${bucketName}/*`],
41
+ },
42
+ ],
43
+ };
44
+ }
45
+ const cloudfront = new aws.cloudfront.Distribution(`${name}-cloudfront`, {
46
+ enabled: true,
47
+ defaultRootObject: 'index.html',
48
+ aliases: [args.domain],
49
+ isIpv6Enabled: true,
50
+ waitForDeployment: true,
51
+ httpVersion: 'http2and3',
52
+ viewerCertificate: {
53
+ acmCertificateArn: certificate.certificate.arn,
54
+ sslSupportMethod: 'sni-only',
55
+ minimumProtocolVersion: 'TLSv1.2_2021',
56
+ },
57
+ origins: [
58
+ {
59
+ originId: bucket.arn,
60
+ domainName: bucket.websiteEndpoint,
61
+ connectionAttempts: 3,
62
+ connectionTimeout: 10,
63
+ customOriginConfig: {
64
+ originProtocolPolicy: 'http-only',
65
+ httpPort: 80,
66
+ httpsPort: 443,
67
+ originSslProtocols: ['TLSv1.2'],
68
+ },
69
+ },
70
+ ],
71
+ defaultCacheBehavior: {
72
+ targetOriginId: bucket.arn,
73
+ viewerProtocolPolicy: 'redirect-to-https',
74
+ allowedMethods: ['GET', 'HEAD', 'OPTIONS'],
75
+ cachedMethods: ['GET', 'HEAD', 'OPTIONS'],
76
+ compress: true,
77
+ defaultTtl: 86400,
78
+ minTtl: 1,
79
+ maxTtl: 31536000,
80
+ forwardedValues: {
81
+ cookies: { forward: 'none' },
82
+ queryString: false,
83
+ },
84
+ },
85
+ priceClass: 'PriceClass_100',
86
+ restrictions: {
87
+ geoRestriction: { restrictionType: 'none' },
88
+ },
89
+ }, { parent: this });
90
+ const cdnAliasRecord = new aws.route53.Record(`${name}-cdn-route53-record`, {
91
+ type: 'A',
92
+ name: args.domain,
93
+ zoneId: args.hostedZoneId,
94
+ aliases: [
95
+ {
96
+ name: cloudfront.domainName,
97
+ zoneId: cloudfront.hostedZoneId,
98
+ evaluateTargetHealth: true,
99
+ },
100
+ ],
101
+ }, { parent: this });
102
+ this.certificate = certificate;
103
+ this.bucket = bucket;
104
+ this.cloudfront = cloudfront;
105
+ this.registerOutputs();
106
+ }
107
+ }
108
+ exports.StaticSite = StaticSite;
@@ -0,0 +1,86 @@
1
+ import * as pulumi from '@pulumi/pulumi';
2
+ import * as aws from '@pulumi/aws';
3
+ import * as awsx from '@pulumi/awsx';
4
+ import { Size } from './types';
5
+ import { AcmCertificate } from './acm-certificate';
6
+ export type RoleInlinePolicy = {
7
+ /**
8
+ * Name of the role policy.
9
+ */
10
+ name?: pulumi.Input<string>;
11
+ /**
12
+ * Policy document as a JSON formatted string.
13
+ */
14
+ policy?: pulumi.Input<string>;
15
+ };
16
+ export type WebServerArgs = {
17
+ /**
18
+ * The ECR image used to start a container.
19
+ */
20
+ image: pulumi.Input<string>;
21
+ /**
22
+ * Exposed service port.
23
+ */
24
+ port: pulumi.Input<number>;
25
+ /**
26
+ * The domain which will be used to access the service.
27
+ * The domain or subdomain must belong to the provided hostedZone.
28
+ */
29
+ domain: pulumi.Input<string>;
30
+ /**
31
+ * The aws.ecs.Cluster resource.
32
+ */
33
+ cluster: aws.ecs.Cluster;
34
+ /**
35
+ * The ID of the hosted zone.
36
+ */
37
+ hostedZoneId: pulumi.Input<string>;
38
+ /**
39
+ * The awsx.ec2.Vpc resource.
40
+ */
41
+ vpc: awsx.ec2.Vpc;
42
+ /**
43
+ * Number of instances of the task definition to place and keep running. Defaults to 1.
44
+ */
45
+ desiredCount?: pulumi.Input<number>;
46
+ /**
47
+ * Min capacity of the scalable target. Defaults to 1.
48
+ */
49
+ minCount?: pulumi.Input<number>;
50
+ /**
51
+ * Max capacity of the scalable target. Defaults to 10.
52
+ */
53
+ maxCount?: pulumi.Input<number>;
54
+ /**
55
+ * CPU and memory size used for running the container. Defaults to "small".
56
+ * Available predefined options are:
57
+ * - small (0.25 vCPU, 0.5 GB memory)
58
+ * - medium (0.5 vCPU, 1 GB memory)
59
+ * - large (1 vCPU memory, 2 GB memory)
60
+ * - xlarge (2 vCPU, 4 GB memory)
61
+ */
62
+ size?: pulumi.Input<Size>;
63
+ /**
64
+ * The environment variables to pass to a container. Defaults to [].
65
+ */
66
+ environment?: aws.ecs.KeyValuePair[];
67
+ /**
68
+ * Path for the health check request. Defaults to "/healtcheck".
69
+ */
70
+ healtCheckPath?: pulumi.Input<string>;
71
+ taskExecutionRoleInlinePolicies?: pulumi.Input<pulumi.Input<RoleInlinePolicy>[]>;
72
+ taskRoleInlinePolicies?: pulumi.Input<pulumi.Input<RoleInlinePolicy>[]>;
73
+ };
74
+ export declare class WebServer extends pulumi.ComponentResource {
75
+ certificate: AcmCertificate;
76
+ logGroup: aws.cloudwatch.LogGroup;
77
+ lbSecurityGroup: aws.ec2.SecurityGroup;
78
+ lb: aws.lb.LoadBalancer;
79
+ lbTargetGroup: aws.lb.TargetGroup;
80
+ lbHttpListener: aws.lb.Listener;
81
+ lbTlsListener: aws.lb.Listener;
82
+ serviceSecurityGroup: aws.ec2.SecurityGroup;
83
+ taskDefinition: aws.ecs.TaskDefinition;
84
+ service: aws.ecs.Service;
85
+ constructor(name: string, args: WebServerArgs, opts?: pulumi.ComponentResourceOptions);
86
+ }
@@ -0,0 +1,304 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebServer = void 0;
4
+ const pulumi = require("@pulumi/pulumi");
5
+ const aws = require("@pulumi/aws");
6
+ const constants_1 = require("../constants");
7
+ const acm_certificate_1 = require("./acm-certificate");
8
+ const config = new pulumi.Config('aws');
9
+ const awsRegion = config.require('region');
10
+ const assumeRolePolicy = {
11
+ Version: '2012-10-17',
12
+ Statement: [
13
+ {
14
+ Action: 'sts:AssumeRole',
15
+ Principal: {
16
+ Service: 'ecs-tasks.amazonaws.com',
17
+ },
18
+ Effect: 'Allow',
19
+ Sid: '',
20
+ },
21
+ ],
22
+ };
23
+ const defaults = {
24
+ desiredCount: 1,
25
+ minCount: 1,
26
+ maxCount: 10,
27
+ size: 'small',
28
+ environment: [],
29
+ healtCheckPath: '/healtcheck',
30
+ taskExecutionRoleInlinePolicies: [],
31
+ taskRoleInlinePolicies: [],
32
+ };
33
+ class WebServer extends pulumi.ComponentResource {
34
+ constructor(name, args, opts = {}) {
35
+ super('studion:WebServer', name, {}, opts);
36
+ const argsWithDefaults = Object.assign({}, defaults, args);
37
+ this.certificate = new acm_certificate_1.AcmCertificate(`${argsWithDefaults.domain}-acm-certificate`, {
38
+ domain: argsWithDefaults.domain,
39
+ hostedZoneId: argsWithDefaults.hostedZoneId,
40
+ }, { parent: this });
41
+ this.logGroup = new aws.cloudwatch.LogGroup(`${name}-log-group`, {
42
+ retentionInDays: 14,
43
+ name: `/ecs/${name}`,
44
+ }, { parent: this });
45
+ this.lbSecurityGroup = new aws.ec2.SecurityGroup(`${name}-lb-security-group`, {
46
+ vpcId: argsWithDefaults.vpc.vpcId,
47
+ ingress: [
48
+ {
49
+ protocol: 'tcp',
50
+ fromPort: 80,
51
+ toPort: 80,
52
+ cidrBlocks: ['0.0.0.0/0'],
53
+ },
54
+ {
55
+ protocol: 'tcp',
56
+ fromPort: 443,
57
+ toPort: 443,
58
+ cidrBlocks: ['0.0.0.0/0'],
59
+ },
60
+ ],
61
+ egress: [
62
+ {
63
+ fromPort: 0,
64
+ toPort: 0,
65
+ protocol: '-1',
66
+ cidrBlocks: ['0.0.0.0/0'],
67
+ },
68
+ ],
69
+ }, { parent: this });
70
+ this.lb = new aws.lb.LoadBalancer(`${name}-lb`, {
71
+ name: `${name}-lb`,
72
+ loadBalancerType: 'application',
73
+ subnets: argsWithDefaults.vpc.publicSubnetIds,
74
+ securityGroups: [this.lbSecurityGroup.id],
75
+ internal: false,
76
+ ipAddressType: 'ipv4',
77
+ }, { parent: this });
78
+ this.lbTargetGroup = new aws.lb.TargetGroup(`${name}-lb-tg`, {
79
+ name: `${name}-lb-tg`,
80
+ port: argsWithDefaults.port,
81
+ protocol: 'HTTP',
82
+ targetType: 'ip',
83
+ vpcId: argsWithDefaults.vpc.vpcId,
84
+ healthCheck: {
85
+ healthyThreshold: 3,
86
+ unhealthyThreshold: 2,
87
+ interval: 60,
88
+ timeout: 5,
89
+ path: argsWithDefaults.healtCheckPath,
90
+ },
91
+ }, { parent: this, dependsOn: [this.lb] });
92
+ this.lbHttpListener = new aws.lb.Listener(`${name}-lb-listener-80`, {
93
+ loadBalancerArn: this.lb.arn,
94
+ port: 80,
95
+ defaultActions: [
96
+ {
97
+ type: 'redirect',
98
+ redirect: {
99
+ port: '443',
100
+ protocol: 'HTTPS',
101
+ statusCode: 'HTTP_301',
102
+ },
103
+ },
104
+ ],
105
+ }, { parent: this });
106
+ this.lbTlsListener = new aws.lb.Listener(`${name}-lb-listener-443`, {
107
+ loadBalancerArn: this.lb.arn,
108
+ port: 443,
109
+ protocol: 'HTTPS',
110
+ sslPolicy: 'ELBSecurityPolicy-2016-08',
111
+ certificateArn: this.certificate.certificate.arn,
112
+ defaultActions: [
113
+ {
114
+ type: 'forward',
115
+ targetGroupArn: this.lbTargetGroup.arn,
116
+ },
117
+ ],
118
+ }, { parent: this });
119
+ const albAliasRecord = new aws.route53.Record(`${name}-route53-record`, {
120
+ type: 'A',
121
+ name: argsWithDefaults.domain,
122
+ zoneId: argsWithDefaults.hostedZoneId,
123
+ aliases: [
124
+ {
125
+ name: this.lb.dnsName,
126
+ zoneId: this.lb.zoneId,
127
+ evaluateTargetHealth: true,
128
+ },
129
+ ],
130
+ }, { parent: this });
131
+ const taskExecutionRole = new aws.iam.Role(`${name}-ecs-task-exec-role`, {
132
+ name: `${name}-ecs-task-exec-role`,
133
+ assumeRolePolicy,
134
+ managedPolicyArns: [
135
+ 'arn:aws:iam::aws:policy/CloudWatchFullAccess',
136
+ 'arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryFullAccess',
137
+ ],
138
+ inlinePolicies: argsWithDefaults.taskExecutionRoleInlinePolicies,
139
+ }, { parent: this });
140
+ const execCmdInlinePolicy = {
141
+ name: 'ecs-exec',
142
+ policy: JSON.stringify({
143
+ Version: '2012-10-17',
144
+ Statement: [
145
+ {
146
+ Sid: 'AllowContainerToCreateECSExecSSMChannel',
147
+ Effect: 'Allow',
148
+ Action: [
149
+ 'ssmmessages:CreateControlChannel',
150
+ 'ssmmessages:CreateDataChannel',
151
+ 'ssmmessages:OpenControlChannel',
152
+ 'ssmmessages:OpenDataChannel',
153
+ ],
154
+ Resource: '*',
155
+ },
156
+ ],
157
+ }),
158
+ };
159
+ const taskRole = new aws.iam.Role(`${name}-ecs-task-role`, {
160
+ name: `${name}-ecs-task-role`,
161
+ assumeRolePolicy,
162
+ inlinePolicies: [
163
+ execCmdInlinePolicy,
164
+ ...argsWithDefaults.taskRoleInlinePolicies,
165
+ ],
166
+ }, { parent: this });
167
+ const parsedSize = pulumi.all([argsWithDefaults.size]).apply(([size]) => {
168
+ const mapCapabilities = ({ cpu, memory }) => ({
169
+ cpu: String(cpu),
170
+ memory: String(memory),
171
+ });
172
+ if (typeof size === 'string') {
173
+ return mapCapabilities(constants_1.PredefinedSize[size]);
174
+ }
175
+ if (typeof size === 'object') {
176
+ return mapCapabilities(size);
177
+ }
178
+ throw Error('Incorrect EcsService size argument');
179
+ });
180
+ this.taskDefinition = new aws.ecs.TaskDefinition(`${name}-task-definition`, {
181
+ family: `${name}-task-definition`,
182
+ networkMode: 'awsvpc',
183
+ executionRoleArn: taskExecutionRole.arn,
184
+ taskRoleArn: taskRole.arn,
185
+ cpu: parsedSize.cpu,
186
+ memory: parsedSize.memory,
187
+ requiresCompatibilities: ['FARGATE'],
188
+ containerDefinitions: pulumi
189
+ .all([
190
+ name,
191
+ argsWithDefaults.image,
192
+ argsWithDefaults.port,
193
+ argsWithDefaults.environment,
194
+ this.logGroup.name,
195
+ awsRegion,
196
+ ])
197
+ .apply(([containerName, image, port, environment, logGroup, region]) => {
198
+ return JSON.stringify([
199
+ {
200
+ readonlyRootFilesystem: true,
201
+ name: containerName,
202
+ image,
203
+ essential: true,
204
+ portMappings: [
205
+ {
206
+ containerPort: port,
207
+ protocol: 'tcp',
208
+ },
209
+ ],
210
+ logConfiguration: {
211
+ logDriver: 'awslogs',
212
+ options: {
213
+ 'awslogs-group': logGroup,
214
+ 'awslogs-region': region,
215
+ 'awslogs-stream-prefix': 'ecs',
216
+ },
217
+ },
218
+ environment,
219
+ },
220
+ ]);
221
+ }),
222
+ }, { parent: this });
223
+ this.serviceSecurityGroup = new aws.ec2.SecurityGroup(`${name}-security-group`, {
224
+ vpcId: argsWithDefaults.vpc.vpcId,
225
+ ingress: [
226
+ {
227
+ fromPort: 0,
228
+ toPort: 0,
229
+ protocol: '-1',
230
+ securityGroups: [this.lbSecurityGroup.id],
231
+ },
232
+ ],
233
+ egress: [
234
+ {
235
+ fromPort: 0,
236
+ toPort: 0,
237
+ protocol: '-1',
238
+ cidrBlocks: ['0.0.0.0/0'],
239
+ },
240
+ ],
241
+ }, { parent: this });
242
+ this.service = new aws.ecs.Service(`${name}-service`, {
243
+ name,
244
+ cluster: argsWithDefaults.cluster.id,
245
+ launchType: 'FARGATE',
246
+ desiredCount: argsWithDefaults.desiredCount,
247
+ taskDefinition: this.taskDefinition.arn,
248
+ enableExecuteCommand: true,
249
+ loadBalancers: [
250
+ {
251
+ containerName: name,
252
+ containerPort: argsWithDefaults.port,
253
+ targetGroupArn: this.lbTargetGroup.arn,
254
+ },
255
+ ],
256
+ networkConfiguration: {
257
+ assignPublicIp: true,
258
+ subnets: argsWithDefaults.vpc.publicSubnetIds,
259
+ securityGroups: [this.serviceSecurityGroup.id],
260
+ },
261
+ }, {
262
+ parent: this,
263
+ dependsOn: [
264
+ this.lb,
265
+ this.lbTargetGroup,
266
+ this.lbHttpListener,
267
+ this.lbTlsListener,
268
+ ],
269
+ });
270
+ const autoscalingTarget = new aws.appautoscaling.Target(`${name}-autoscale-target`, {
271
+ minCapacity: argsWithDefaults.minCount,
272
+ maxCapacity: argsWithDefaults.maxCount,
273
+ resourceId: pulumi.interpolate `service/${argsWithDefaults.cluster.name}/${this.service.name}`,
274
+ serviceNamespace: 'ecs',
275
+ scalableDimension: 'ecs:service:DesiredCount',
276
+ }, { parent: this });
277
+ const memoryAutoscalingPolicy = new aws.appautoscaling.Policy(`${name}-memory-autoscale-policy`, {
278
+ policyType: 'TargetTrackingScaling',
279
+ resourceId: autoscalingTarget.resourceId,
280
+ scalableDimension: autoscalingTarget.scalableDimension,
281
+ serviceNamespace: autoscalingTarget.serviceNamespace,
282
+ targetTrackingScalingPolicyConfiguration: {
283
+ predefinedMetricSpecification: {
284
+ predefinedMetricType: 'ECSServiceAverageMemoryUtilization',
285
+ },
286
+ targetValue: 80,
287
+ },
288
+ }, { parent: this });
289
+ const cpuAutoscalingPolicy = new aws.appautoscaling.Policy(`${name}-cpu-autoscale-policy`, {
290
+ policyType: 'TargetTrackingScaling',
291
+ resourceId: autoscalingTarget.resourceId,
292
+ scalableDimension: autoscalingTarget.scalableDimension,
293
+ serviceNamespace: autoscalingTarget.serviceNamespace,
294
+ targetTrackingScalingPolicyConfiguration: {
295
+ predefinedMetricSpecification: {
296
+ predefinedMetricType: 'ECSServiceAverageCPUUtilization',
297
+ },
298
+ targetValue: 60,
299
+ },
300
+ }, { parent: this });
301
+ this.registerOutputs();
302
+ }
303
+ }
304
+ exports.WebServer = WebServer;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- export * from './components/ecs';
2
- export * from './components/rds';
1
+ export * from './components/web-server';
2
+ export * from './components/static-site';
3
+ export * from './components/database';
3
4
  export * from './components/redis';
4
5
  export * from './components/project';
6
+ export * from './components/ec2-ssm-connect';
package/dist/index.js CHANGED
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./components/ecs"), exports);
18
- __exportStar(require("./components/rds"), exports);
17
+ __exportStar(require("./components/web-server"), exports);
18
+ __exportStar(require("./components/static-site"), exports);
19
+ __exportStar(require("./components/database"), exports);
19
20
  __exportStar(require("./components/redis"), exports);
20
21
  __exportStar(require("./components/project"), exports);
22
+ __exportStar(require("./components/ec2-ssm-connect"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studion/infra-code-blocks",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Studion common infra components",
5
5
  "keywords": [
6
6
  "infrastructure",
@@ -24,10 +24,10 @@
24
24
  "dist"
25
25
  ],
26
26
  "scripts": {
27
- "build": "npm run clean && tsc",
28
27
  "clean": "rm -rf dist",
28
+ "build": "npm run clean && tsc",
29
29
  "format": "prettier -w .",
30
- "release": "release-it",
30
+ "release": "npm run build && release-it",
31
31
  "test": ""
32
32
  },
33
33
  "prettier": "@studion/prettier-config",
@@ -1,33 +0,0 @@
1
- import * as pulumi from '@pulumi/pulumi';
2
- import * as aws from '@pulumi/aws';
3
- import { Size } from './types';
4
- export type RoleInlinePolicy = {
5
- /**
6
- * Name of the role policy.
7
- */
8
- name?: pulumi.Input<string>;
9
- /**
10
- * Policy document as a JSON formatted string.
11
- */
12
- policy?: pulumi.Input<string>;
13
- };
14
- export type EcsServiceArgs = {
15
- image: pulumi.Input<string>;
16
- port: pulumi.Input<number>;
17
- cluster: aws.ecs.Cluster;
18
- subnets: pulumi.Input<pulumi.Input<string>[]>;
19
- securityGroupIds: pulumi.Input<pulumi.Input<string>[]>;
20
- lb: aws.lb.LoadBalancer;
21
- lbTargetGroup: aws.lb.TargetGroup;
22
- lbListener: aws.lb.Listener;
23
- desiredCount?: pulumi.Input<number>;
24
- minCount?: pulumi.Input<number>;
25
- maxCount?: pulumi.Input<number>;
26
- size?: pulumi.Input<Size>;
27
- environment?: aws.ecs.KeyValuePair[];
28
- taskExecutionRoleInlinePolicies?: pulumi.Input<pulumi.Input<RoleInlinePolicy>[]>;
29
- taskRoleInlinePolicies?: pulumi.Input<pulumi.Input<RoleInlinePolicy>[]>;
30
- };
31
- export declare class EcsService extends pulumi.ComponentResource {
32
- constructor(name: string, args: EcsServiceArgs, opts?: pulumi.ComponentResourceOptions);
33
- }