@digitraffic/common 2023.2.13-1 → 2023.3.10-1
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/aws/infra/api/responses.d.ts +0 -4
- package/dist/aws/infra/api/responses.js +1 -15
- package/dist/aws/infra/stacks/db-dns-stack.d.ts +2 -0
- package/dist/aws/infra/stacks/db-dns-stack.js +2 -0
- package/dist/aws/infra/stacks/db-stack.d.ts +5 -0
- package/dist/aws/infra/stacks/db-stack.js +6 -0
- package/dist/types/urn.d.ts +1 -0
- package/dist/types/urn.js +3 -0
- package/package.json +1 -1
- package/src/aws/infra/api/responses.ts +0 -14
- package/src/aws/infra/stacks/db-dns-stack.ts +2 -0
- package/src/aws/infra/stacks/db-stack.ts +10 -0
- package/src/types/urn.ts +1 -0
@@ -19,10 +19,6 @@ export declare const RESPONSE_404_NOT_FOUND: {
|
|
19
19
|
* @deprecated Use DigitrafficMethodResponse
|
20
20
|
*/
|
21
21
|
export declare function methodResponse(status: string, contentType: MediaType, model: IModel, parameters?: Record<string, boolean>): MethodResponse;
|
22
|
-
/**
|
23
|
-
* @deprecated Use DigitrafficMethodResponse
|
24
|
-
*/
|
25
|
-
export declare function corsMethod(response: MethodResponse): MethodResponse;
|
26
22
|
interface IntegrationOptions {
|
27
23
|
requestParameters?: {
|
28
24
|
[dest: string]: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getResponse = exports.defaultIntegration = exports.
|
3
|
+
exports.getResponse = exports.defaultIntegration = exports.methodResponse = exports.RESPONSE_404_NOT_FOUND = exports.RESPONSE_CORS_INTEGRATION = exports.RESPONSE_500_SERVER_ERROR = exports.RESPONSE_400_BAD_REQUEST = exports.RESPONSE_200_OK = void 0;
|
4
4
|
const response_1 = require("./response");
|
5
5
|
const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
|
6
6
|
const errors_1 = require("../../types/errors");
|
@@ -41,20 +41,6 @@ function methodResponse(status, contentType, model, parameters) {
|
|
41
41
|
};
|
42
42
|
}
|
43
43
|
exports.methodResponse = methodResponse;
|
44
|
-
/**
|
45
|
-
* @deprecated Use DigitrafficMethodResponse
|
46
|
-
*/
|
47
|
-
function corsMethod(response) {
|
48
|
-
return {
|
49
|
-
...response,
|
50
|
-
...{
|
51
|
-
responseParameters: {
|
52
|
-
"method.response.header.Access-Control-Allow-Origin": true,
|
53
|
-
},
|
54
|
-
},
|
55
|
-
};
|
56
|
-
}
|
57
|
-
exports.corsMethod = corsMethod;
|
58
44
|
/**
|
59
45
|
* Creates a default Lambda integration for a REST API resource _root_
|
60
46
|
* @param lambdaFunction The Lambda function
|
@@ -4,6 +4,8 @@ import { InfraStackConfiguration } from "./intra-stack-configuration";
|
|
4
4
|
/**
|
5
5
|
* Creates a dns local zone and creates records for cluster endpoints and proxy endpoints.
|
6
6
|
*
|
7
|
+
* Please note, that created PrivateHostedZone has RETAIN removalPolicy, so if you want to delete this stack,
|
8
|
+
* you must remove the zone by hand after.
|
7
9
|
*/
|
8
10
|
export declare class DbDnsStack extends Stack {
|
9
11
|
constructor(scope: Construct, id: string, isc: InfraStackConfiguration);
|
@@ -10,6 +10,8 @@ const DEFAULT_RECORD_TTL = aws_cdk_lib_1.Duration.seconds(30);
|
|
10
10
|
/**
|
11
11
|
* Creates a dns local zone and creates records for cluster endpoints and proxy endpoints.
|
12
12
|
*
|
13
|
+
* Please note, that created PrivateHostedZone has RETAIN removalPolicy, so if you want to delete this stack,
|
14
|
+
* you must remove the zone by hand after.
|
13
15
|
*/
|
14
16
|
class DbDnsStack extends aws_cdk_lib_1.Stack {
|
15
17
|
constructor(scope, id, isc) {
|
@@ -20,6 +20,11 @@ export interface DbConfiguration {
|
|
20
20
|
};
|
21
21
|
}
|
22
22
|
/**
|
23
|
+
* Stack that creates DatabaseCluster.
|
24
|
+
*
|
25
|
+
* Please not, that created Cluster has RETAIL removalPolicy, so if you want to delete the stack,
|
26
|
+
* you must first deploy without parameter group, then delete stack and manually delete cluster.
|
27
|
+
*
|
23
28
|
* How to upgrade major version?
|
24
29
|
* 0. Set correct SG for db-stack and db-proxy-stack(this step will be removed in the future)
|
25
30
|
* 1. Update db-stack WITHOUT parameter group
|
@@ -6,6 +6,11 @@ const aws_ec2_1 = require("aws-cdk-lib/aws-ec2");
|
|
6
6
|
const aws_rds_1 = require("aws-cdk-lib/aws-rds");
|
7
7
|
const import_util_1 = require("../import-util");
|
8
8
|
/**
|
9
|
+
* Stack that creates DatabaseCluster.
|
10
|
+
*
|
11
|
+
* Please not, that created Cluster has RETAIL removalPolicy, so if you want to delete the stack,
|
12
|
+
* you must first deploy without parameter group, then delete stack and manually delete cluster.
|
13
|
+
*
|
9
14
|
* How to upgrade major version?
|
10
15
|
* 0. Set correct SG for db-stack and db-proxy-stack(this step will be removed in the future)
|
11
16
|
* 1. Update db-stack WITHOUT parameter group
|
@@ -88,6 +93,7 @@ class DbStack extends aws_cdk_lib_1.Stack {
|
|
88
93
|
throw new Error("Couldn't pull CfnDBInstances from the L1 constructs!");
|
89
94
|
}
|
90
95
|
cfnInstances.forEach((cfnInstance) => delete cfnInstance.engineVersion);
|
96
|
+
cluster.node.addDependency(parameterGroup, "Create ParameterGroup before DatabaseCluster");
|
91
97
|
return cluster;
|
92
98
|
}
|
93
99
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export type URN<Namespace extends string, NamespaceSpecificString extends string = ""> = `urn:${Namespace}:${NamespaceSpecificString}`;
|
package/package.json
CHANGED
@@ -68,20 +68,6 @@ export function methodResponse(
|
|
68
68
|
};
|
69
69
|
}
|
70
70
|
|
71
|
-
/**
|
72
|
-
* @deprecated Use DigitrafficMethodResponse
|
73
|
-
*/
|
74
|
-
export function corsMethod(response: MethodResponse): MethodResponse {
|
75
|
-
return {
|
76
|
-
...response,
|
77
|
-
...{
|
78
|
-
responseParameters: {
|
79
|
-
"method.response.header.Access-Control-Allow-Origin": true,
|
80
|
-
},
|
81
|
-
},
|
82
|
-
};
|
83
|
-
}
|
84
|
-
|
85
71
|
interface IntegrationOptions {
|
86
72
|
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
|
87
73
|
requestParameters?: { [dest: string]: string };
|
@@ -16,6 +16,8 @@ const DEFAULT_RECORD_TTL = Duration.seconds(30);
|
|
16
16
|
/**
|
17
17
|
* Creates a dns local zone and creates records for cluster endpoints and proxy endpoints.
|
18
18
|
*
|
19
|
+
* Please note, that created PrivateHostedZone has RETAIN removalPolicy, so if you want to delete this stack,
|
20
|
+
* you must remove the zone by hand after.
|
19
21
|
*/
|
20
22
|
export class DbDnsStack extends Stack {
|
21
23
|
constructor(scope: Construct, id: string, isc: InfraStackConfiguration) {
|
@@ -42,6 +42,11 @@ export interface DbConfiguration {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
/**
|
45
|
+
* Stack that creates DatabaseCluster.
|
46
|
+
*
|
47
|
+
* Please not, that created Cluster has RETAIL removalPolicy, so if you want to delete the stack,
|
48
|
+
* you must first deploy without parameter group, then delete stack and manually delete cluster.
|
49
|
+
*
|
45
50
|
* How to upgrade major version?
|
46
51
|
* 0. Set correct SG for db-stack and db-proxy-stack(this step will be removed in the future)
|
47
52
|
* 1. Update db-stack WITHOUT parameter group
|
@@ -195,6 +200,11 @@ export class DbStack extends Stack {
|
|
195
200
|
}
|
196
201
|
cfnInstances.forEach((cfnInstance) => delete cfnInstance.engineVersion);
|
197
202
|
|
203
|
+
cluster.node.addDependency(
|
204
|
+
parameterGroup,
|
205
|
+
"Create ParameterGroup before DatabaseCluster"
|
206
|
+
);
|
207
|
+
|
198
208
|
return cluster;
|
199
209
|
}
|
200
210
|
}
|
package/src/types/urn.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export type URN<Namespace extends string, NamespaceSpecificString extends string = ""> = `urn:${Namespace}:${NamespaceSpecificString}`;
|