Commit 75f6712
committed
chore: ensure that error codes are string literals
We have concerns that future maintainers may accidentally pass message
strings with interpolated variables where error codes are expected.
To prevent that, introduce a new type `LiteralString`, with only
possible way of obtaining one:
```ts
const x: LiteralString = lit`this does not have variables`;
```
Any attempt to use variables inside this string throws an error
at runtime, so code that does that can never execute.
Then update all locations in which we expect error codes to
take `LiteralString`s.1 parent 09e3daf commit 75f6712
File tree
741 files changed
+4305
-3566
lines changed- packages
- @aws-cdk-testing/framework-integ/test
- aws-ec2/test
- core/test
- @aws-cdk
- aws-amplify-alpha/lib
- aws-apprunner-alpha/lib
- aws-bedrock-agentcore-alpha
- lib
- gateway
- inbound-auth
- targets
- schema
- memory
- runtime
- inbound-auth
- tools
- test/agentcore/runtime
- aws-bedrock-alpha/bedrock
- agents
- guardrails
- inference-profiles
- prompts
- aws-ec2-alpha/lib
- aws-elasticache-alpha/lib
- aws-glue-alpha/lib
- jobs
- triggers
- aws-imagebuilder-alpha/lib
- private
- aws-iot-actions-alpha/lib
- aws-location-alpha/lib
- aws-msk-alpha/lib
- aws-neptune-alpha/lib
- aws-pipes-alpha/lib
- aws-redshift-alpha/lib
- private
- aws-route53resolver-alpha/lib
- aws-s3objectlambda-alpha/lib
- aws-s3tables-alpha/lib
- aws-sagemaker-alpha/lib
- example-construct-library/lib
- integ-tests-alpha/lib/assertions/private
- aws-cdk-lib
- assets/lib
- aws-apigatewayv2-authorizers/lib
- http
- websocket
- aws-apigatewayv2-integrations/lib/http
- private
- aws-apigatewayv2/lib
- common
- http
- websocket
- aws-apigateway/lib
- authorizers
- integrations
- aws-appconfig/lib
- private
- aws-applicationautoscaling/lib
- aws-appmesh/lib
- private
- aws-appsync/lib
- private
- aws-autoscaling-common/lib
- aws-autoscaling/lib
- aws-backup/lib
- private
- aws-batch/lib
- private
- aws-certificatemanager/lib
- aws-chatbot/lib
- aws-cloudfront-origins/lib
- private
- aws-cloudfront/lib
- experimental
- private
- aws-cloudtrail/lib
- aws-cloudwatch/lib
- private
- aws-codebuild/lib
- aws-codecommit/lib
- aws-codedeploy/lib
- ecs
- lambda
- private
- server
- aws-codepipeline-actions/lib
- cloudformation
- codebuild
- codecommit
- codedeploy
- commands
- ec2
- ecs
- lambda
- s3
- aws-codepipeline/lib
- private
- aws-cognito-identitypool/lib
- aws-cognito/lib
- private
- user-pool-idps
- aws-config/lib
- aws-docdb/lib
- aws-dynamodb/lib
- private
- aws-ec2/lib
- machine-image
- private
- aws-ecr-assets/lib
- aws-ecr/lib
- aws-ecs-patterns/lib
- base
- ecs
- fargate
- aws-ecs/lib
- base
- ec2
- external
- fargate
- images
- log-drivers
- proxy-configuration
- aws-efs/lib
- aws-eks-v2/lib
- aws-eks/lib
- aws-elasticloadbalancingv2
- lib
- alb
- nlb
- test/alb
- aws-elasticloadbalancing/lib
- aws-elasticsearch/lib
- aws-events-targets/lib
- aws-events/lib
- private
- aws-fsx/lib
- aws-globalaccelerator-endpoints/lib
- aws-globalaccelerator/lib
- aws-iam/lib
- private
- aws-kinesisfirehose/lib
- private
- processors
- record-format
- aws-kinesis/lib
- aws-kms/lib
- private
- aws-lambda-destinations/lib
- aws-lambda-event-sources/lib
- aws-lambda-nodejs/lib
- aws-lambda/lib
- private
- aws-logs/lib
- private
- aws-opensearchservice/lib
- aws-rds/lib
- private
- aws-route53-patterns/lib
- aws-route53-targets/lib
- aws-route53/lib
- aws-s3-assets
- lib
- test
- aws-s3-deployment
- lib
- test
- aws-s3-notifications/lib
- aws-s3/lib
- notifications-resource
- private
- aws-scheduler-targets/lib
- aws-scheduler/lib
- aws-secretsmanager/lib
- aws-servicecatalog/lib
- private
- aws-servicediscovery/lib
- aws-ses-actions/lib
- aws-ses/lib
- aws-sns-subscriptions/lib
- aws-sns/lib
- private
- aws-sqs/lib
- private
- aws-ssm/lib
- aws-stepfunctions-tasks/lib
- apigateway
- athena
- aws-sdk
- batch
- bedrock
- codebuild
- dynamodb
- private
- ecs
- eks
- emrcontainers
- emr
- private
- eventbridge-scheduler
- eventbridge
- glue
- lambda
- private
- sagemaker
- sns
- sqs
- stepfunctions
- aws-stepfunctions/lib
- private
- states
- distributed-map
- aws-synthetics/lib
- cloudformation-include/lib
- core
- lib
- custom-resource-provider
- fs
- helpers-internal
- mixins
- private
- stack-synthesizers
- test
- custom-resources/lib
- aws-custom-resource
- provider-framework
- pipelines
- lib
- blueprint
- codepipeline
- private
- helpers-internal
- main
- private
- test/testhelpers
- tools/@aws-cdk/spec2cdk/lib/cdk
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
741 files changed
+4305
-3566
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
469 | | - | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | | - | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| |||
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
614 | | - | |
| 615 | + | |
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
621 | 622 | | |
622 | | - | |
| 623 | + | |
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
184 | | - | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
190 | | - | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | | - | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
212 | | - | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
162 | | - | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
0 commit comments