-
Notifications
You must be signed in to change notification settings - Fork 3
feat: weka-api aws lambda #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
65b2b6d
to
c59648f
Compare
468f910
to
fed0539
Compare
d77e1a6
to
a4fc05c
Compare
lambdas.tf
Outdated
@@ -61,6 +61,7 @@ resource "aws_lambda_function" "deploy_lambda" { | |||
REPORT_LAMBDA_NAME = aws_lambda_function.report_lambda.function_name | |||
FETCH_LAMBDA_NAME = aws_lambda_function.fetch_lambda.function_name | |||
STATUS_LAMBDA_NAME = aws_lambda_function.status_lambda.function_name | |||
WEKA_API_LAMBDA_NAME = aws_lambda_function.weka_api_lambda.function_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed here
protocol_gateways.tf
Outdated
@@ -31,6 +31,7 @@ module "smb_protocol_gateways" { | |||
report_lambda_name = aws_lambda_function.report_lambda.function_name | |||
fetch_lambda_name = aws_lambda_function.fetch_lambda.function_name | |||
status_lambda_name = aws_lambda_function.status_lambda.function_name | |||
weka_api_lambda_name = aws_lambda_function.weka_api_lambda.function_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed here
protocol_gateways.tf
Outdated
@@ -69,6 +70,7 @@ module "s3_protocol_gateways" { | |||
report_lambda_name = aws_lambda_function.report_lambda.function_name | |||
fetch_lambda_name = aws_lambda_function.fetch_lambda.function_name | |||
status_lambda_name = aws_lambda_function.status_lambda.function_name | |||
weka_api_lambda_name = aws_lambda_function.weka_api_lambda.function_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed here
protocol_gateways.tf
Outdated
@@ -107,6 +109,7 @@ module "nfs_protocol_gateways" { | |||
report_lambda_name = aws_lambda_function.report_lambda.function_name | |||
fetch_lambda_name = aws_lambda_function.fetch_lambda.function_name | |||
status_lambda_name = aws_lambda_function.status_lambda.function_name | |||
weka_api_lambda_name = aws_lambda_function.weka_api_lambda.function_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed here
modules/protocol_gateways/iam.tf
Outdated
@@ -95,6 +95,7 @@ resource "aws_iam_policy" "invoke_lambda_function" { | |||
"arn:aws:lambda:*:*:function:${var.report_lambda_name}*", | |||
"arn:aws:lambda:*:*:function:${var.fetch_lambda_name}*", | |||
"arn:aws:lambda:*:*:function:${var.status_lambda_name}*", | |||
"arn:aws:lambda:*:*:function:${var.weka_api_lambda_name}*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed here
lambdas/main.go
Outdated
@@ -439,6 +440,10 @@ func managementHandler(ctx context.Context, req management.ManagementRequest) (p | |||
} | |||
} | |||
|
|||
func wekaApiHandler(ctx context.Context, req weka_api.WekaApiRequest) (*weka_api.WekaApiResponse, error) { | |||
return weka_api.MakeWekaApiRequest(ctx, req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code isn't doing anything
3d18788
to
181e9f6
Compare
2a40191
to
798b93f
Compare
778871d
to
4c86c72
Compare
0332608
to
4facc95
Compare
81658d7
to
1e040ff
Compare
4b922fa
to
77ec9eb
Compare
15b77ef
to
b703fa3
Compare
lambdas.tf
Outdated
environment { | ||
variables = { | ||
LAMBDA = "weka-api" | ||
STATE_TABLE = local.dynamodb_table_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove the unused env vars
// the payload for that specific operation. | ||
// | ||
// At this time, the only operation supported is "status" | ||
type ManagementRequest struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this struct can be removed, we should only use WekaApiRequest
and do the required updates to the current status implementation
286425c
to
494e9f8
Compare
626d829
to
3396d96
Compare
4e626f2
to
cfd2af6
Compare
0f43fc8
to
aa613d8
Compare
387ef9c
to
ad2fe5a
Compare
e39d1b4
to
ad2fe5a
Compare
84cb188
to
08217c6
Compare
4b5cdfb
to
f4942cf
Compare
5678484
to
a4f64c5
Compare
3a38edb
to
01ec80a
Compare
8885e6b
to
01ec80a
Compare
return r, nil | ||
} | ||
|
||
func invokeManagementLambda[T any](ctx context.Context, wr *management.WekaApiRequest) (response *T, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just interface?
3733e81
to
cafc845
Compare
2c0ff3d
to
74b5c02
Compare
ed3d98c
to
392326a
Compare
7e0bff5
to
976d571
Compare
221caf0
to
f44f34e
Compare
https://wekaio.atlassian.net/browse/CLOUD-2804
WIP