@mstuercke/pulumi-modules 0.0.17 → 0.0.19
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/dist/auth0/Auth0.d.ts +1 -1
- package/dist/auth0/Auth0.js +9 -9
- package/dist/lambda/LambdaCronTrigger.d.ts +1 -1
- package/dist/lambda/LambdaCronTrigger.js +5 -5
- package/dist/lambda/NodeLambdaFunction.js +2 -2
- package/dist/mongodb/MongoDBCustomInstance.js +3 -3
- package/dist/rest/RestApi.d.ts +1 -1
- package/dist/rest/RestApi.js +17 -17
- package/dist/website/StaticWebsite.d.ts +1 -1
- package/dist/website/StaticWebsite.js +6 -6
- package/dist/websocket/WebsocketApi.d.ts +1 -1
- package/dist/websocket/WebsocketApi.js +14 -14
- package/package.json +1 -1
package/dist/auth0/Auth0.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export interface Auth0Args {
|
|
|
25
25
|
export declare class Auth0 extends ComponentResource {
|
|
26
26
|
domain: string;
|
|
27
27
|
clientId: Output<string>;
|
|
28
|
-
constructor(
|
|
28
|
+
constructor(name: string, args: Auth0Args, opts?: ComponentResourceOptions);
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=Auth0.d.ts.map
|
package/dist/auth0/Auth0.js
CHANGED
|
@@ -3,11 +3,11 @@ import { Client, ClientCredentials, Connection, ConnectionClient, Provider, Tena
|
|
|
3
3
|
export class Auth0 extends ComponentResource {
|
|
4
4
|
domain;
|
|
5
5
|
clientId;
|
|
6
|
-
constructor(
|
|
7
|
-
super('mstuercke:auth0:Auth0',
|
|
6
|
+
constructor(name, args, opts) {
|
|
7
|
+
super('mstuercke:auth0:Auth0', name, undefined, opts);
|
|
8
8
|
const { projectId, environmentName, tenantDisplayName, clientDisplayName, domain, m2mClientId, allowedUrls, allowedLoginCallbackUrls, allowedLogoutCallbackUrls, nativeAppId, defaultUsers = [], disableSignup = false, } = args;
|
|
9
9
|
new Provider('provider', {}, { parent: this });
|
|
10
|
-
new Tenant(
|
|
10
|
+
new Tenant(name, {
|
|
11
11
|
friendlyName: tenantDisplayName,
|
|
12
12
|
flags: {
|
|
13
13
|
enableClientConnections: false,
|
|
@@ -19,7 +19,7 @@ export class Auth0 extends ComponentResource {
|
|
|
19
19
|
`${nativeAppId}.auth0://${domain}/android/${nativeAppId}/callback`,
|
|
20
20
|
]
|
|
21
21
|
: [];
|
|
22
|
-
const client = new Client(
|
|
22
|
+
const client = new Client(name, {
|
|
23
23
|
name: clientDisplayName,
|
|
24
24
|
appType: 'spa',
|
|
25
25
|
callbacks: [...(allowedLoginCallbackUrls || allowedUrls), ...nativeAppCallbackUrls],
|
|
@@ -30,7 +30,7 @@ export class Auth0 extends ComponentResource {
|
|
|
30
30
|
},
|
|
31
31
|
addons: {},
|
|
32
32
|
}, { parent: this });
|
|
33
|
-
const connection = new Connection(
|
|
33
|
+
const connection = new Connection(name, {
|
|
34
34
|
name: `${projectId}-${environmentName}`,
|
|
35
35
|
strategy: 'auth0',
|
|
36
36
|
options: {
|
|
@@ -38,11 +38,11 @@ export class Auth0 extends ComponentResource {
|
|
|
38
38
|
bruteForceProtection: true,
|
|
39
39
|
},
|
|
40
40
|
}, { parent: this });
|
|
41
|
-
const m2mClientConnection = new ConnectionClient(
|
|
41
|
+
const m2mClientConnection = new ConnectionClient(`${name}-m2m`, {
|
|
42
42
|
clientId: m2mClientId,
|
|
43
43
|
connectionId: connection.id,
|
|
44
44
|
}, { parent: client });
|
|
45
|
-
const clientConnection = new ConnectionClient(
|
|
45
|
+
const clientConnection = new ConnectionClient(name, {
|
|
46
46
|
clientId: client.id,
|
|
47
47
|
connectionId: connection.id,
|
|
48
48
|
}, { parent: client });
|
|
@@ -50,14 +50,14 @@ export class Auth0 extends ComponentResource {
|
|
|
50
50
|
// // disable google-oauth2 on all clients
|
|
51
51
|
// const googleOauth2Connection = output(getConnection({name: 'google-oauth2'}))
|
|
52
52
|
// new ConnectionClients(
|
|
53
|
-
// 'google-oauth2-
|
|
53
|
+
// 'google-oauth2-client',
|
|
54
54
|
// {
|
|
55
55
|
// connectionId: googleOauth2Connection.id,
|
|
56
56
|
// enabledClients: [],
|
|
57
57
|
// },
|
|
58
58
|
// {parent: client, dependsOn: [client]},
|
|
59
59
|
// )
|
|
60
|
-
new ClientCredentials(
|
|
60
|
+
new ClientCredentials(name, {
|
|
61
61
|
clientId: client.id,
|
|
62
62
|
authenticationMethod: 'none',
|
|
63
63
|
}, { parent: this });
|
|
@@ -12,6 +12,6 @@ export type LambdaCronTriggerArgs = {
|
|
|
12
12
|
export declare class LambdaCronTrigger extends ComponentResource {
|
|
13
13
|
ruleName: string;
|
|
14
14
|
ruleArn: Output<string>;
|
|
15
|
-
constructor(args: LambdaCronTriggerArgs, opts?: ComponentResourceOptions);
|
|
15
|
+
constructor(resourceName: string, args: LambdaCronTriggerArgs, opts?: ComponentResourceOptions);
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=LambdaCronTrigger.d.ts.map
|
|
@@ -3,23 +3,23 @@ import { cloudwatch, lambda } from '@pulumi/aws';
|
|
|
3
3
|
export class LambdaCronTrigger extends ComponentResource {
|
|
4
4
|
ruleName;
|
|
5
5
|
ruleArn;
|
|
6
|
-
constructor(args, opts) {
|
|
7
|
-
super('mstuercke:lambda:LambdaCronTrigger',
|
|
6
|
+
constructor(resourceName, args, opts) {
|
|
7
|
+
super('mstuercke:lambda:LambdaCronTrigger', resourceName, undefined, opts);
|
|
8
8
|
const { name, lambdaFunction, cronExpression, lambdaExecutionInput, projectId } = args;
|
|
9
|
-
const trigger = new cloudwatch.EventRule(
|
|
9
|
+
const trigger = new cloudwatch.EventRule(resourceName, {
|
|
10
10
|
name,
|
|
11
11
|
scheduleExpression: cronExpression,
|
|
12
12
|
tags: {
|
|
13
13
|
project: projectId,
|
|
14
14
|
},
|
|
15
15
|
}, { parent: this });
|
|
16
|
-
new cloudwatch.EventTarget(
|
|
16
|
+
new cloudwatch.EventTarget(resourceName, {
|
|
17
17
|
targetId: lambdaFunction.name,
|
|
18
18
|
rule: trigger.name,
|
|
19
19
|
arn: lambdaFunction.arn,
|
|
20
20
|
input: JSON.stringify(lambdaExecutionInput),
|
|
21
21
|
}, { parent: this });
|
|
22
|
-
new lambda.Permission(
|
|
22
|
+
new lambda.Permission(resourceName, {
|
|
23
23
|
action: 'lambda:InvokeFunction',
|
|
24
24
|
principal: 'events.amazonaws.com',
|
|
25
25
|
function: lambdaFunction.name,
|
|
@@ -28,11 +28,11 @@ export class NodeLambdaFunction extends ComponentResource {
|
|
|
28
28
|
role.id.apply((roleId) => {
|
|
29
29
|
new SimpleIamRolePolicy(roleId, {
|
|
30
30
|
type: 'custom',
|
|
31
|
-
name:
|
|
31
|
+
name: `${name}-logging`,
|
|
32
32
|
statements: [
|
|
33
33
|
{
|
|
34
34
|
Effect: 'Allow',
|
|
35
|
-
Action: ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:
|
|
35
|
+
Action: ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'],
|
|
36
36
|
Resource: '*',
|
|
37
37
|
},
|
|
38
38
|
],
|
|
@@ -7,18 +7,18 @@ export class MongoDBCustomInstance extends ComponentResource {
|
|
|
7
7
|
constructor(name, args, opts) {
|
|
8
8
|
const { organizationId, projectId, environmentName } = args;
|
|
9
9
|
super('mstuercke:mongodb:MongoDBCustomInstance', name, undefined, opts);
|
|
10
|
-
const mongoProject = new Project(
|
|
10
|
+
const mongoProject = new Project(name, {
|
|
11
11
|
orgId: organizationId,
|
|
12
12
|
name: `${projectId}-${environmentName}`,
|
|
13
13
|
tags: {
|
|
14
14
|
project: projectId,
|
|
15
15
|
},
|
|
16
16
|
}, { parent: this });
|
|
17
|
-
new ProjectIpAccessList(
|
|
17
|
+
new ProjectIpAccessList(name, {
|
|
18
18
|
projectId: mongoProject.id,
|
|
19
19
|
cidrBlock: '0.0.0.0/0',
|
|
20
20
|
}, { parent: this });
|
|
21
|
-
const mongoInstance = new ServerlessInstance(
|
|
21
|
+
const mongoInstance = new ServerlessInstance(name, {
|
|
22
22
|
projectId: mongoProject.id,
|
|
23
23
|
name: `${projectId}-${environmentName}`,
|
|
24
24
|
providerSettingsBackingProviderName: 'AWS',
|
package/dist/rest/RestApi.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ export interface RestApiArgs {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class RestApi extends aws.apigateway.RestApi {
|
|
17
17
|
readonly url: string;
|
|
18
|
-
constructor(
|
|
18
|
+
constructor(resourceName: string, args: RestApiArgs, opts?: ComponentResourceOptions);
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=RestApi.d.ts.map
|
package/dist/rest/RestApi.js
CHANGED
|
@@ -4,27 +4,27 @@ import { Record } from '@pulumi/aws/route53';
|
|
|
4
4
|
import { BasePathMapping, DomainName } from '@pulumi/aws/apigateway';
|
|
5
5
|
export class RestApi extends aws.apigateway.RestApi {
|
|
6
6
|
url;
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(resourceName, args, opts) {
|
|
8
8
|
const { name, projectId, stageName = 'v1', domain } = args;
|
|
9
|
-
super(
|
|
9
|
+
super(resourceName, {
|
|
10
10
|
name,
|
|
11
11
|
tags: {
|
|
12
12
|
project: projectId,
|
|
13
13
|
},
|
|
14
14
|
}, opts);
|
|
15
15
|
const { lambdaFunction, timeoutSeconds = 29 } = args;
|
|
16
|
-
const proxyResource = new apigateway.Resource(
|
|
16
|
+
const proxyResource = new apigateway.Resource(`${resourceName}-proxy`, {
|
|
17
17
|
restApi: this.id,
|
|
18
18
|
parentId: this.rootResourceId,
|
|
19
19
|
pathPart: '{proxy+}',
|
|
20
20
|
}, { parent: this });
|
|
21
|
-
const proxyMethod = new apigateway.Method(
|
|
21
|
+
const proxyMethod = new apigateway.Method(`${resourceName}-proxy`, {
|
|
22
22
|
restApi: this.id,
|
|
23
23
|
resourceId: proxyResource.id,
|
|
24
24
|
httpMethod: 'ANY',
|
|
25
25
|
authorization: 'NONE',
|
|
26
26
|
}, { parent: proxyResource });
|
|
27
|
-
const lambdaIntegration = new apigateway.Integration(
|
|
27
|
+
const lambdaIntegration = new apigateway.Integration(`${resourceName}-proxy`, {
|
|
28
28
|
restApi: this.id,
|
|
29
29
|
resourceId: proxyResource.id,
|
|
30
30
|
httpMethod: proxyMethod.httpMethod,
|
|
@@ -33,13 +33,13 @@ export class RestApi extends aws.apigateway.RestApi {
|
|
|
33
33
|
uri: lambdaFunction.invokeArn,
|
|
34
34
|
timeoutMilliseconds: timeoutSeconds * 1000,
|
|
35
35
|
}, { parent: proxyMethod });
|
|
36
|
-
const proxyOptionsMethod = new apigateway.Method(
|
|
36
|
+
const proxyOptionsMethod = new apigateway.Method(`${resourceName}-options`, {
|
|
37
37
|
restApi: this.id,
|
|
38
38
|
resourceId: proxyResource.id,
|
|
39
39
|
httpMethod: 'OPTIONS',
|
|
40
40
|
authorization: 'NONE',
|
|
41
41
|
}, { parent: proxyResource });
|
|
42
|
-
const lambdaIntegrationOptions = new apigateway.Integration(
|
|
42
|
+
const lambdaIntegrationOptions = new apigateway.Integration(`${resourceName}-options`, {
|
|
43
43
|
restApi: this.id,
|
|
44
44
|
resourceId: proxyResource.id,
|
|
45
45
|
httpMethod: proxyOptionsMethod.httpMethod,
|
|
@@ -48,13 +48,13 @@ export class RestApi extends aws.apigateway.RestApi {
|
|
|
48
48
|
uri: lambdaFunction.invokeArn,
|
|
49
49
|
timeoutMilliseconds: timeoutSeconds * 1000,
|
|
50
50
|
}, { parent: proxyOptionsMethod });
|
|
51
|
-
const proxyRootMethod = new apigateway.Method(
|
|
51
|
+
const proxyRootMethod = new apigateway.Method(`${resourceName}-proxy-root`, {
|
|
52
52
|
restApi: this.id,
|
|
53
53
|
resourceId: this.rootResourceId,
|
|
54
54
|
httpMethod: 'ANY',
|
|
55
55
|
authorization: 'NONE',
|
|
56
56
|
}, { parent: this });
|
|
57
|
-
const lambdaRootIntegration = new apigateway.Integration(
|
|
57
|
+
const lambdaRootIntegration = new apigateway.Integration(`${resourceName}-proxy-root`, {
|
|
58
58
|
restApi: this.id,
|
|
59
59
|
resourceId: proxyRootMethod.resourceId,
|
|
60
60
|
httpMethod: proxyRootMethod.httpMethod,
|
|
@@ -63,13 +63,13 @@ export class RestApi extends aws.apigateway.RestApi {
|
|
|
63
63
|
uri: lambdaFunction.invokeArn,
|
|
64
64
|
timeoutMilliseconds: timeoutSeconds * 1000,
|
|
65
65
|
}, { parent: proxyRootMethod });
|
|
66
|
-
const proxyRootOptionsMethod = new apigateway.Method(
|
|
66
|
+
const proxyRootOptionsMethod = new apigateway.Method(`${resourceName}-proxy-root-options`, {
|
|
67
67
|
restApi: this.id,
|
|
68
68
|
resourceId: this.rootResourceId,
|
|
69
69
|
httpMethod: 'OPTIONS',
|
|
70
70
|
authorization: 'NONE',
|
|
71
71
|
}, { parent: this });
|
|
72
|
-
const lambdaRootIntegrationOptions = new apigateway.Integration(
|
|
72
|
+
const lambdaRootIntegrationOptions = new apigateway.Integration(`${resourceName}-proxy-root-options`, {
|
|
73
73
|
restApi: this.id,
|
|
74
74
|
resourceId: proxyRootOptionsMethod.resourceId,
|
|
75
75
|
httpMethod: proxyRootOptionsMethod.httpMethod,
|
|
@@ -78,14 +78,14 @@ export class RestApi extends aws.apigateway.RestApi {
|
|
|
78
78
|
uri: lambdaFunction.invokeArn,
|
|
79
79
|
timeoutMilliseconds: timeoutSeconds * 1000,
|
|
80
80
|
}, { parent: proxyRootOptionsMethod });
|
|
81
|
-
new lambda.Permission(
|
|
81
|
+
new lambda.Permission(resourceName, {
|
|
82
82
|
statementId: 'AllowRestApiInvoke',
|
|
83
83
|
action: 'lambda:InvokeFunction',
|
|
84
84
|
function: lambdaFunction.name,
|
|
85
85
|
principal: 'apigateway.amazonaws.com',
|
|
86
86
|
sourceArn: this.executionArn.apply((executionArn) => `${executionArn}/*`),
|
|
87
87
|
}, { parent: lambdaFunction });
|
|
88
|
-
const deployment = new apigateway.Deployment(stageName
|
|
88
|
+
const deployment = new apigateway.Deployment(`${resourceName}-${stageName}`, { restApi: this.id }, {
|
|
89
89
|
dependsOn: [
|
|
90
90
|
proxyMethod,
|
|
91
91
|
lambdaIntegration,
|
|
@@ -96,17 +96,17 @@ export class RestApi extends aws.apigateway.RestApi {
|
|
|
96
96
|
],
|
|
97
97
|
parent: this,
|
|
98
98
|
});
|
|
99
|
-
const stage = new apigateway.Stage(stageName
|
|
99
|
+
const stage = new apigateway.Stage(`${resourceName}-${stageName}`, {
|
|
100
100
|
restApi: this.id,
|
|
101
101
|
stageName: stageName,
|
|
102
102
|
deployment: deployment.id,
|
|
103
103
|
tags: { project: projectId },
|
|
104
104
|
}, { parent: deployment });
|
|
105
|
-
const domainName = new DomainName(
|
|
105
|
+
const domainName = new DomainName(resourceName, {
|
|
106
106
|
domainName: domain.fullName,
|
|
107
107
|
certificateArn: domain.usEast1CertificateArn,
|
|
108
108
|
}, { parent: this });
|
|
109
|
-
new Record(
|
|
109
|
+
new Record(resourceName, {
|
|
110
110
|
zoneId: domain.zoneId,
|
|
111
111
|
name: domain.fullName,
|
|
112
112
|
type: 'A',
|
|
@@ -119,7 +119,7 @@ export class RestApi extends aws.apigateway.RestApi {
|
|
|
119
119
|
],
|
|
120
120
|
allowOverwrite: true,
|
|
121
121
|
}, { parent: domainName });
|
|
122
|
-
new BasePathMapping(
|
|
122
|
+
new BasePathMapping(resourceName, {
|
|
123
123
|
restApi: this.id,
|
|
124
124
|
stageName: stage.stageName,
|
|
125
125
|
domainName: domainName.domainName,
|
|
@@ -13,6 +13,6 @@ export interface StaticWebsiteArgs {
|
|
|
13
13
|
export declare class StaticWebsite extends ComponentResource {
|
|
14
14
|
url: string;
|
|
15
15
|
bucket: PublicS3Bucket;
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(name: string, args: StaticWebsiteArgs, opts?: ComponentResourceOptions);
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=StaticWebsite.d.ts.map
|
|
@@ -7,10 +7,10 @@ import { readFilesRecursive } from "./readFilesRecursive.js";
|
|
|
7
7
|
export class StaticWebsite extends ComponentResource {
|
|
8
8
|
url;
|
|
9
9
|
bucket;
|
|
10
|
-
constructor(
|
|
11
|
-
super('mstuercke:website:StaticWebsite',
|
|
10
|
+
constructor(name, args, opts) {
|
|
11
|
+
super('mstuercke:website:StaticWebsite', name, undefined, opts);
|
|
12
12
|
const { projectId, environmentName, filesPath, customDomain } = args;
|
|
13
|
-
const bucket = new s3.PublicS3Bucket(
|
|
13
|
+
const bucket = new s3.PublicS3Bucket(name, {
|
|
14
14
|
name: `${projectId}-web-${environmentName}`,
|
|
15
15
|
allowPresignedPost: false,
|
|
16
16
|
tags: {
|
|
@@ -18,7 +18,7 @@ export class StaticWebsite extends ComponentResource {
|
|
|
18
18
|
},
|
|
19
19
|
}, { parent: this });
|
|
20
20
|
for (const file of readFilesRecursive(filesPath)) {
|
|
21
|
-
new BucketObject(file.relativePath
|
|
21
|
+
new BucketObject(`${name}-${file.relativePath}`, {
|
|
22
22
|
key: file.relativePath,
|
|
23
23
|
bucket: bucket.id,
|
|
24
24
|
source: file.absolutePath,
|
|
@@ -29,7 +29,7 @@ export class StaticWebsite extends ComponentResource {
|
|
|
29
29
|
},
|
|
30
30
|
}, { parent: bucket });
|
|
31
31
|
}
|
|
32
|
-
const cloudfront = new Distribution(
|
|
32
|
+
const cloudfront = new Distribution(name, {
|
|
33
33
|
enabled: true,
|
|
34
34
|
comment: `${projectId} (${environmentName})`,
|
|
35
35
|
defaultRootObject: 'index.html',
|
|
@@ -109,7 +109,7 @@ export class StaticWebsite extends ComponentResource {
|
|
|
109
109
|
},
|
|
110
110
|
}, { parent: this });
|
|
111
111
|
if (customDomain) {
|
|
112
|
-
new Record(
|
|
112
|
+
new Record(name, {
|
|
113
113
|
zoneId: customDomain?.zoneId,
|
|
114
114
|
name: customDomain?.fullName,
|
|
115
115
|
type: 'A',
|
|
@@ -18,6 +18,6 @@ export interface WebsocketApiArgs {
|
|
|
18
18
|
export declare class WebsocketApi extends ComponentResource {
|
|
19
19
|
id: Output<string>;
|
|
20
20
|
url: string;
|
|
21
|
-
constructor(
|
|
21
|
+
constructor(resourceName: string, args: WebsocketApiArgs, opts?: ComponentResourceOptions);
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=WebsocketApi.d.ts.map
|
|
@@ -5,10 +5,10 @@ import { Record } from '@pulumi/aws/route53';
|
|
|
5
5
|
export class WebsocketApi extends ComponentResource {
|
|
6
6
|
id;
|
|
7
7
|
url;
|
|
8
|
-
constructor(
|
|
9
|
-
super('mstuercke:websocket:WebsocketApi',
|
|
8
|
+
constructor(resourceName, args, opts) {
|
|
9
|
+
super('mstuercke:websocket:WebsocketApi', resourceName, undefined, opts);
|
|
10
10
|
const { name, lambdaFunction, routeThrottling, stageName = 'v1', domain, projectId } = args;
|
|
11
|
-
const api = new Api(
|
|
11
|
+
const api = new Api(resourceName, {
|
|
12
12
|
name,
|
|
13
13
|
protocolType: 'WEBSOCKET',
|
|
14
14
|
routeSelectionExpression: '\\$default',
|
|
@@ -16,7 +16,7 @@ export class WebsocketApi extends ComponentResource {
|
|
|
16
16
|
project: projectId,
|
|
17
17
|
},
|
|
18
18
|
}, { parent: this });
|
|
19
|
-
const executeLambdaPolicy = new Policy(
|
|
19
|
+
const executeLambdaPolicy = new Policy(resourceName, {
|
|
20
20
|
name: `${name}-execute-lambda`,
|
|
21
21
|
path: '/',
|
|
22
22
|
policy: {
|
|
@@ -33,7 +33,7 @@ export class WebsocketApi extends ComponentResource {
|
|
|
33
33
|
project: projectId,
|
|
34
34
|
},
|
|
35
35
|
}, { parent: api });
|
|
36
|
-
const wsApiRole = new Role(
|
|
36
|
+
const wsApiRole = new Role(resourceName, {
|
|
37
37
|
name: `${name}-role`,
|
|
38
38
|
assumeRolePolicy: JSON.stringify({
|
|
39
39
|
Version: '2012-10-17',
|
|
@@ -50,7 +50,7 @@ export class WebsocketApi extends ComponentResource {
|
|
|
50
50
|
},
|
|
51
51
|
managedPolicyArns: [executeLambdaPolicy.arn],
|
|
52
52
|
}, { parent: api });
|
|
53
|
-
const wsLambdaIntegration = new Integration(
|
|
53
|
+
const wsLambdaIntegration = new Integration(resourceName, {
|
|
54
54
|
apiId: api.id,
|
|
55
55
|
integrationType: 'AWS_PROXY',
|
|
56
56
|
integrationUri: lambdaFunction.invokeArn,
|
|
@@ -58,7 +58,7 @@ export class WebsocketApi extends ComponentResource {
|
|
|
58
58
|
contentHandlingStrategy: 'CONVERT_TO_TEXT',
|
|
59
59
|
passthroughBehavior: 'WHEN_NO_MATCH',
|
|
60
60
|
}, { parent: this });
|
|
61
|
-
new IntegrationResponse(
|
|
61
|
+
new IntegrationResponse(resourceName, {
|
|
62
62
|
apiId: api.id,
|
|
63
63
|
integrationId: wsLambdaIntegration.id,
|
|
64
64
|
integrationResponseKey: '/200/',
|
|
@@ -66,7 +66,7 @@ export class WebsocketApi extends ComponentResource {
|
|
|
66
66
|
const routes = [];
|
|
67
67
|
const routeKeys = ['$connect', '$default', '$disconnect'];
|
|
68
68
|
for (const routeKey of routeKeys) {
|
|
69
|
-
const route = new Route(`${routeKey}-route`, {
|
|
69
|
+
const route = new Route(`${resourceName}-${routeKey}-route`, {
|
|
70
70
|
apiId: api.id,
|
|
71
71
|
routeKey: routeKey,
|
|
72
72
|
target: wsLambdaIntegration.id.apply((id) => `integrations/${id}`),
|
|
@@ -74,13 +74,13 @@ export class WebsocketApi extends ComponentResource {
|
|
|
74
74
|
}, { parent: wsLambdaIntegration });
|
|
75
75
|
routes.push(route);
|
|
76
76
|
}
|
|
77
|
-
const deployment = new Deployment(
|
|
77
|
+
const deployment = new Deployment(resourceName, {
|
|
78
78
|
apiId: api.id,
|
|
79
79
|
}, {
|
|
80
80
|
dependsOn: [wsLambdaIntegration, ...routes],
|
|
81
81
|
parent: api,
|
|
82
82
|
});
|
|
83
|
-
const stage = new Stage(
|
|
83
|
+
const stage = new Stage(resourceName, {
|
|
84
84
|
apiId: api.id,
|
|
85
85
|
name: stageName,
|
|
86
86
|
deploymentId: deployment.id,
|
|
@@ -92,7 +92,7 @@ export class WebsocketApi extends ComponentResource {
|
|
|
92
92
|
project: projectId,
|
|
93
93
|
},
|
|
94
94
|
}, { parent: deployment });
|
|
95
|
-
const domainName = new DomainName(
|
|
95
|
+
const domainName = new DomainName(resourceName, {
|
|
96
96
|
domainName: domain.fullName,
|
|
97
97
|
domainNameConfiguration: {
|
|
98
98
|
certificateArn: domain.euCentral1CertificateArn,
|
|
@@ -100,7 +100,7 @@ export class WebsocketApi extends ComponentResource {
|
|
|
100
100
|
securityPolicy: 'TLS_1_2',
|
|
101
101
|
},
|
|
102
102
|
}, { parent: api });
|
|
103
|
-
new Record(
|
|
103
|
+
new Record(resourceName, {
|
|
104
104
|
zoneId: domain.zoneId,
|
|
105
105
|
name: domain.fullName,
|
|
106
106
|
type: 'A',
|
|
@@ -113,12 +113,12 @@ export class WebsocketApi extends ComponentResource {
|
|
|
113
113
|
],
|
|
114
114
|
allowOverwrite: true,
|
|
115
115
|
}, { parent: api });
|
|
116
|
-
new ApiMapping(
|
|
116
|
+
new ApiMapping(`${resourceName}-root`, {
|
|
117
117
|
apiId: api.id,
|
|
118
118
|
domainName: domainName.id,
|
|
119
119
|
stage: stage.name,
|
|
120
120
|
}, { parent: api });
|
|
121
|
-
new ApiMapping(
|
|
121
|
+
new ApiMapping(`${resourceName}-stage`, {
|
|
122
122
|
apiId: api.id,
|
|
123
123
|
domainName: domainName.id,
|
|
124
124
|
stage: stage.name,
|