@aws/nx-plugin 1.0.3 → 1.0.5
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/LICENSE-THIRD-PARTY +7 -7
- package/migrations.json +10 -5
- package/package.json +4 -4
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/license/dependency-check/collectors/npm-collector.d.ts +14 -0
- package/src/license/dependency-check/collectors/npm-collector.js +35 -1
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -1
- package/src/migrations/latest/api-custom-domain-runtime-config/metadata.json +3 -0
- package/src/migrations/latest/api-custom-domain-runtime-config/migration.js +362 -0
- package/src/migrations/latest/api-custom-domain-runtime-config/migration.js.map +1 -0
- package/src/migrations/v1.0.3/0001-terraform-init-target/migration.d.ts +6 -0
- package/src/migrations/v1.0.3/0001-terraform-init-target/migration.js.map +1 -0
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +3 -3
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +3 -3
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +54 -6
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +378 -6
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +16 -16
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +253 -5
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +432 -12
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +13 -13
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +34 -4
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +20 -2
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +63 -1
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +63 -1
- package/src/utils/docker.d.ts +1 -1
- package/src/utils/versions.d.ts +54 -54
- package/src/utils/versions.js +54 -54
- package/src/utils/versions.js.map +1 -1
- package/src/migrations/latest/terraform-init-target/migration.js.map +0 -1
- /package/src/migrations/latest/{terraform-init-target → api-custom-domain-runtime-config}/migration.d.ts +0 -0
- /package/src/migrations/{latest/terraform-init-target → v1.0.3/0001-terraform-init-target}/metadata.json +0 -0
- /package/src/migrations/{latest/terraform-init-target → v1.0.3/0001-terraform-init-target}/migration.js +0 -0
|
@@ -377,6 +377,19 @@ variable "tags" {
|
|
|
377
377
|
default = {}
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
# Custom domain configuration
|
|
381
|
+
variable "custom_domain_name" {
|
|
382
|
+
description = "Custom domain name for the API. Requires acm_certificate_arn."
|
|
383
|
+
type = string
|
|
384
|
+
default = null
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
variable "acm_certificate_arn" {
|
|
388
|
+
description = "ARN of an ACM certificate (in the API's region) for the custom domain name."
|
|
389
|
+
type = string
|
|
390
|
+
default = null
|
|
391
|
+
}
|
|
392
|
+
|
|
380
393
|
# Get current AWS region and account ID
|
|
381
394
|
data "aws_region" "current" {}
|
|
382
395
|
data "aws_caller_identity" "current" {}
|
|
@@ -628,6 +641,10 @@ locals {
|
|
|
628
641
|
]
|
|
629
642
|
}
|
|
630
643
|
|
|
644
|
+
locals {
|
|
645
|
+
api_url = var.custom_domain_name == null ? module.http_api.stage_invoke_url : "https://\${var.custom_domain_name}/"
|
|
646
|
+
}
|
|
647
|
+
|
|
631
648
|
# CloudWatch Log Group for Lambda
|
|
632
649
|
resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
633
650
|
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
@@ -697,11 +714,41 @@ module "add_url_to_runtime_config" {
|
|
|
697
714
|
|
|
698
715
|
namespace = "connection"
|
|
699
716
|
key = "apis"
|
|
700
|
-
value = { "TestApi" =
|
|
717
|
+
value = { "TestApi" = local.api_url }
|
|
701
718
|
|
|
702
719
|
depends_on = [module.http_api]
|
|
703
720
|
}
|
|
704
721
|
|
|
722
|
+
# Custom domain for the API
|
|
723
|
+
resource "aws_apigatewayv2_domain_name" "custom_domain" {
|
|
724
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
725
|
+
|
|
726
|
+
domain_name = var.custom_domain_name
|
|
727
|
+
|
|
728
|
+
domain_name_configuration {
|
|
729
|
+
certificate_arn = var.acm_certificate_arn
|
|
730
|
+
endpoint_type = "REGIONAL"
|
|
731
|
+
security_policy = "TLS_1_2"
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
tags = var.tags
|
|
735
|
+
|
|
736
|
+
lifecycle {
|
|
737
|
+
precondition {
|
|
738
|
+
condition = var.acm_certificate_arn != null
|
|
739
|
+
error_message = "acm_certificate_arn is required when custom_domain_name is set."
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
resource "aws_apigatewayv2_api_mapping" "custom_domain" {
|
|
745
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
746
|
+
|
|
747
|
+
api_id = module.http_api.api_id
|
|
748
|
+
stage = module.http_api.stage_id
|
|
749
|
+
domain_name = aws_apigatewayv2_domain_name.custom_domain[0].domain_name
|
|
750
|
+
}
|
|
751
|
+
|
|
705
752
|
# Lambda permission for API Gateway to invoke the function via alias
|
|
706
753
|
resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
707
754
|
for_each = local.operations
|
|
@@ -744,6 +791,21 @@ output "stage_invoke_url" {
|
|
|
744
791
|
value = module.http_api.stage_invoke_url
|
|
745
792
|
}
|
|
746
793
|
|
|
794
|
+
output "api_url" {
|
|
795
|
+
description = "URL clients should call: the custom domain if configured, otherwise the stage invoke URL"
|
|
796
|
+
value = local.api_url
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
output "custom_domain_target_domain_name" {
|
|
800
|
+
description = "Target domain name to point a DNS alias or CNAME record at for the custom domain"
|
|
801
|
+
value = var.custom_domain_name == null ? null : aws_apigatewayv2_domain_name.custom_domain[0].domain_name_configuration[0].target_domain_name
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
output "custom_domain_hosted_zone_id" {
|
|
805
|
+
description = "Hosted zone ID to use for a Route 53 alias record for the custom domain"
|
|
806
|
+
value = var.custom_domain_name == null ? null : aws_apigatewayv2_domain_name.custom_domain[0].domain_name_configuration[0].hosted_zone_id
|
|
807
|
+
}
|
|
808
|
+
|
|
747
809
|
output "stage_arn" {
|
|
748
810
|
description = "ARN of the API Gateway stage"
|
|
749
811
|
value = module.http_api.stage_arn
|
|
@@ -1202,6 +1264,19 @@ variable "tags" {
|
|
|
1202
1264
|
default = {}
|
|
1203
1265
|
}
|
|
1204
1266
|
|
|
1267
|
+
# Custom domain configuration
|
|
1268
|
+
variable "custom_domain_name" {
|
|
1269
|
+
description = "Custom domain name for the API. Requires acm_certificate_arn."
|
|
1270
|
+
type = string
|
|
1271
|
+
default = null
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
variable "acm_certificate_arn" {
|
|
1275
|
+
description = "ARN of an ACM certificate (in the API's region) for the custom domain name."
|
|
1276
|
+
type = string
|
|
1277
|
+
default = null
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1205
1280
|
# Get current AWS region and account ID
|
|
1206
1281
|
data "aws_region" "current" {}
|
|
1207
1282
|
data "aws_caller_identity" "current" {}
|
|
@@ -1453,6 +1528,10 @@ locals {
|
|
|
1453
1528
|
]
|
|
1454
1529
|
}
|
|
1455
1530
|
|
|
1531
|
+
locals {
|
|
1532
|
+
api_url = var.custom_domain_name == null ? module.http_api.stage_invoke_url : "https://\${var.custom_domain_name}/"
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1456
1535
|
# CloudWatch Log Group for Lambda
|
|
1457
1536
|
resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
1458
1537
|
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
@@ -1605,11 +1684,41 @@ module "add_url_to_runtime_config" {
|
|
|
1605
1684
|
|
|
1606
1685
|
namespace = "connection"
|
|
1607
1686
|
key = "apis"
|
|
1608
|
-
value = { "TestApi" =
|
|
1687
|
+
value = { "TestApi" = local.api_url }
|
|
1609
1688
|
|
|
1610
1689
|
depends_on = [module.http_api]
|
|
1611
1690
|
}
|
|
1612
1691
|
|
|
1692
|
+
# Custom domain for the API
|
|
1693
|
+
resource "aws_apigatewayv2_domain_name" "custom_domain" {
|
|
1694
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
1695
|
+
|
|
1696
|
+
domain_name = var.custom_domain_name
|
|
1697
|
+
|
|
1698
|
+
domain_name_configuration {
|
|
1699
|
+
certificate_arn = var.acm_certificate_arn
|
|
1700
|
+
endpoint_type = "REGIONAL"
|
|
1701
|
+
security_policy = "TLS_1_2"
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
tags = var.tags
|
|
1705
|
+
|
|
1706
|
+
lifecycle {
|
|
1707
|
+
precondition {
|
|
1708
|
+
condition = var.acm_certificate_arn != null
|
|
1709
|
+
error_message = "acm_certificate_arn is required when custom_domain_name is set."
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
resource "aws_apigatewayv2_api_mapping" "custom_domain" {
|
|
1715
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
1716
|
+
|
|
1717
|
+
api_id = module.http_api.api_id
|
|
1718
|
+
stage = module.http_api.stage_id
|
|
1719
|
+
domain_name = aws_apigatewayv2_domain_name.custom_domain[0].domain_name
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1613
1722
|
# Lambda permission for API Gateway to invoke the function via alias
|
|
1614
1723
|
resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
1615
1724
|
for_each = local.operations
|
|
@@ -1652,6 +1761,21 @@ output "stage_invoke_url" {
|
|
|
1652
1761
|
value = module.http_api.stage_invoke_url
|
|
1653
1762
|
}
|
|
1654
1763
|
|
|
1764
|
+
output "api_url" {
|
|
1765
|
+
description = "URL clients should call: the custom domain if configured, otherwise the stage invoke URL"
|
|
1766
|
+
value = local.api_url
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
output "custom_domain_target_domain_name" {
|
|
1770
|
+
description = "Target domain name to point a DNS alias or CNAME record at for the custom domain"
|
|
1771
|
+
value = var.custom_domain_name == null ? null : aws_apigatewayv2_domain_name.custom_domain[0].domain_name_configuration[0].target_domain_name
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
output "custom_domain_hosted_zone_id" {
|
|
1775
|
+
description = "Hosted zone ID to use for a Route 53 alias record for the custom domain"
|
|
1776
|
+
value = var.custom_domain_name == null ? null : aws_apigatewayv2_domain_name.custom_domain[0].domain_name_configuration[0].hosted_zone_id
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1655
1779
|
output "stage_arn" {
|
|
1656
1780
|
description = "ARN of the API Gateway stage"
|
|
1657
1781
|
value = module.http_api.stage_arn
|
|
@@ -2110,6 +2234,19 @@ variable "tags" {
|
|
|
2110
2234
|
default = {}
|
|
2111
2235
|
}
|
|
2112
2236
|
|
|
2237
|
+
# Custom domain configuration
|
|
2238
|
+
variable "custom_domain_name" {
|
|
2239
|
+
description = "Custom domain name for the API. Requires acm_certificate_arn."
|
|
2240
|
+
type = string
|
|
2241
|
+
default = null
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
variable "acm_certificate_arn" {
|
|
2245
|
+
description = "ARN of an ACM certificate (in the API's region) for the custom domain name."
|
|
2246
|
+
type = string
|
|
2247
|
+
default = null
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2113
2250
|
# Get current AWS region and account ID
|
|
2114
2251
|
data "aws_region" "current" {}
|
|
2115
2252
|
data "aws_caller_identity" "current" {}
|
|
@@ -2361,6 +2498,10 @@ locals {
|
|
|
2361
2498
|
]
|
|
2362
2499
|
}
|
|
2363
2500
|
|
|
2501
|
+
locals {
|
|
2502
|
+
api_url = var.custom_domain_name == null ? module.http_api.stage_invoke_url : "https://\${var.custom_domain_name}/"
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2364
2505
|
# CloudWatch Log Group for Lambda
|
|
2365
2506
|
resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
2366
2507
|
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
@@ -2417,11 +2558,41 @@ module "add_url_to_runtime_config" {
|
|
|
2417
2558
|
|
|
2418
2559
|
namespace = "connection"
|
|
2419
2560
|
key = "apis"
|
|
2420
|
-
value = { "TestApi" =
|
|
2561
|
+
value = { "TestApi" = local.api_url }
|
|
2421
2562
|
|
|
2422
2563
|
depends_on = [module.http_api]
|
|
2423
2564
|
}
|
|
2424
2565
|
|
|
2566
|
+
# Custom domain for the API
|
|
2567
|
+
resource "aws_apigatewayv2_domain_name" "custom_domain" {
|
|
2568
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
2569
|
+
|
|
2570
|
+
domain_name = var.custom_domain_name
|
|
2571
|
+
|
|
2572
|
+
domain_name_configuration {
|
|
2573
|
+
certificate_arn = var.acm_certificate_arn
|
|
2574
|
+
endpoint_type = "REGIONAL"
|
|
2575
|
+
security_policy = "TLS_1_2"
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
tags = var.tags
|
|
2579
|
+
|
|
2580
|
+
lifecycle {
|
|
2581
|
+
precondition {
|
|
2582
|
+
condition = var.acm_certificate_arn != null
|
|
2583
|
+
error_message = "acm_certificate_arn is required when custom_domain_name is set."
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
resource "aws_apigatewayv2_api_mapping" "custom_domain" {
|
|
2589
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
2590
|
+
|
|
2591
|
+
api_id = module.http_api.api_id
|
|
2592
|
+
stage = module.http_api.stage_id
|
|
2593
|
+
domain_name = aws_apigatewayv2_domain_name.custom_domain[0].domain_name
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2425
2596
|
# Lambda permission for API Gateway to invoke the function via alias
|
|
2426
2597
|
resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
2427
2598
|
for_each = local.operations
|
|
@@ -2464,6 +2635,21 @@ output "stage_invoke_url" {
|
|
|
2464
2635
|
value = module.http_api.stage_invoke_url
|
|
2465
2636
|
}
|
|
2466
2637
|
|
|
2638
|
+
output "api_url" {
|
|
2639
|
+
description = "URL clients should call: the custom domain if configured, otherwise the stage invoke URL"
|
|
2640
|
+
value = local.api_url
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
output "custom_domain_target_domain_name" {
|
|
2644
|
+
description = "Target domain name to point a DNS alias or CNAME record at for the custom domain"
|
|
2645
|
+
value = var.custom_domain_name == null ? null : aws_apigatewayv2_domain_name.custom_domain[0].domain_name_configuration[0].target_domain_name
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
output "custom_domain_hosted_zone_id" {
|
|
2649
|
+
description = "Hosted zone ID to use for a Route 53 alias record for the custom domain"
|
|
2650
|
+
value = var.custom_domain_name == null ? null : aws_apigatewayv2_domain_name.custom_domain[0].domain_name_configuration[0].hosted_zone_id
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2467
2653
|
output "stage_arn" {
|
|
2468
2654
|
description = "ARN of the API Gateway stage"
|
|
2469
2655
|
value = module.http_api.stage_arn
|
|
@@ -2990,6 +3176,19 @@ variable "tags" {
|
|
|
2990
3176
|
default = {}
|
|
2991
3177
|
}
|
|
2992
3178
|
|
|
3179
|
+
# Custom domain configuration
|
|
3180
|
+
variable "custom_domain_name" {
|
|
3181
|
+
description = "Custom domain name for the API. Requires acm_certificate_arn."
|
|
3182
|
+
type = string
|
|
3183
|
+
default = null
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
variable "acm_certificate_arn" {
|
|
3187
|
+
description = "ARN of an ACM certificate (in the API's region) for the custom domain name."
|
|
3188
|
+
type = string
|
|
3189
|
+
default = null
|
|
3190
|
+
}
|
|
3191
|
+
|
|
2993
3192
|
# Get current AWS region and account ID
|
|
2994
3193
|
data "aws_region" "current" {}
|
|
2995
3194
|
data "aws_caller_identity" "current" {}
|
|
@@ -3441,6 +3640,10 @@ locals {
|
|
|
3441
3640
|
]
|
|
3442
3641
|
}
|
|
3443
3642
|
|
|
3643
|
+
locals {
|
|
3644
|
+
api_url = var.custom_domain_name == null ? "\${aws_api_gateway_stage.api_stage.invoke_url}/" : "https://\${var.custom_domain_name}/"
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3444
3647
|
# CloudWatch Log Group for Lambda
|
|
3445
3648
|
resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
3446
3649
|
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
@@ -3768,11 +3971,41 @@ module "add_url_to_runtime_config" {
|
|
|
3768
3971
|
|
|
3769
3972
|
namespace = "connection"
|
|
3770
3973
|
key = "apis"
|
|
3771
|
-
value = { "TestApi" =
|
|
3974
|
+
value = { "TestApi" = local.api_url }
|
|
3772
3975
|
|
|
3773
3976
|
depends_on = [aws_api_gateway_stage.api_stage]
|
|
3774
3977
|
}
|
|
3775
3978
|
|
|
3979
|
+
# Custom domain for the API, served without the stage path prefix
|
|
3980
|
+
resource "aws_api_gateway_domain_name" "custom_domain" {
|
|
3981
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
3982
|
+
|
|
3983
|
+
domain_name = var.custom_domain_name
|
|
3984
|
+
regional_certificate_arn = var.acm_certificate_arn
|
|
3985
|
+
security_policy = "TLS_1_2"
|
|
3986
|
+
|
|
3987
|
+
endpoint_configuration {
|
|
3988
|
+
types = ["REGIONAL"]
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
tags = var.tags
|
|
3992
|
+
|
|
3993
|
+
lifecycle {
|
|
3994
|
+
precondition {
|
|
3995
|
+
condition = var.acm_certificate_arn != null
|
|
3996
|
+
error_message = "acm_certificate_arn is required when custom_domain_name is set."
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
|
|
4001
|
+
resource "aws_api_gateway_base_path_mapping" "custom_domain" {
|
|
4002
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
4003
|
+
|
|
4004
|
+
api_id = module.rest_api.api_id
|
|
4005
|
+
stage_name = aws_api_gateway_stage.api_stage.stage_name
|
|
4006
|
+
domain_name = aws_api_gateway_domain_name.custom_domain[0].domain_name
|
|
4007
|
+
}
|
|
4008
|
+
|
|
3776
4009
|
# Outputs
|
|
3777
4010
|
|
|
3778
4011
|
# API Gateway Outputs (from core module)
|
|
@@ -3801,6 +4034,21 @@ output "stage_invoke_url" {
|
|
|
3801
4034
|
value = aws_api_gateway_stage.api_stage.invoke_url
|
|
3802
4035
|
}
|
|
3803
4036
|
|
|
4037
|
+
output "api_url" {
|
|
4038
|
+
description = "URL clients should call: the custom domain if configured, otherwise the stage invoke URL"
|
|
4039
|
+
value = local.api_url
|
|
4040
|
+
}
|
|
4041
|
+
|
|
4042
|
+
output "custom_domain_target_domain_name" {
|
|
4043
|
+
description = "Target domain name to point a DNS alias or CNAME record at for the custom domain"
|
|
4044
|
+
value = var.custom_domain_name == null ? null : aws_api_gateway_domain_name.custom_domain[0].regional_domain_name
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4047
|
+
output "custom_domain_hosted_zone_id" {
|
|
4048
|
+
description = "Hosted zone ID to use for a Route 53 alias record for the custom domain"
|
|
4049
|
+
value = var.custom_domain_name == null ? null : aws_api_gateway_domain_name.custom_domain[0].regional_zone_id
|
|
4050
|
+
}
|
|
4051
|
+
|
|
3804
4052
|
output "stage_arn" {
|
|
3805
4053
|
description = "ARN of the API Gateway stage"
|
|
3806
4054
|
value = aws_api_gateway_stage.api_stage.arn
|
|
@@ -4328,6 +4576,19 @@ variable "tags" {
|
|
|
4328
4576
|
default = {}
|
|
4329
4577
|
}
|
|
4330
4578
|
|
|
4579
|
+
# Custom domain configuration
|
|
4580
|
+
variable "custom_domain_name" {
|
|
4581
|
+
description = "Custom domain name for the API. Requires acm_certificate_arn."
|
|
4582
|
+
type = string
|
|
4583
|
+
default = null
|
|
4584
|
+
}
|
|
4585
|
+
|
|
4586
|
+
variable "acm_certificate_arn" {
|
|
4587
|
+
description = "ARN of an ACM certificate (in the API's region) for the custom domain name."
|
|
4588
|
+
type = string
|
|
4589
|
+
default = null
|
|
4590
|
+
}
|
|
4591
|
+
|
|
4331
4592
|
# Get current AWS region and account ID
|
|
4332
4593
|
data "aws_region" "current" {}
|
|
4333
4594
|
data "aws_caller_identity" "current" {}
|
|
@@ -4779,6 +5040,10 @@ locals {
|
|
|
4779
5040
|
]
|
|
4780
5041
|
}
|
|
4781
5042
|
|
|
5043
|
+
locals {
|
|
5044
|
+
api_url = var.custom_domain_name == null ? "\${aws_api_gateway_stage.api_stage.invoke_url}/" : "https://\${var.custom_domain_name}/"
|
|
5045
|
+
}
|
|
5046
|
+
|
|
4782
5047
|
# CloudWatch Log Group for Lambda
|
|
4783
5048
|
resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
4784
5049
|
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
@@ -5105,11 +5370,41 @@ module "add_url_to_runtime_config" {
|
|
|
5105
5370
|
|
|
5106
5371
|
namespace = "connection"
|
|
5107
5372
|
key = "apis"
|
|
5108
|
-
value = { "TestApi" =
|
|
5373
|
+
value = { "TestApi" = local.api_url }
|
|
5109
5374
|
|
|
5110
5375
|
depends_on = [aws_api_gateway_stage.api_stage]
|
|
5111
5376
|
}
|
|
5112
5377
|
|
|
5378
|
+
# Custom domain for the API, served without the stage path prefix
|
|
5379
|
+
resource "aws_api_gateway_domain_name" "custom_domain" {
|
|
5380
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
5381
|
+
|
|
5382
|
+
domain_name = var.custom_domain_name
|
|
5383
|
+
regional_certificate_arn = var.acm_certificate_arn
|
|
5384
|
+
security_policy = "TLS_1_2"
|
|
5385
|
+
|
|
5386
|
+
endpoint_configuration {
|
|
5387
|
+
types = ["REGIONAL"]
|
|
5388
|
+
}
|
|
5389
|
+
|
|
5390
|
+
tags = var.tags
|
|
5391
|
+
|
|
5392
|
+
lifecycle {
|
|
5393
|
+
precondition {
|
|
5394
|
+
condition = var.acm_certificate_arn != null
|
|
5395
|
+
error_message = "acm_certificate_arn is required when custom_domain_name is set."
|
|
5396
|
+
}
|
|
5397
|
+
}
|
|
5398
|
+
}
|
|
5399
|
+
|
|
5400
|
+
resource "aws_api_gateway_base_path_mapping" "custom_domain" {
|
|
5401
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
5402
|
+
|
|
5403
|
+
api_id = module.rest_api.api_id
|
|
5404
|
+
stage_name = aws_api_gateway_stage.api_stage.stage_name
|
|
5405
|
+
domain_name = aws_api_gateway_domain_name.custom_domain[0].domain_name
|
|
5406
|
+
}
|
|
5407
|
+
|
|
5113
5408
|
# Outputs
|
|
5114
5409
|
|
|
5115
5410
|
# API Gateway Outputs (from core module)
|
|
@@ -5138,6 +5433,21 @@ output "stage_invoke_url" {
|
|
|
5138
5433
|
value = aws_api_gateway_stage.api_stage.invoke_url
|
|
5139
5434
|
}
|
|
5140
5435
|
|
|
5436
|
+
output "api_url" {
|
|
5437
|
+
description = "URL clients should call: the custom domain if configured, otherwise the stage invoke URL"
|
|
5438
|
+
value = local.api_url
|
|
5439
|
+
}
|
|
5440
|
+
|
|
5441
|
+
output "custom_domain_target_domain_name" {
|
|
5442
|
+
description = "Target domain name to point a DNS alias or CNAME record at for the custom domain"
|
|
5443
|
+
value = var.custom_domain_name == null ? null : aws_api_gateway_domain_name.custom_domain[0].regional_domain_name
|
|
5444
|
+
}
|
|
5445
|
+
|
|
5446
|
+
output "custom_domain_hosted_zone_id" {
|
|
5447
|
+
description = "Hosted zone ID to use for a Route 53 alias record for the custom domain"
|
|
5448
|
+
value = var.custom_domain_name == null ? null : aws_api_gateway_domain_name.custom_domain[0].regional_zone_id
|
|
5449
|
+
}
|
|
5450
|
+
|
|
5141
5451
|
output "stage_arn" {
|
|
5142
5452
|
description = "ARN of the API Gateway stage"
|
|
5143
5453
|
value = aws_api_gateway_stage.api_stage.arn
|
|
@@ -5665,6 +5975,19 @@ variable "tags" {
|
|
|
5665
5975
|
default = {}
|
|
5666
5976
|
}
|
|
5667
5977
|
|
|
5978
|
+
# Custom domain configuration
|
|
5979
|
+
variable "custom_domain_name" {
|
|
5980
|
+
description = "Custom domain name for the API. Requires acm_certificate_arn."
|
|
5981
|
+
type = string
|
|
5982
|
+
default = null
|
|
5983
|
+
}
|
|
5984
|
+
|
|
5985
|
+
variable "acm_certificate_arn" {
|
|
5986
|
+
description = "ARN of an ACM certificate (in the API's region) for the custom domain name."
|
|
5987
|
+
type = string
|
|
5988
|
+
default = null
|
|
5989
|
+
}
|
|
5990
|
+
|
|
5668
5991
|
# Get current AWS region and account ID
|
|
5669
5992
|
data "aws_region" "current" {}
|
|
5670
5993
|
data "aws_caller_identity" "current" {}
|
|
@@ -6116,6 +6439,10 @@ locals {
|
|
|
6116
6439
|
]
|
|
6117
6440
|
}
|
|
6118
6441
|
|
|
6442
|
+
locals {
|
|
6443
|
+
api_url = var.custom_domain_name == null ? "\${aws_api_gateway_stage.api_stage.invoke_url}/" : "https://\${var.custom_domain_name}/"
|
|
6444
|
+
}
|
|
6445
|
+
|
|
6119
6446
|
# CloudWatch Log Group for Lambda
|
|
6120
6447
|
resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
6121
6448
|
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
@@ -6525,11 +6852,41 @@ module "add_url_to_runtime_config" {
|
|
|
6525
6852
|
|
|
6526
6853
|
namespace = "connection"
|
|
6527
6854
|
key = "apis"
|
|
6528
|
-
value = { "TestApi" =
|
|
6855
|
+
value = { "TestApi" = local.api_url }
|
|
6529
6856
|
|
|
6530
6857
|
depends_on = [aws_api_gateway_stage.api_stage]
|
|
6531
6858
|
}
|
|
6532
6859
|
|
|
6860
|
+
# Custom domain for the API, served without the stage path prefix
|
|
6861
|
+
resource "aws_api_gateway_domain_name" "custom_domain" {
|
|
6862
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
6863
|
+
|
|
6864
|
+
domain_name = var.custom_domain_name
|
|
6865
|
+
regional_certificate_arn = var.acm_certificate_arn
|
|
6866
|
+
security_policy = "TLS_1_2"
|
|
6867
|
+
|
|
6868
|
+
endpoint_configuration {
|
|
6869
|
+
types = ["REGIONAL"]
|
|
6870
|
+
}
|
|
6871
|
+
|
|
6872
|
+
tags = var.tags
|
|
6873
|
+
|
|
6874
|
+
lifecycle {
|
|
6875
|
+
precondition {
|
|
6876
|
+
condition = var.acm_certificate_arn != null
|
|
6877
|
+
error_message = "acm_certificate_arn is required when custom_domain_name is set."
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
}
|
|
6881
|
+
|
|
6882
|
+
resource "aws_api_gateway_base_path_mapping" "custom_domain" {
|
|
6883
|
+
count = var.custom_domain_name == null ? 0 : 1
|
|
6884
|
+
|
|
6885
|
+
api_id = module.rest_api.api_id
|
|
6886
|
+
stage_name = aws_api_gateway_stage.api_stage.stage_name
|
|
6887
|
+
domain_name = aws_api_gateway_domain_name.custom_domain[0].domain_name
|
|
6888
|
+
}
|
|
6889
|
+
|
|
6533
6890
|
# Outputs
|
|
6534
6891
|
|
|
6535
6892
|
# API Gateway Outputs (from core module)
|
|
@@ -6558,6 +6915,21 @@ output "stage_invoke_url" {
|
|
|
6558
6915
|
value = aws_api_gateway_stage.api_stage.invoke_url
|
|
6559
6916
|
}
|
|
6560
6917
|
|
|
6918
|
+
output "api_url" {
|
|
6919
|
+
description = "URL clients should call: the custom domain if configured, otherwise the stage invoke URL"
|
|
6920
|
+
value = local.api_url
|
|
6921
|
+
}
|
|
6922
|
+
|
|
6923
|
+
output "custom_domain_target_domain_name" {
|
|
6924
|
+
description = "Target domain name to point a DNS alias or CNAME record at for the custom domain"
|
|
6925
|
+
value = var.custom_domain_name == null ? null : aws_api_gateway_domain_name.custom_domain[0].regional_domain_name
|
|
6926
|
+
}
|
|
6927
|
+
|
|
6928
|
+
output "custom_domain_hosted_zone_id" {
|
|
6929
|
+
description = "Hosted zone ID to use for a Route 53 alias record for the custom domain"
|
|
6930
|
+
value = var.custom_domain_name == null ? null : aws_api_gateway_domain_name.custom_domain[0].regional_zone_id
|
|
6931
|
+
}
|
|
6932
|
+
|
|
6561
6933
|
output "stage_arn" {
|
|
6562
6934
|
description = "ARN of the API Gateway stage"
|
|
6563
6935
|
value = aws_api_gateway_stage.api_stage.arn
|
|
@@ -514,7 +514,7 @@ resource "null_resource" "runtime_ready" {
|
|
|
514
514
|
|
|
515
515
|
provisioner "local-exec" {
|
|
516
516
|
command = <<-EOT
|
|
517
|
-
uv run --with boto3==1.43.
|
|
517
|
+
uv run --with boto3==1.43.103 python -c "
|
|
518
518
|
import boto3
|
|
519
519
|
import json
|
|
520
520
|
import os
|
|
@@ -803,8 +803,8 @@ version = "0.1.0"
|
|
|
803
803
|
dependencies = [
|
|
804
804
|
"aws-lambda-powertools==3.35.0",
|
|
805
805
|
"mcp==1.28.1",
|
|
806
|
-
"uvicorn==0.
|
|
807
|
-
"boto3==1.43.
|
|
806
|
+
"uvicorn==0.54.0",
|
|
807
|
+
"boto3==1.43.103",
|
|
808
808
|
"aws-opentelemetry-distro==0.20.0"
|
|
809
809
|
]
|
|
810
810
|
|
|
@@ -1491,11 +1491,11 @@ description = "Automatically generated by Nx."
|
|
|
1491
1491
|
requires-python = ">=3.14"
|
|
1492
1492
|
readme = "README.md"
|
|
1493
1493
|
dependencies = [
|
|
1494
|
-
"sqlmodel==0.0.
|
|
1494
|
+
"sqlmodel==0.0.47",
|
|
1495
1495
|
"alembic==1.20.0",
|
|
1496
1496
|
"greenlet==3.5.6",
|
|
1497
1497
|
"asyncpg==0.31.0",
|
|
1498
|
-
"boto3==1.43.
|
|
1498
|
+
"boto3==1.43.103",
|
|
1499
1499
|
"aws-lambda-powertools==3.35.0"
|
|
1500
1500
|
]
|
|
1501
1501
|
|
|
@@ -45,7 +45,7 @@ exports[`smithyProjectGenerator > shape libraries > should generate a shape libr
|
|
|
45
45
|
"shx rm -rf dist/{projectRoot}/build",
|
|
46
46
|
"shx rm -rf dist/{projectRoot}/smithy",
|
|
47
47
|
"shx mkdir -p dist/{projectRoot}/build",
|
|
48
|
-
"npx -y mise@2026.9.
|
|
48
|
+
"npx -y mise@2026.9.14 exec smithy@1.74.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
49
49
|
"shx cp dist/{projectRoot}/smithy/source/model/model.json dist/{projectRoot}/build/model.json"
|
|
50
50
|
],
|
|
51
51
|
"parallel": false,
|
|
@@ -62,7 +62,7 @@ exports[`smithyProjectGenerator > shape libraries > should generate a shape libr
|
|
|
62
62
|
"version": "1.0",
|
|
63
63
|
"sources": ["src/"],
|
|
64
64
|
"maven": {
|
|
65
|
-
"dependencies": ["software.amazon.smithy:smithy-model:1.
|
|
65
|
+
"dependencies": ["software.amazon.smithy:smithy-model:1.74.0"]
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
"
|
|
@@ -122,7 +122,7 @@ exports[`smithyProjectGenerator > should generate smithy project with all custom
|
|
|
122
122
|
"shx rm -rf dist/{projectRoot}/build",
|
|
123
123
|
"shx rm -rf dist/{projectRoot}/smithy",
|
|
124
124
|
"shx mkdir -p dist/{projectRoot}/build",
|
|
125
|
-
"npx -y mise@2026.9.
|
|
125
|
+
"npx -y mise@2026.9.14 exec smithy@1.74.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
126
126
|
"shx mkdir -p dist/{projectRoot}/build/openapi",
|
|
127
127
|
"shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
|
|
128
128
|
],
|
|
@@ -180,7 +180,7 @@ exports[`smithyProjectGenerator > should generate smithy project with custom dir
|
|
|
180
180
|
"shx rm -rf dist/{projectRoot}/build",
|
|
181
181
|
"shx rm -rf dist/{projectRoot}/smithy",
|
|
182
182
|
"shx mkdir -p dist/{projectRoot}/build",
|
|
183
|
-
"npx -y mise@2026.9.
|
|
183
|
+
"npx -y mise@2026.9.14 exec smithy@1.74.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
184
184
|
"shx mkdir -p dist/{projectRoot}/build/openapi",
|
|
185
185
|
"shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
|
|
186
186
|
],
|
|
@@ -330,7 +330,7 @@ exports[`smithyProjectGenerator > should generate smithy project with default op
|
|
|
330
330
|
"shx rm -rf dist/{projectRoot}/build",
|
|
331
331
|
"shx rm -rf dist/{projectRoot}/smithy",
|
|
332
332
|
"shx mkdir -p dist/{projectRoot}/build",
|
|
333
|
-
"npx -y mise@2026.9.
|
|
333
|
+
"npx -y mise@2026.9.14 exec smithy@1.74.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
334
334
|
"shx mkdir -p dist/{projectRoot}/build/openapi",
|
|
335
335
|
"shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
|
|
336
336
|
],
|
|
@@ -375,11 +375,11 @@ exports[`smithyProjectGenerator > should generate smithy project with default op
|
|
|
375
375
|
},
|
|
376
376
|
"maven": {
|
|
377
377
|
"dependencies": [
|
|
378
|
-
"software.amazon.smithy:smithy-model:1.
|
|
379
|
-
"software.amazon.smithy:smithy-aws-traits:1.
|
|
380
|
-
"software.amazon.smithy:smithy-validation-model:1.
|
|
381
|
-
"software.amazon.smithy:smithy-openapi:1.
|
|
382
|
-
"software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.
|
|
378
|
+
"software.amazon.smithy:smithy-model:1.74.0",
|
|
379
|
+
"software.amazon.smithy:smithy-aws-traits:1.74.0",
|
|
380
|
+
"software.amazon.smithy:smithy-validation-model:1.74.0",
|
|
381
|
+
"software.amazon.smithy:smithy-openapi:1.74.0",
|
|
382
|
+
"software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.54.0"
|
|
383
383
|
]
|
|
384
384
|
}
|
|
385
385
|
}
|
|
@@ -474,7 +474,7 @@ exports[`smithyProjectGenerator > should generate smithy project with subdirecto
|
|
|
474
474
|
"shx rm -rf dist/{projectRoot}/build",
|
|
475
475
|
"shx rm -rf dist/{projectRoot}/smithy",
|
|
476
476
|
"shx mkdir -p dist/{projectRoot}/build",
|
|
477
|
-
"npx -y mise@2026.9.
|
|
477
|
+
"npx -y mise@2026.9.14 exec smithy@1.74.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
478
478
|
"shx mkdir -p dist/{projectRoot}/build/openapi",
|
|
479
479
|
"shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
|
|
480
480
|
],
|
|
@@ -565,11 +565,11 @@ exports[`smithyProjectGenerator > should handle kebab-case conversion for servic
|
|
|
565
565
|
},
|
|
566
566
|
"maven": {
|
|
567
567
|
"dependencies": [
|
|
568
|
-
"software.amazon.smithy:smithy-model:1.
|
|
569
|
-
"software.amazon.smithy:smithy-aws-traits:1.
|
|
570
|
-
"software.amazon.smithy:smithy-validation-model:1.
|
|
571
|
-
"software.amazon.smithy:smithy-openapi:1.
|
|
572
|
-
"software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.
|
|
568
|
+
"software.amazon.smithy:smithy-model:1.74.0",
|
|
569
|
+
"software.amazon.smithy:smithy-aws-traits:1.74.0",
|
|
570
|
+
"software.amazon.smithy:smithy-validation-model:1.74.0",
|
|
571
|
+
"software.amazon.smithy:smithy-openapi:1.74.0",
|
|
572
|
+
"software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.54.0"
|
|
573
573
|
]
|
|
574
574
|
}
|
|
575
575
|
}
|