@aws/nx-plugin 0.46.0 → 0.47.0
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/package.json +1 -1
- package/src/infra/app/generator.js +4 -1
- package/src/infra/app/generator.js.map +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +60 -0
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +1 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +310 -0
- package/src/py/lambda-function/generator.js +15 -25
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +1 -0
- package/src/py/lambda-function/schema.json +8 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +60 -0
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +1 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +310 -0
- package/src/ts/lambda-function/generator.js +15 -27
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +1 -0
- package/src/ts/lambda-function/schema.json +8 -0
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +756 -0
- package/src/ts/react-website/app/generator.js +42 -43
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +1 -0
- package/src/ts/react-website/app/schema.json +8 -0
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +259 -0
- package/src/ts/react-website/cognito-auth/generator.js +10 -13
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.ts +1 -0
- package/src/ts/react-website/cognito-auth/schema.json +8 -0
- package/src/ts/react-website/runtime-config/__snapshots__/generator.spec.ts.snap +0 -40
- package/src/ts/react-website/runtime-config/generator.js +0 -2
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +10 -0
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +10 -0
- package/src/utils/files/terraform/src/core/runtime-config/entry/entry.tf.template +119 -0
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +28 -0
- package/src/{py/lambda-function/files/common/constructs/src/app/lambda-functions/__constructFunctionKebabCase__.ts.template → utils/function-constructs/files/cdk/app/lambda-functions/__functionNameKebabCase__.ts.template} +5 -5
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__functionNameKebabCase__/__functionNameKebabCase__.tf.template +150 -0
- package/src/utils/function-constructs/function-constructs.d.ts +19 -0
- package/src/utils/function-constructs/function-constructs.js +57 -0
- package/src/utils/function-constructs/function-constructs.js.map +1 -0
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +123 -0
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +421 -0
- package/src/utils/identity-constructs/files/terraform/core/user-identity/main.tf.template +47 -0
- package/src/utils/identity-constructs/identity-constructs.d.ts +15 -0
- package/src/utils/identity-constructs/identity-constructs.js +84 -0
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -0
- package/src/utils/metrics.js +1 -1
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/shared-constructs.js +24 -0
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/website-constructs/files/terraform/app/static-websites/__websiteNameKebabCase__/__websiteNameKebabCase__.tf.template +42 -0
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +709 -0
- package/src/utils/website-constructs/website-constructs.d.ts +18 -0
- package/src/utils/website-constructs/website-constructs.js +61 -0
- package/src/utils/website-constructs/website-constructs.js.map +1 -0
- package/src/ts/lambda-function/files/common/constructs/src/app/lambda-functions/__constructFunctionNameKebabCase__.ts.template +0 -24
- /package/src/{ts/react-website/cognito-auth/files/common/constructs/src → utils/identity-constructs/files/cdk}/core/user-identity.ts.template +0 -0
- /package/src/{ts/react-website/app/files/common/constructs/src → utils/website-constructs/files/cdk}/app/static-websites/__websiteNameKebabCase__.ts.template +0 -0
- /package/src/{ts/react-website/app/files/common/constructs/src → utils/website-constructs/files/cdk}/core/static-website.ts.template +0 -0
package/package.json
CHANGED
|
@@ -26,7 +26,10 @@ function tsInfraGenerator(tree, schema) {
|
|
|
26
26
|
const lib = (0, generator_1.getTsLibDetails)(tree, schema);
|
|
27
27
|
yield (0, generator_1.default)(tree, schema);
|
|
28
28
|
(0, nx_1.addGeneratorMetadata)(tree, lib.fullyQualifiedName, exports.INFRA_APP_GENERATOR_INFO);
|
|
29
|
-
|
|
29
|
+
// Shared constructs always in CDK for typescript infra generator
|
|
30
|
+
yield (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
31
|
+
iacProvider: 'CDK',
|
|
32
|
+
});
|
|
30
33
|
const synthDirFromRoot = `/dist/${lib.dir}/cdk.out`;
|
|
31
34
|
const synthDirFromProject = lib.dir
|
|
32
35
|
.split('/')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/infra/app/generator.ts"],"names":[],"mappings":";;;AAyCA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/infra/app/generator.ts"],"names":[],"mappings":";;;AAyCA,4CAqKC;;AA9MD;;;GAGG;AACH,uCAYoB;AAEpB,4EAA6E;AAC7E,mDAAoD;AACpD,qDAAwE;AACxE,qEAA0E;AAC1E,yFAGiD;AACjD,yCAAgD;AAChD,wDAAwB;AACxB,+CAA0D;AAC1D,+CAAoD;AACpD,uCAIwB;AACxB,iDAAsE;AACtE,6CAA8C;AAEjC,QAAA,wBAAwB,GACnC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAE/B,SAAsB,gBAAgB,CACpC,IAAU,EACV,MAA8B;;QAE9B,MAAM,GAAG,GAAG,IAAA,2BAAe,EAAC,I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,IAAA,uBAAY,EAAC;YACX,iCAAiC;YACjC,aAAa;YACb,SAAS;YACT,SAAS;YACT,YAAY;YACZ,oBAAoB;SACrB,CAAC,EACF,IAAA,uBAAY,EAAC,CAAC,KAAK,CAAC,CAAC,CACtB,CAAC;QAEF,IAAA,mBAAU,EAAC,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,iCAC1D,QAAQ,KACX,UAAU,EAAE;gBACV,GAAG,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;gBAC9B;oBACE,IAAI,EAAE,GAAG,cAAI,CAAC,QAAQ,CACpB,WAAW,EACX,GAAG,IAAI,CAAC,IAAI,IAAI,0CAAY,EAAE,CAC/B,IAAI,mDAAqB,gBAAgB;iBAC3C;aACF,IACD,CAAC,CAAC;QAEJ,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,gCAAwB,CAAC,CAAC,CAAC;QAExE,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;QACjC,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA;AACD,kBAAe,gBAAgB,CAAC"}
|
|
@@ -1619,6 +1619,16 @@ resource "aws_apigatewayv2_route" "proxy_routes" {
|
|
|
1619
1619
|
depends_on = [aws_apigatewayv2_integration.lambda_integration, aws_apigatewayv2_authorizer.cognito_authorizer]
|
|
1620
1620
|
}
|
|
1621
1621
|
|
|
1622
|
+
# Add API url to runtime config
|
|
1623
|
+
module "add_url_to_runtime_config" {
|
|
1624
|
+
source = "../../../core/runtime-config/entry"
|
|
1625
|
+
|
|
1626
|
+
key_path = "apis.TestApi"
|
|
1627
|
+
value = module.http_api.stage_invoke_url
|
|
1628
|
+
|
|
1629
|
+
depends_on = [module.http_api]
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1622
1632
|
# Lambda permission for API Gateway to invoke the function
|
|
1623
1633
|
resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
1624
1634
|
statement_id = "AllowExecutionFromAPIGateway"
|
|
@@ -2216,6 +2226,16 @@ resource "aws_apigatewayv2_route" "proxy_routes" {
|
|
|
2216
2226
|
depends_on = [aws_apigatewayv2_integration.lambda_integration]
|
|
2217
2227
|
}
|
|
2218
2228
|
|
|
2229
|
+
# Add API url to runtime config
|
|
2230
|
+
module "add_url_to_runtime_config" {
|
|
2231
|
+
source = "../../../core/runtime-config/entry"
|
|
2232
|
+
|
|
2233
|
+
key_path = "apis.TestApi"
|
|
2234
|
+
value = module.http_api.stage_invoke_url
|
|
2235
|
+
|
|
2236
|
+
depends_on = [module.http_api]
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2219
2239
|
# Lambda permission for API Gateway to invoke the function
|
|
2220
2240
|
resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
2221
2241
|
statement_id = "AllowExecutionFromAPIGateway"
|
|
@@ -2815,6 +2835,16 @@ resource "aws_apigatewayv2_route" "proxy_routes" {
|
|
|
2815
2835
|
depends_on = [aws_apigatewayv2_integration.lambda_integration]
|
|
2816
2836
|
}
|
|
2817
2837
|
|
|
2838
|
+
# Add API url to runtime config
|
|
2839
|
+
module "add_url_to_runtime_config" {
|
|
2840
|
+
source = "../../../core/runtime-config/entry"
|
|
2841
|
+
|
|
2842
|
+
key_path = "apis.TestApi"
|
|
2843
|
+
value = module.http_api.stage_invoke_url
|
|
2844
|
+
|
|
2845
|
+
depends_on = [module.http_api]
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2818
2848
|
# Lambda permission for API Gateway to invoke the function
|
|
2819
2849
|
resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
2820
2850
|
statement_id = "AllowExecutionFromAPIGateway"
|
|
@@ -3441,6 +3471,16 @@ resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
|
3441
3471
|
depends_on = [module.rest_api, aws_lambda_function.api_lambda]
|
|
3442
3472
|
}
|
|
3443
3473
|
|
|
3474
|
+
# Add API url to runtime config
|
|
3475
|
+
module "add_url_to_runtime_config" {
|
|
3476
|
+
source = "../../../core/runtime-config/entry"
|
|
3477
|
+
|
|
3478
|
+
key_path = "apis.TestApi"
|
|
3479
|
+
value = aws_api_gateway_stage.api_stage.invoke_url
|
|
3480
|
+
|
|
3481
|
+
depends_on = [aws_api_gateway_stage.api_stage]
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3444
3484
|
# Outputs
|
|
3445
3485
|
|
|
3446
3486
|
# API Gateway Outputs (from core module)
|
|
@@ -4059,6 +4099,16 @@ resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
|
4059
4099
|
depends_on = [module.rest_api, aws_lambda_function.api_lambda]
|
|
4060
4100
|
}
|
|
4061
4101
|
|
|
4102
|
+
# Add API url to runtime config
|
|
4103
|
+
module "add_url_to_runtime_config" {
|
|
4104
|
+
source = "../../../core/runtime-config/entry"
|
|
4105
|
+
|
|
4106
|
+
key_path = "apis.TestApi"
|
|
4107
|
+
value = aws_api_gateway_stage.api_stage.invoke_url
|
|
4108
|
+
|
|
4109
|
+
depends_on = [aws_api_gateway_stage.api_stage]
|
|
4110
|
+
}
|
|
4111
|
+
|
|
4062
4112
|
# Outputs
|
|
4063
4113
|
|
|
4064
4114
|
# API Gateway Outputs (from core module)
|
|
@@ -4668,6 +4718,16 @@ resource "aws_lambda_permission" "api_gateway_invoke" {
|
|
|
4668
4718
|
depends_on = [module.rest_api, aws_lambda_function.api_lambda]
|
|
4669
4719
|
}
|
|
4670
4720
|
|
|
4721
|
+
# Add API url to runtime config
|
|
4722
|
+
module "add_url_to_runtime_config" {
|
|
4723
|
+
source = "../../../core/runtime-config/entry"
|
|
4724
|
+
|
|
4725
|
+
key_path = "apis.TestApi"
|
|
4726
|
+
value = aws_api_gateway_stage.api_stage.invoke_url
|
|
4727
|
+
|
|
4728
|
+
depends_on = [aws_api_gateway_stage.api_stage]
|
|
4729
|
+
}
|
|
4730
|
+
|
|
4671
4731
|
# Outputs
|
|
4672
4732
|
|
|
4673
4733
|
# API Gateway Outputs (from core module)
|
|
@@ -211,6 +211,7 @@ exports[`fastapi react generator > should instrument providers in main.tsx > mai
|
|
|
211
211
|
"import TestApiProvider from './components/TestApiProvider';
|
|
212
212
|
import QueryClientProvider from './components/QueryClientProvider';
|
|
213
213
|
import RuntimeConfigProvider from './components/RuntimeConfig';
|
|
214
|
+
|
|
214
215
|
import { RouterProvider } from '@tanstack/react-router';
|
|
215
216
|
|
|
216
217
|
const App = () => <RouterProvider router={router} />;
|
|
@@ -64,3 +64,313 @@ export class TestProjectTestFunction extends Function {
|
|
|
64
64
|
",
|
|
65
65
|
}
|
|
66
66
|
`;
|
|
67
|
+
|
|
68
|
+
exports[`lambda-handler project generator > terraform iacProvider > should generate terraform files for python lambda function and snapshot them > terraform-python-lambda-files 1`] = `
|
|
69
|
+
{
|
|
70
|
+
"test-project-test-function.tf": "variable "tags" {
|
|
71
|
+
description = "Tags to apply to resources"
|
|
72
|
+
type = map(string)
|
|
73
|
+
default = {}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
variable "env" {
|
|
77
|
+
description = "Additional environment variables for the Lambda function"
|
|
78
|
+
type = map(string)
|
|
79
|
+
default = {}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
variable "additional_iam_policy_statements" {
|
|
83
|
+
description = "Additional IAM policy statements to attach to the Lambda role"
|
|
84
|
+
type = list(object({
|
|
85
|
+
Effect = string
|
|
86
|
+
Action = list(string)
|
|
87
|
+
Resource = list(string)
|
|
88
|
+
}))
|
|
89
|
+
default = []
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
data "aws_caller_identity" "current" {}
|
|
93
|
+
data "aws_region" "current" {}
|
|
94
|
+
|
|
95
|
+
locals {
|
|
96
|
+
aws_account_id = data.aws_caller_identity.current.account_id
|
|
97
|
+
aws_region = data.aws_region.current.name
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
resource "random_string" "suffix" {
|
|
101
|
+
length = 8
|
|
102
|
+
special = false
|
|
103
|
+
upper = false
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
resource "aws_iam_role" "lambda_role" {
|
|
107
|
+
name = "test-project-test-function-role-\${random_string.suffix.result}"
|
|
108
|
+
|
|
109
|
+
assume_role_policy = jsonencode({
|
|
110
|
+
Version = "2012-10-17"
|
|
111
|
+
Statement = [
|
|
112
|
+
{
|
|
113
|
+
Sid = "LambdaAssumeRolePolicy"
|
|
114
|
+
Effect = "Allow"
|
|
115
|
+
Principal = {
|
|
116
|
+
Service = "lambda.amazonaws.com"
|
|
117
|
+
}
|
|
118
|
+
Action = "sts:AssumeRole"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
tags = var.tags
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
resource "aws_iam_policy" "lambda_policy" {
|
|
127
|
+
name = "test-project-test-function-policy-\${random_string.suffix.result}"
|
|
128
|
+
description = "Policy for test-project-test-function Lambda function"
|
|
129
|
+
|
|
130
|
+
policy = jsonencode({
|
|
131
|
+
Version = "2012-10-17"
|
|
132
|
+
Statement = concat([
|
|
133
|
+
{
|
|
134
|
+
Sid = "CloudWatchLogsAccess"
|
|
135
|
+
Effect = "Allow"
|
|
136
|
+
Action = [
|
|
137
|
+
"logs:CreateLogGroup",
|
|
138
|
+
"logs:CreateLogStream",
|
|
139
|
+
"logs:PutLogEvents"
|
|
140
|
+
]
|
|
141
|
+
Resource = [
|
|
142
|
+
"arn:aws:logs:\${local.aws_region}:\${local.aws_account_id}:log-group:/aws/lambda/test-project-test-function-\${random_string.suffix.result}:*"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
Sid = "XRayAccess"
|
|
147
|
+
Effect = "Allow"
|
|
148
|
+
Action = [
|
|
149
|
+
"xray:PutTraceSegments",
|
|
150
|
+
"xray:PutTelemetryRecords"
|
|
151
|
+
]
|
|
152
|
+
Resource = ["*"]
|
|
153
|
+
}
|
|
154
|
+
], var.additional_iam_policy_statements)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
tags = var.tags
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
# Attach the policy to the role
|
|
161
|
+
resource "aws_iam_role_policy_attachment" "lambda_policy_attachment" {
|
|
162
|
+
role = aws_iam_role.lambda_role.name
|
|
163
|
+
policy_arn = aws_iam_policy.lambda_policy.arn
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
data "archive_file" "lambda_zip" {
|
|
167
|
+
type = "zip"
|
|
168
|
+
source_dir = "\${path.module}/../../../../../../../dist/apps/test_project/bundle"
|
|
169
|
+
output_path = "\${path.module}/../../../../../../../dist/packages/common/terraform/lambda-functions/test-project-test-function/lambda.zip"
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
resource "aws_lambda_function" "lambda_function" {
|
|
173
|
+
#checkov:skip=CKV_AWS_117:Lambda function does not need to be in VPC for this use case
|
|
174
|
+
#checkov:skip=CKV_AWS_116:Dead Letter Queue not required for this simple use case
|
|
175
|
+
#checkov:skip=CKV_AWS_272:Code signing not required for this use case
|
|
176
|
+
#checkov:skip=CKV_AWS_115:Concurrent execution limit not required for this use case
|
|
177
|
+
#checkov:skip=CKV_AWS_173:Lambda environment variables encrypted by managed key
|
|
178
|
+
filename = data.archive_file.lambda_zip.output_path
|
|
179
|
+
function_name = "test-project-test-function-\${random_string.suffix.result}"
|
|
180
|
+
role = aws_iam_role.lambda_role.arn
|
|
181
|
+
handler = "test_project.test_function.lambda_handler"
|
|
182
|
+
source_code_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
183
|
+
runtime = "python3.12"
|
|
184
|
+
timeout = 30
|
|
185
|
+
|
|
186
|
+
tracing_config {
|
|
187
|
+
mode = "Active"
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
environment {
|
|
191
|
+
variables = merge({
|
|
192
|
+
AWS_CONNECTION_REUSE_ENABLED = "1"
|
|
193
|
+
}, var.env)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
tags = var.tags
|
|
197
|
+
|
|
198
|
+
depends_on = [aws_iam_role_policy_attachment.lambda_policy_attachment]
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
output "function_name" {
|
|
202
|
+
description = "Name of the Lambda function"
|
|
203
|
+
value = aws_lambda_function.lambda_function.function_name
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
output "function_arn" {
|
|
207
|
+
description = "ARN of the Lambda function"
|
|
208
|
+
value = aws_lambda_function.lambda_function.arn
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
output "role_arn" {
|
|
212
|
+
description = "ARN of the Lambda execution role"
|
|
213
|
+
value = aws_iam_role.lambda_role.arn
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
output "role_name" {
|
|
217
|
+
description = "Name of the Lambda execution role"
|
|
218
|
+
value = aws_iam_role.lambda_role.name
|
|
219
|
+
}
|
|
220
|
+
",
|
|
221
|
+
}
|
|
222
|
+
`;
|
|
223
|
+
|
|
224
|
+
exports[`lambda-handler project generator > terraform iacProvider > should match snapshot for terraform generated files with different configurations > terraform-python-lambda-snapshot-function.tf 1`] = `
|
|
225
|
+
"variable "tags" {
|
|
226
|
+
description = "Tags to apply to resources"
|
|
227
|
+
type = map(string)
|
|
228
|
+
default = {}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
variable "env" {
|
|
232
|
+
description = "Additional environment variables for the Lambda function"
|
|
233
|
+
type = map(string)
|
|
234
|
+
default = {}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
variable "additional_iam_policy_statements" {
|
|
238
|
+
description = "Additional IAM policy statements to attach to the Lambda role"
|
|
239
|
+
type = list(object({
|
|
240
|
+
Effect = string
|
|
241
|
+
Action = list(string)
|
|
242
|
+
Resource = list(string)
|
|
243
|
+
}))
|
|
244
|
+
default = []
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
data "aws_caller_identity" "current" {}
|
|
248
|
+
data "aws_region" "current" {}
|
|
249
|
+
|
|
250
|
+
locals {
|
|
251
|
+
aws_account_id = data.aws_caller_identity.current.account_id
|
|
252
|
+
aws_region = data.aws_region.current.name
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
resource "random_string" "suffix" {
|
|
256
|
+
length = 8
|
|
257
|
+
special = false
|
|
258
|
+
upper = false
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
resource "aws_iam_role" "lambda_role" {
|
|
262
|
+
name = "test-project-snapshot-function-role-\${random_string.suffix.result}"
|
|
263
|
+
|
|
264
|
+
assume_role_policy = jsonencode({
|
|
265
|
+
Version = "2012-10-17"
|
|
266
|
+
Statement = [
|
|
267
|
+
{
|
|
268
|
+
Sid = "LambdaAssumeRolePolicy"
|
|
269
|
+
Effect = "Allow"
|
|
270
|
+
Principal = {
|
|
271
|
+
Service = "lambda.amazonaws.com"
|
|
272
|
+
}
|
|
273
|
+
Action = "sts:AssumeRole"
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
tags = var.tags
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
resource "aws_iam_policy" "lambda_policy" {
|
|
282
|
+
name = "test-project-snapshot-function-policy-\${random_string.suffix.result}"
|
|
283
|
+
description = "Policy for test-project-snapshot-function Lambda function"
|
|
284
|
+
|
|
285
|
+
policy = jsonencode({
|
|
286
|
+
Version = "2012-10-17"
|
|
287
|
+
Statement = concat([
|
|
288
|
+
{
|
|
289
|
+
Sid = "CloudWatchLogsAccess"
|
|
290
|
+
Effect = "Allow"
|
|
291
|
+
Action = [
|
|
292
|
+
"logs:CreateLogGroup",
|
|
293
|
+
"logs:CreateLogStream",
|
|
294
|
+
"logs:PutLogEvents"
|
|
295
|
+
]
|
|
296
|
+
Resource = [
|
|
297
|
+
"arn:aws:logs:\${local.aws_region}:\${local.aws_account_id}:log-group:/aws/lambda/test-project-snapshot-function-\${random_string.suffix.result}:*"
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
Sid = "XRayAccess"
|
|
302
|
+
Effect = "Allow"
|
|
303
|
+
Action = [
|
|
304
|
+
"xray:PutTraceSegments",
|
|
305
|
+
"xray:PutTelemetryRecords"
|
|
306
|
+
]
|
|
307
|
+
Resource = ["*"]
|
|
308
|
+
}
|
|
309
|
+
], var.additional_iam_policy_statements)
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
tags = var.tags
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
# Attach the policy to the role
|
|
316
|
+
resource "aws_iam_role_policy_attachment" "lambda_policy_attachment" {
|
|
317
|
+
role = aws_iam_role.lambda_role.name
|
|
318
|
+
policy_arn = aws_iam_policy.lambda_policy.arn
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
data "archive_file" "lambda_zip" {
|
|
322
|
+
type = "zip"
|
|
323
|
+
source_dir = "\${path.module}/../../../../../../../dist/apps/test_project/bundle"
|
|
324
|
+
output_path = "\${path.module}/../../../../../../../dist/packages/common/terraform/lambda-functions/test-project-snapshot-function/lambda.zip"
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
resource "aws_lambda_function" "lambda_function" {
|
|
328
|
+
#checkov:skip=CKV_AWS_117:Lambda function does not need to be in VPC for this use case
|
|
329
|
+
#checkov:skip=CKV_AWS_116:Dead Letter Queue not required for this simple use case
|
|
330
|
+
#checkov:skip=CKV_AWS_272:Code signing not required for this use case
|
|
331
|
+
#checkov:skip=CKV_AWS_115:Concurrent execution limit not required for this use case
|
|
332
|
+
#checkov:skip=CKV_AWS_173:Lambda environment variables encrypted by managed key
|
|
333
|
+
filename = data.archive_file.lambda_zip.output_path
|
|
334
|
+
function_name = "test-project-snapshot-function-\${random_string.suffix.result}"
|
|
335
|
+
role = aws_iam_role.lambda_role.arn
|
|
336
|
+
handler = "test_project.snapshot_function.lambda_handler"
|
|
337
|
+
source_code_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
338
|
+
runtime = "python3.12"
|
|
339
|
+
timeout = 30
|
|
340
|
+
|
|
341
|
+
tracing_config {
|
|
342
|
+
mode = "Active"
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
environment {
|
|
346
|
+
variables = merge({
|
|
347
|
+
AWS_CONNECTION_REUSE_ENABLED = "1"
|
|
348
|
+
}, var.env)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
tags = var.tags
|
|
352
|
+
|
|
353
|
+
depends_on = [aws_iam_role_policy_attachment.lambda_policy_attachment]
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
output "function_name" {
|
|
357
|
+
description = "Name of the Lambda function"
|
|
358
|
+
value = aws_lambda_function.lambda_function.function_name
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
output "function_arn" {
|
|
362
|
+
description = "ARN of the Lambda function"
|
|
363
|
+
value = aws_lambda_function.lambda_function.arn
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
output "role_arn" {
|
|
367
|
+
description = "ARN of the Lambda execution role"
|
|
368
|
+
value = aws_iam_role.lambda_role.arn
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
output "role_name" {
|
|
372
|
+
description = "Name of the Lambda execution role"
|
|
373
|
+
value = aws_iam_role.lambda_role.name
|
|
374
|
+
}
|
|
375
|
+
"
|
|
376
|
+
`;
|
|
@@ -10,9 +10,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
10
10
|
const provider_1 = require("@nxlv/python/src/provider/uv/provider");
|
|
11
11
|
const logger_1 = require("@nxlv/python/src/executors/utils/logger");
|
|
12
12
|
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
13
|
-
const shared_constructs_constants_1 = require("../../utils/shared-constructs-constants");
|
|
14
13
|
const names_1 = require("../../utils/names");
|
|
15
|
-
const ast_1 = require("../../utils/ast");
|
|
16
14
|
const format_1 = require("../../utils/format");
|
|
17
15
|
const npm_scope_1 = require("../../utils/npm-scope");
|
|
18
16
|
const object_1 = require("../../utils/object");
|
|
@@ -20,6 +18,7 @@ const nx_1 = require("../../utils/nx");
|
|
|
20
18
|
const metrics_1 = require("../../utils/metrics");
|
|
21
19
|
const bundle_1 = require("../../utils/bundle");
|
|
22
20
|
const py_1 = require("../../utils/py");
|
|
21
|
+
const function_constructs_1 = require("../../utils/function-constructs/function-constructs");
|
|
23
22
|
exports.LAMBDA_FUNCTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
24
23
|
const getLambdaFunctionDetails = (tree, schema) => {
|
|
25
24
|
const scope = (0, names_1.toSnakeCase)((0, npm_scope_1.getNpmScope)(tree));
|
|
@@ -52,7 +51,7 @@ const pyLambdaFunctionGenerator = (tree, schema) => tslib_1.__awaiter(void 0, vo
|
|
|
52
51
|
// Module name is the last part of the source root,
|
|
53
52
|
const sourceParts = projectConfig.sourceRoot.split('/');
|
|
54
53
|
const moduleName = sourceParts[sourceParts.length - 1];
|
|
55
|
-
const {
|
|
54
|
+
const { normalizedFunctionName, normalizedFunctionPath } = getLambdaFunctionDetails(tree, {
|
|
56
55
|
moduleName,
|
|
57
56
|
functionName: schema.functionName,
|
|
58
57
|
functionPath: schema.functionPath,
|
|
@@ -66,10 +65,20 @@ const pyLambdaFunctionGenerator = (tree, schema) => tslib_1.__awaiter(void 0, vo
|
|
|
66
65
|
if (tree.exists(functionPath)) {
|
|
67
66
|
throw new Error(`This project already has a a lambda function with the name ${normalizedFunctionName}. Please remove the lambda function before running this generator or use a different name.`);
|
|
68
67
|
}
|
|
69
|
-
yield (0, shared_constructs_1.sharedConstructsGenerator)(tree
|
|
68
|
+
yield (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
69
|
+
iacProvider: schema.iacProvider,
|
|
70
|
+
});
|
|
71
|
+
(0, function_constructs_1.addLambdaFunctionInfra)(tree, {
|
|
72
|
+
functionProjectName: projectConfig.name,
|
|
73
|
+
functionNameClassName: constructFunctionClassName,
|
|
74
|
+
functionNameKebabCase: constructFunctionKebabCase,
|
|
75
|
+
handler: normalizedFunctionPath,
|
|
76
|
+
bundlePathFromRoot: `dist/${dir}/bundle`,
|
|
77
|
+
runtime: 'python',
|
|
78
|
+
iacProvider: schema.iacProvider,
|
|
79
|
+
});
|
|
70
80
|
const enhancedOptions = Object.assign(Object.assign({}, schema), { dir,
|
|
71
|
-
|
|
72
|
-
constructFunctionKebabCase, constructHandlerFilePath: normalizedFunctionPath, lambdaFunctionClassName, lambdaFunctionSnakeCase: normalizedFunctionName });
|
|
81
|
+
lambdaFunctionClassName, lambdaFunctionSnakeCase: normalizedFunctionName });
|
|
73
82
|
// Check if the project has a bundle target and if not add it
|
|
74
83
|
(0, bundle_1.addPythonBundleTarget)(projectConfig);
|
|
75
84
|
projectConfig.targets = (0, object_1.sortObjectKeys)(projectConfig.targets);
|
|
@@ -80,25 +89,6 @@ const pyLambdaFunctionGenerator = (tree, schema) => tslib_1.__awaiter(void 0, vo
|
|
|
80
89
|
(0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, (_b = schema.functionPath) !== null && _b !== void 0 ? _b : ''), enhancedOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.Overwrite });
|
|
81
90
|
// Generate the lambda handler test file
|
|
82
91
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'tests'), (0, devkit_1.joinPathFragments)(dir, 'tests'), enhancedOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.Overwrite });
|
|
83
|
-
if (!tree.exists((0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR, 'src', 'app', 'lambda-functions', `${constructFunctionKebabCase}.ts`))) {
|
|
84
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR, 'src', 'app'), (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR, 'src', 'app'), enhancedOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
85
|
-
(0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR, 'src', 'app', 'index.ts'), './lambda-functions/index.js');
|
|
86
|
-
(0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR, 'src', 'app', 'lambda-functions', 'index.ts'), `./${constructFunctionKebabCase}.js`);
|
|
87
|
-
}
|
|
88
|
-
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR, 'project.json'), (config) => {
|
|
89
|
-
var _a;
|
|
90
|
-
if (!config.targets) {
|
|
91
|
-
config.targets = {};
|
|
92
|
-
}
|
|
93
|
-
if (!config.targets.build) {
|
|
94
|
-
config.targets.build = {};
|
|
95
|
-
}
|
|
96
|
-
config.targets.build.dependsOn = [
|
|
97
|
-
...((_a = config.targets.build.dependsOn) !== null && _a !== void 0 ? _a : []).filter((t) => t !== `${projectConfig.name}:build`),
|
|
98
|
-
`${projectConfig.name}:build`,
|
|
99
|
-
];
|
|
100
|
-
return config;
|
|
101
|
-
});
|
|
102
92
|
(0, py_1.addDependenciesToPyProjectToml)(tree, dir, [
|
|
103
93
|
'aws-lambda-powertools',
|
|
104
94
|
'aws-lambda-powertools[tracer]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/lambda-function/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-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CAAC,EAC/B,eAAe,EACf,EAAE,iBAAiB,EAAE,0BAAiB,CAAC,SAAS,EAAE,CACnD,CAAC;IAEF,IAAA,mCAA8B,EAAC,IAAI,EAAE,GAAG,EAAE;QACxC,uBAAuB;QACvB,+BAA+B;QAC/B,+BAA+B;KAChC,CAAC,CAAC;IAEH,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,sCAA8B,CAAC,CAAC,CAAC;IAE9E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IAEjC,OAAO,GAAS,EAAE;QAChB,MAAM,IAAI,qBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,eAAM,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAA,CAAC;AACJ,CAAC,CAAA,CAAC;AApHW,QAAA,yBAAyB,6BAoHpC;AACF,kBAAe,iCAAyB,CAAC"}
|
|
@@ -74,6 +74,14 @@
|
|
|
74
74
|
],
|
|
75
75
|
"default": "Any",
|
|
76
76
|
"x-prompt": "Enter the event source model to use for the lambda function"
|
|
77
|
+
},
|
|
78
|
+
"iacProvider": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "The preferred IaC provider",
|
|
81
|
+
"enum": ["CDK", "Terraform"],
|
|
82
|
+
"x-priority": "important",
|
|
83
|
+
"default": "CDK",
|
|
84
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: CDK)"
|
|
77
85
|
}
|
|
78
86
|
},
|
|
79
87
|
"required": ["project", "functionName"]
|