Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rugggger
Copy link

@rugggger rugggger commented Dec 1, 2024

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed here

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed here

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed here

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed here

@@ -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}*",
Copy link
Collaborator

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)
Copy link
Collaborator

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

@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 3d18788 to 181e9f6 Compare December 4, 2024 07:50
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 2a40191 to 798b93f Compare December 4, 2024 07:59
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 778871d to 4c86c72 Compare December 4, 2024 08:07
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 0332608 to 4facc95 Compare December 4, 2024 09:04
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 81658d7 to 1e040ff Compare December 4, 2024 09:35
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 4b922fa to 77ec9eb Compare December 4, 2024 10:13
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 15b77ef to b703fa3 Compare December 4, 2024 12:58
@rugggger rugggger requested a review from assafgi December 4, 2024 13:03
lambdas.tf Outdated
environment {
variables = {
LAMBDA = "weka-api"
STATE_TABLE = local.dynamodb_table_name
Copy link
Collaborator

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 {
Copy link
Collaborator

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

@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 0f43fc8 to aa613d8 Compare December 19, 2024 10:26
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 387ef9c to ad2fe5a Compare December 19, 2024 10:44
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from e39d1b4 to ad2fe5a Compare December 19, 2024 10:47
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 84cb188 to 08217c6 Compare December 22, 2024 11:21
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 4b5cdfb to f4942cf Compare December 22, 2024 11:22
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 5678484 to a4f64c5 Compare December 23, 2024 09:20
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 3a38edb to 01ec80a Compare January 6, 2025 12:48
@rugggger rugggger force-pushed the CLOUD-2804/weka-api-lambda branch from 8885e6b to 01ec80a Compare January 6, 2025 12:59
return r, nil
}

func invokeManagementLambda[T any](ctx context.Context, wr *management.WekaApiRequest) (response *T, err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just interface?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants