Skip to content

Commit

Permalink
chore: debug not working apigw
Browse files Browse the repository at this point in the history
  • Loading branch information
Cupprum committed Aug 12, 2024
1 parent 7ebff47 commit 4fa5b40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cicd/dagger/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dagger call apply \
--secret_key="env:SEATCHECKER_AWS_SECRET_ACCESS_KEY" \
--honeycomb_api_key="env:SEATCHECKER_HONEYCOMB_API_KEY"

# # Destroy Infra
# Destroy Infra
# dagger call destroy \
# --seatchecker="../../logic/seatchecker" \
# --notifier="../../logic/notifier" \
Expand Down
22 changes: 1 addition & 21 deletions infra/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_apigatewayv2_integration" "trigger_step_function" {
description = "Invoke Step Functions"
integration_type = "AWS_PROXY"
integration_subtype = "StepFunctions-StartExecution"
credentials_arn = module.step-functions.role_arn
credentials_arn = module.step-functions.role_arn // TODO: create this role, which is assumable by apigw, and allows to trigger stepfunction
payload_format_version = "1.0"
request_parameters = {
"StateMachineArn" = module.step-functions.state_machine_arn
Expand All @@ -22,28 +22,8 @@ resource "aws_apigatewayv2_route" "trigger_step_function" {
target = "integrations/${aws_apigatewayv2_integration.trigger_step_function.id}"
}

// TODO: logs are not configured properly, iam permissions are missing
# resource "aws_cloudwatch_log_group" "apigateway" {
# name = "/aws/apigateway/${aws_apigatewayv2_api.seatchecker.name}"
# retention_in_days = 3
# }

resource "aws_apigatewayv2_stage" "deployment" {
api_id = aws_apigatewayv2_api.seatchecker.id
name = "$default"
auto_deploy = true
# access_log_settings {
# destination_arn = aws_cloudwatch_log_group.apigateway.arn
# format = jsonencode({
# "requestId" : "$context.requestId"
# "ip" : "$context.identity.sourceIp"
# "requestTime" : "$context.requestTime"
# "httpMethod" : "$context.httpMethod"
# "routeKey" : "$context.routeKey"
# "status" : "$context.status"
# "protocol" : "$context.protocol"
# "responseLength" : "$context.responseLength"
# "authorizationError" : "$context.authorizer.error"
# })
# }
}
3 changes: 2 additions & 1 deletion infra/seatchecker_stepfunction.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module "step-functions" {
definition = templatefile("./seatchecker.asl.json", {})
name = "seatchecker_stepfunction"
create_role = true
trusted_entities = ["apigateway.amazonaws.com"] // TODO: verify if this should be present here, but there is a high change that maybe yes
service_integrations = { # will automatically create policies to attach to the role
lambda = {
lambda = [
Expand All @@ -12,4 +13,4 @@ module "step-functions" {
]
}
}
}
}

0 comments on commit 4fa5b40

Please sign in to comment.