@rio-cloud/cdk-v2-constructs 9.0.0-alpha.4 → 9.0.0-alpha.6
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/docs/AGENTS_DOCUMENTATION.md +213 -0
- package/package.json +2 -2
- package/version.json +1 -1
|
@@ -30,6 +30,219 @@ Prefer `import * as rio from '@rio-cloud/cdk-v2-constructs';` unless an exported
|
|
|
30
30
|
|
|
31
31
|
Read the relevant declaration comments and examples before writing or changing infrastructure code.
|
|
32
32
|
|
|
33
|
+
## Migration guidance for `9.0.0`
|
|
34
|
+
|
|
35
|
+
This section applies when upgrading a consuming project to `9.0.0` or
|
|
36
|
+
later. Confirm the installed package version and its `package.json` exports
|
|
37
|
+
before applying it. The guidance below is based on the implementation and
|
|
38
|
+
tests in this release; it intentionally does not prescribe replacements for
|
|
39
|
+
environment variables for which this wrapper exposes no one-to-one prop.
|
|
40
|
+
|
|
41
|
+
### Datadog Lambda instrumentation: Datadog v5 environment handling
|
|
42
|
+
|
|
43
|
+
`DatadogLambdaInstrumentation` now uses `datadog-cdk-constructs-v2` v5. Before
|
|
44
|
+
calling `addLambdaFunctions()`, the construct rejects a Lambda whose CDK
|
|
45
|
+
environment already contains any of these variables:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
DD_TRACE_ENABLED
|
|
49
|
+
DD_MERGE_XRAY_TRACES
|
|
50
|
+
DD_LOGS_INJECTION
|
|
51
|
+
DD_SERVERLESS_LOGS_ENABLED
|
|
52
|
+
DD_CAPTURE_LAMBDA_PAYLOAD
|
|
53
|
+
DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING
|
|
54
|
+
DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING
|
|
55
|
+
DD_LOG_LEVEL
|
|
56
|
+
DD_APPSEC_ENABLED
|
|
57
|
+
DD_SERVERLESS_APPSEC_ENABLED
|
|
58
|
+
AWS_LAMBDA_EXEC_WRAPPER
|
|
59
|
+
DD_TAGS
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Datadog v4 read existing values differently. With v5, values configured
|
|
63
|
+
before instrumentation can be overwritten, so remove these settings from the
|
|
64
|
+
Lambda constructor and from any `addEnvironment()` call made before
|
|
65
|
+
`addLambdaFunctions()`.
|
|
66
|
+
|
|
67
|
+
Use the instrumentation props for settings that have a corresponding public
|
|
68
|
+
prop. The direct mappings established by this package are:
|
|
69
|
+
|
|
70
|
+
| Lambda environment variable | `DatadogLambdaInstrumentation` prop |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| `DD_TRACE_ENABLED` | `enableDatadogTracing` |
|
|
73
|
+
| `DD_MERGE_XRAY_TRACES` | `enableMergeXrayTraces` |
|
|
74
|
+
| `DD_LOGS_INJECTION` | `injectLogContext` |
|
|
75
|
+
| `DD_SERVERLESS_LOGS_ENABLED` | `enableDatadogLogs` |
|
|
76
|
+
| `DD_CAPTURE_LAMBDA_PAYLOAD` | `captureLambdaPayload` |
|
|
77
|
+
| `DD_LOG_LEVEL` | `logLevel` |
|
|
78
|
+
| `DD_TAGS` | `tags` |
|
|
79
|
+
|
|
80
|
+
The wrapper also exposes `enableDatadogASM` and `datadogAppSecMode`, but the
|
|
81
|
+
repository does not document a mechanical mapping for every AppSec-related
|
|
82
|
+
environment variable. Do not invent one; inspect the installed declarations
|
|
83
|
+
and the Datadog v5 behavior for the desired AppSec configuration. The same
|
|
84
|
+
applies to the two cloud-payload-tagging variables and
|
|
85
|
+
`AWS_LAMBDA_EXEC_WRAPPER`, for which this wrapper has no same-named prop.
|
|
86
|
+
|
|
87
|
+
If a per-function override is intentional, apply it only after instrumentation:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
datadog.addLambdaFunctions([handler]);
|
|
91
|
+
handler.addEnvironment('DD_LOG_LEVEL', 'debug');
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
An override of `DD_TAGS` at that point replaces all tags generated by the
|
|
95
|
+
construct, including Git metadata added through `addGitCommitMetadata()`.
|
|
96
|
+
`addLambdaFunctions()` validates the complete batch before changing any of its
|
|
97
|
+
functions. The validation covers the underlying CDK `Function` environment,
|
|
98
|
+
including `SingletonFunction` and values added with `addEnvironment()`; it
|
|
99
|
+
does not inspect `CfnFunction` escape-hatch overrides.
|
|
100
|
+
|
|
101
|
+
Source-code integration is enabled by default and can change generated
|
|
102
|
+
`DD_TAGS`. For snapshot tests that must disable it, set this exact context key
|
|
103
|
+
on the test `App` to either boolean `false` or string `"false"`:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
const app = new App({
|
|
107
|
+
context: {
|
|
108
|
+
'@rio-cloud/cdk-v2-constructs:enableSourceCodeIntegration': false,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Do not substitute the unrelated `datadog-cdk-constructs-v2` context key. Layer
|
|
114
|
+
version props remain required; choose versions compatible with the installed
|
|
115
|
+
Datadog Lambda Node and extension layer releases rather than copying stale
|
|
116
|
+
values from tests.
|
|
117
|
+
|
|
118
|
+
### Pipeline license-checker prerequisite
|
|
119
|
+
|
|
120
|
+
Before upgrading a project that uses the Team Transport pipeline, add
|
|
121
|
+
`@rio-cloud/rio-license-checker` as a direct dev dependency and commit the
|
|
122
|
+
corresponding lockfile:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm install --save-dev @rio-cloud/rio-license-checker
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The generated buildspecs call `npx rio-license-checker` after `npm ci`; the
|
|
129
|
+
construct no longer supplies this package transitively. Add it to the package
|
|
130
|
+
whose `npm ci` precedes the call:
|
|
131
|
+
|
|
132
|
+
| Generated pipeline feature | Workspace in which the checker is invoked | Package that needs the dev dependency |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| Infrastructure synth | `infrastructure/` | `infrastructure/package.json` |
|
|
135
|
+
| `gradleBuild` | repository root | root `package.json` |
|
|
136
|
+
| `npmBuild` | repository root | root `package.json` |
|
|
137
|
+
|
|
138
|
+
If a project enables more than one of these generated build paths, make the
|
|
139
|
+
checker available in each corresponding workspace. A custom main/branch or
|
|
140
|
+
vulnerability buildspec is loaded instead of the generated one, so inspect
|
|
141
|
+
that file separately for its own license-check command and install location.
|
|
142
|
+
The package's release notes link to the internal [RIO license-check
|
|
143
|
+
guidance](https://confluence.collaboration-man.com/spaces/RIOSHIPPER/pages/448924008/License+Checks).
|
|
144
|
+
|
|
145
|
+
### Contribution imports and package dependencies
|
|
146
|
+
|
|
147
|
+
Contribution constructs are no longer exported from the package root. Use the
|
|
148
|
+
owner-level subpaths that are present in the installed package's `exports` map:
|
|
149
|
+
|
|
150
|
+
| Owner | Public import path in `9.0.0` |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| Team Claid | `@rio-cloud/cdk-v2-constructs/contributions/team-claid` |
|
|
153
|
+
| Team Outbound Order Book | `@rio-cloud/cdk-v2-constructs/contributions/team-outbound-order-book` |
|
|
154
|
+
| Team Shipper Inbound Blue | `@rio-cloud/cdk-v2-constructs/contributions/team-shipper-inbound-blue` |
|
|
155
|
+
| Smart Route / GitLab Runner | `@rio-cloud/cdk-v2-constructs/contributions/smart-route` |
|
|
156
|
+
| Team Transport | `@rio-cloud/cdk-v2-constructs/contributions/team-transport` |
|
|
157
|
+
| CoP Frontend | `@rio-cloud/cdk-v2-constructs/contributions/cop-frontend` |
|
|
158
|
+
|
|
159
|
+
For example, change a root import while keeping the named imports:
|
|
160
|
+
|
|
161
|
+
```diff
|
|
162
|
+
-import { PipelineStack, PipelineType } from '@rio-cloud/cdk-v2-constructs';
|
|
163
|
+
+import { PipelineStack, PipelineType } from '@rio-cloud/cdk-v2-constructs/contributions/team-transport';
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Team Transport was renamed from `team-transport-two` to `team-transport`.
|
|
167
|
+
Import its pipeline, Datadog, and synthetics constructs from the single
|
|
168
|
+
owner-level path above. Do not infer additional public subpaths from the
|
|
169
|
+
source directory layout; the installed `package.json` `exports` map is the
|
|
170
|
+
authority.
|
|
171
|
+
|
|
172
|
+
GitLab Runner consumers must also install
|
|
173
|
+
`@pepperize/cdk-autoscaling-gitlab-runner` as a direct project dependency:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
npm install @pepperize/cdk-autoscaling-gitlab-runner
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
It is an optional peer dependency of this package, not a regular dependency
|
|
180
|
+
that a consuming project can obtain transitively. This additional dependency
|
|
181
|
+
is required only by projects importing the Smart Route GitLab Runner
|
|
182
|
+
constructs.
|
|
183
|
+
|
|
184
|
+
### TypeScript resolver required for contribution subpaths
|
|
185
|
+
|
|
186
|
+
The contribution imports depend on Node package export maps. A legacy
|
|
187
|
+
`moduleResolution: "node"` configuration does not resolve these imports
|
|
188
|
+
reliably. Use a resolver that honors `exports` and keep the `module` and
|
|
189
|
+
`moduleResolution` settings compatible. For example, a CommonJS-oriented
|
|
190
|
+
project can use:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"compilerOptions": {
|
|
195
|
+
"module": "Node16",
|
|
196
|
+
"moduleResolution": "node16"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
A bundler-managed project can instead use the corresponding `bundler`
|
|
202
|
+
resolution mode with its existing bundler-compatible module setting. Do not
|
|
203
|
+
change only `moduleResolution` in a configuration whose `module` setting is
|
|
204
|
+
incompatible; preserve the consuming project's module model and verify it with
|
|
205
|
+
the project's typecheck and synth commands.
|
|
206
|
+
|
|
207
|
+
### Team Transport CodeBuild runtime options
|
|
208
|
+
|
|
209
|
+
This is an alpha.4 pipeline feature rather than a breaking migration, but it
|
|
210
|
+
is relevant when updating pipeline code. Generated main, branch, and
|
|
211
|
+
vulnerability buildspecs continue to use Node.js 24 by default. To require an
|
|
212
|
+
exact toolchain, set `codeBuildOptions.nodejsVersion` and/or
|
|
213
|
+
`codeBuildOptions.npmVersion` to an exact `major.minor.patch` value. The
|
|
214
|
+
generated install phase checks the selected versions before installing project
|
|
215
|
+
dependencies; it does not install npm globally. These options affect only
|
|
216
|
+
generated buildspecs. A custom buildspec supplied through
|
|
217
|
+
`partialBuildSpecPath` or `vulnerabilityPartialBuildSpecPath` is responsible
|
|
218
|
+
for its own runtime and version checks.
|
|
219
|
+
|
|
220
|
+
### CloudFront certificates added in v9
|
|
221
|
+
|
|
222
|
+
`CloudFrontCertificate` is exported from the package root. It creates a
|
|
223
|
+
DNS-validated ACM certificate in `us-east-1` for a stack in any region and
|
|
224
|
+
requires a public Route 53 hosted zone in the same account:
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
import { CloudFrontCertificate } from '@rio-cloud/cdk-v2-constructs';
|
|
228
|
+
import { Distribution } from 'aws-cdk-lib/aws-cloudfront';
|
|
229
|
+
|
|
230
|
+
const certificate = new CloudFrontCertificate(this, 'CloudFrontCertificate', {
|
|
231
|
+
domainName: 'www.example.com',
|
|
232
|
+
hostedZone,
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
new Distribution(this, 'Distribution', {
|
|
236
|
+
certificate: certificate.certificate,
|
|
237
|
+
// ...other required Distribution props
|
|
238
|
+
});
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Use `certificate` (`acm.ICertificate`) when another CDK construct accepts a
|
|
242
|
+
certificate. Use `certificateArn` only for integrations that require a string
|
|
243
|
+
ARN. Changing the domain or hosted zone replaces the certificate; validation
|
|
244
|
+
CNAME records are retained for renewal.
|
|
245
|
+
|
|
33
246
|
## Usage Guidance
|
|
34
247
|
|
|
35
248
|
### General
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "lib/index.js",
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
|
-
"version": "9.0.0-alpha.
|
|
18
|
+
"version": "9.0.0-alpha.6",
|
|
19
19
|
"types": "lib/index.d.ts",
|
|
20
20
|
"stability": "stable",
|
|
21
21
|
"exports": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"esbuild": "0.28.2",
|
|
111
111
|
"jsii": "5.9.55",
|
|
112
112
|
"jsii-diff": "1.141.0",
|
|
113
|
-
"jsii-docgen": "10.12.
|
|
113
|
+
"jsii-docgen": "10.12.7",
|
|
114
114
|
"tmp": "^0.2.3",
|
|
115
115
|
"ts-node": "^10.9.2",
|
|
116
116
|
"typescript": "~5.6.3",
|
package/version.json
CHANGED