@studion/infra-code-blocks 0.0.2 → 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.
- package/README.md +90 -7
- package/dist/components/acm-certificate.d.ts +10 -0
- package/dist/components/acm-certificate.js +29 -0
- package/dist/components/database.d.ts +48 -0
- package/dist/components/database.js +64 -0
- package/dist/components/ec2-ssm-connect.d.ts +16 -0
- package/dist/components/ec2-ssm-connect.js +104 -0
- package/dist/components/project.d.ts +24 -15
- package/dist/components/project.js +42 -111
- package/dist/components/redis.d.ts +7 -2
- package/dist/components/redis.js +7 -3
- package/dist/components/static-site.d.ts +20 -0
- package/dist/components/static-site.js +108 -0
- package/dist/components/web-server.d.ts +86 -0
- package/dist/components/web-server.js +304 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/package.json +3 -3
- package/dist/components/ecs.d.ts +0 -33
- package/dist/components/ecs.js +0 -154
- package/dist/components/rds.d.ts +0 -20
- package/dist/components/rds.js +0 -42
|
@@ -11,30 +11,41 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Project = void 0;
|
|
14
|
+
exports.Project = exports.MissingHostedZoneId = void 0;
|
|
15
15
|
const pulumi = require("@pulumi/pulumi");
|
|
16
16
|
const aws = require("@pulumi/aws");
|
|
17
17
|
const awsx = require("@pulumi/awsx");
|
|
18
18
|
const upstash = require("@upstash/pulumi");
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
const database_1 = require("./database");
|
|
20
|
+
const web_server_1 = require("./web-server");
|
|
21
21
|
const redis_1 = require("./redis");
|
|
22
|
+
const static_site_1 = require("./static-site");
|
|
23
|
+
const ec2_ssm_connect_1 = require("./ec2-ssm-connect");
|
|
24
|
+
class MissingHostedZoneId extends Error {
|
|
25
|
+
constructor(serviceType) {
|
|
26
|
+
super(`Project::hostedZoneId argument must be provided
|
|
27
|
+
in order to create ${serviceType} service`);
|
|
28
|
+
this.name = this.constructor.name;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.MissingHostedZoneId = MissingHostedZoneId;
|
|
22
32
|
class Project extends pulumi.ComponentResource {
|
|
23
33
|
constructor(name, args, opts = {}) {
|
|
24
34
|
super('studion:Project', name, {}, opts);
|
|
25
|
-
this.dbSubnetGroup = null;
|
|
26
|
-
this.dbSecurityGroup = null;
|
|
27
|
-
this.cluster = null;
|
|
28
|
-
this.lbSecurityGroup = null;
|
|
29
|
-
this.lb = null;
|
|
30
|
-
this.ecsServiceSecurityGroup = null;
|
|
31
|
-
this.upstashProvider = null;
|
|
32
35
|
this.services = {};
|
|
33
|
-
const { services, environment } = args;
|
|
36
|
+
const { services, environment, hostedZoneId } = args;
|
|
34
37
|
this.name = name;
|
|
38
|
+
this.hostedZoneId = hostedZoneId;
|
|
35
39
|
this.environment = environment;
|
|
36
40
|
this.vpc = this.createVpc();
|
|
37
41
|
this.createServices(services);
|
|
42
|
+
if (args.enableSSMConnect) {
|
|
43
|
+
const sshConfig = new pulumi.Config('ssh');
|
|
44
|
+
this.ec2SSMConnect = new ec2_ssm_connect_1.Ec2SSMConnect(`${name}-ssm-connect`, {
|
|
45
|
+
vpc: this.vpc,
|
|
46
|
+
sshPublicKey: sshConfig.require('publicKey'),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
38
49
|
this.registerOutputs();
|
|
39
50
|
}
|
|
40
51
|
createVpc() {
|
|
@@ -46,11 +57,8 @@ class Project extends pulumi.ComponentResource {
|
|
|
46
57
|
return vpc;
|
|
47
58
|
}
|
|
48
59
|
createServices(services) {
|
|
49
|
-
const hasDatabaseService = services.some(it => it.type === 'DATABASE');
|
|
50
60
|
const hasRedisService = services.some(it => it.type === 'REDIS');
|
|
51
61
|
const hasWebServerService = services.some(it => it.type === 'WEB_SERVER');
|
|
52
|
-
if (hasDatabaseService)
|
|
53
|
-
this.createDatabasePrerequisites();
|
|
54
62
|
if (hasRedisService)
|
|
55
63
|
this.createRedisPrerequisites();
|
|
56
64
|
if (hasWebServerService)
|
|
@@ -60,26 +68,12 @@ class Project extends pulumi.ComponentResource {
|
|
|
60
68
|
this.createDatabaseService(it);
|
|
61
69
|
if (it.type === 'REDIS')
|
|
62
70
|
this.createRedisService(it);
|
|
71
|
+
if (it.type === 'STATIC_SITE')
|
|
72
|
+
this.createStaticSiteService(it);
|
|
63
73
|
if (it.type === 'WEB_SERVER')
|
|
64
74
|
this.createWebServerService(it);
|
|
65
75
|
});
|
|
66
76
|
}
|
|
67
|
-
createDatabasePrerequisites() {
|
|
68
|
-
this.dbSubnetGroup = new aws.rds.SubnetGroup('db-subnet-group', {
|
|
69
|
-
subnetIds: this.vpc.privateSubnetIds,
|
|
70
|
-
}, { parent: this });
|
|
71
|
-
this.dbSecurityGroup = new aws.ec2.SecurityGroup('db-security-group', {
|
|
72
|
-
vpcId: this.vpc.vpcId,
|
|
73
|
-
ingress: [
|
|
74
|
-
{
|
|
75
|
-
protocol: 'tcp',
|
|
76
|
-
fromPort: 5432,
|
|
77
|
-
toPort: 5432,
|
|
78
|
-
cidrBlocks: [this.vpc.vpc.cidrBlock],
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
}, { parent: this });
|
|
82
|
-
}
|
|
83
77
|
createRedisPrerequisites() {
|
|
84
78
|
const upstashConfig = new pulumi.Config('upstash');
|
|
85
79
|
this.upstashProvider = new upstash.Provider('upstash', {
|
|
@@ -89,103 +83,40 @@ class Project extends pulumi.ComponentResource {
|
|
|
89
83
|
}
|
|
90
84
|
createWebServerPrerequisites() {
|
|
91
85
|
this.cluster = new aws.ecs.Cluster(`${this.name}-cluster`, { name: this.name }, { parent: this });
|
|
92
|
-
this.lbSecurityGroup = new aws.ec2.SecurityGroup('ecs-lb-security-group', {
|
|
93
|
-
vpcId: this.vpc.vpcId,
|
|
94
|
-
ingress: [
|
|
95
|
-
{
|
|
96
|
-
fromPort: 80,
|
|
97
|
-
toPort: 80,
|
|
98
|
-
protocol: 'tcp',
|
|
99
|
-
cidrBlocks: ['0.0.0.0/0'],
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
egress: [
|
|
103
|
-
{
|
|
104
|
-
fromPort: 0,
|
|
105
|
-
toPort: 0,
|
|
106
|
-
protocol: '-1',
|
|
107
|
-
cidrBlocks: ['0.0.0.0/0'],
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
}, { parent: this });
|
|
111
|
-
this.lb = new aws.lb.LoadBalancer('ecs-load-balancer', {
|
|
112
|
-
loadBalancerType: 'application',
|
|
113
|
-
subnets: this.vpc.publicSubnetIds,
|
|
114
|
-
securityGroups: [this.lbSecurityGroup.id],
|
|
115
|
-
internal: false,
|
|
116
|
-
ipAddressType: 'ipv4',
|
|
117
|
-
}, { parent: this });
|
|
118
|
-
this.ecsServiceSecurityGroup = new aws.ec2.SecurityGroup('ecs-service-security-group', {
|
|
119
|
-
vpcId: this.vpc.vpcId,
|
|
120
|
-
ingress: [
|
|
121
|
-
{
|
|
122
|
-
fromPort: 0,
|
|
123
|
-
toPort: 0,
|
|
124
|
-
protocol: '-1',
|
|
125
|
-
securityGroups: [this.lbSecurityGroup.id],
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
egress: [
|
|
129
|
-
{
|
|
130
|
-
fromPort: 0,
|
|
131
|
-
toPort: 0,
|
|
132
|
-
protocol: '-1',
|
|
133
|
-
cidrBlocks: ['0.0.0.0/0'],
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
}, { parent: this });
|
|
137
86
|
}
|
|
138
87
|
createDatabaseService(options) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const instance = new rds_1.Rds(serviceName, Object.assign(Object.assign({}, rdsOptions), { subnetGroupName: this.dbSubnetGroup.name, securityGroupIds: [this.dbSecurityGroup.id] }), { parent: this });
|
|
143
|
-
this.services[serviceName] = instance;
|
|
88
|
+
const { serviceName, type } = options, databaseOptions = __rest(options, ["serviceName", "type"]);
|
|
89
|
+
const service = new database_1.Database(serviceName, Object.assign(Object.assign({}, databaseOptions), { vpc: this.vpc }), { parent: this });
|
|
90
|
+
this.services[serviceName] = service;
|
|
144
91
|
}
|
|
145
92
|
createRedisService(options) {
|
|
146
93
|
if (!this.upstashProvider)
|
|
147
94
|
return;
|
|
148
95
|
const { serviceName } = options, redisOptions = __rest(options, ["serviceName"]);
|
|
149
|
-
const
|
|
96
|
+
const service = new redis_1.Redis(serviceName, redisOptions, {
|
|
150
97
|
parent: this,
|
|
151
98
|
provider: this.upstashProvider,
|
|
152
99
|
});
|
|
153
|
-
this.services[options.serviceName] =
|
|
100
|
+
this.services[options.serviceName] = service;
|
|
101
|
+
}
|
|
102
|
+
createStaticSiteService(options) {
|
|
103
|
+
const { serviceName } = options, staticSiteOptions = __rest(options, ["serviceName"]);
|
|
104
|
+
if (!this.hostedZoneId)
|
|
105
|
+
throw new MissingHostedZoneId(options.type);
|
|
106
|
+
const service = new static_site_1.StaticSite(serviceName, Object.assign(Object.assign({}, staticSiteOptions), { hostedZoneId: this.hostedZoneId }), { parent: this });
|
|
107
|
+
this.services[serviceName] = service;
|
|
154
108
|
}
|
|
155
109
|
createWebServerService(options) {
|
|
156
|
-
if (!this.cluster
|
|
110
|
+
if (!this.cluster)
|
|
157
111
|
return;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
port: ecsOptions.port,
|
|
162
|
-
protocol: 'HTTP',
|
|
163
|
-
targetType: 'ip',
|
|
164
|
-
vpcId: this.vpc.vpcId,
|
|
165
|
-
healthCheck: {
|
|
166
|
-
healthyThreshold: 3,
|
|
167
|
-
unhealthyThreshold: 2,
|
|
168
|
-
interval: 60,
|
|
169
|
-
timeout: 5,
|
|
170
|
-
path: healtCheckPath,
|
|
171
|
-
},
|
|
172
|
-
}, { parent: this, dependsOn: [this.lb] });
|
|
173
|
-
const lbListener = new aws.lb.Listener(`${serviceName}-lb-listener`, {
|
|
174
|
-
loadBalancerArn: this.lb.arn,
|
|
175
|
-
port: 80,
|
|
176
|
-
defaultActions: [
|
|
177
|
-
{
|
|
178
|
-
type: 'forward',
|
|
179
|
-
targetGroupArn: lbTargetGroup.arn,
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
}, { parent: this, dependsOn: [this.lb, lbTargetGroup] });
|
|
112
|
+
if (!this.hostedZoneId)
|
|
113
|
+
throw new MissingHostedZoneId(options.type);
|
|
114
|
+
const { serviceName, environment } = options, ecsOptions = __rest(options, ["serviceName", "environment"]);
|
|
183
115
|
const parsedEnv = typeof environment === 'function'
|
|
184
116
|
? environment(this.services)
|
|
185
117
|
: environment;
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
this.services[options.serviceName] = instance;
|
|
118
|
+
const service = new web_server_1.WebServer(serviceName, Object.assign(Object.assign({}, ecsOptions), { cluster: this.cluster, vpc: this.vpc, hostedZoneId: this.hostedZoneId, environment: parsedEnv }), { parent: this });
|
|
119
|
+
this.services[options.serviceName] = service;
|
|
189
120
|
}
|
|
190
121
|
}
|
|
191
122
|
exports.Project = Project;
|
|
@@ -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:
|
|
17
|
+
instance: upstash.RedisDatabase;
|
|
13
18
|
constructor(name: string, args: RedisArgs, opts: RedisOptions);
|
|
14
19
|
}
|
package/dist/components/redis.js
CHANGED
|
@@ -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:
|
|
11
|
+
super('studion:Redis', name, {}, opts);
|
|
12
|
+
const argsWithDefaults = Object.assign({}, defaults, args);
|
|
9
13
|
this.instance = new upstash.RedisDatabase(name, {
|
|
10
|
-
databaseName:
|
|
11
|
-
region:
|
|
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
|
+
}
|