Skip to content

Commit

Permalink
Remove unused comments and codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianliuwk1019 committed Nov 22, 2023
1 parent 8eaf28b commit e444170
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions infrastructure/server/admin_management_api_gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,7 @@ resource "aws_api_gateway_integration" "admin_management_api_gateway_integration
]
}

# TODO: not sure why original api has this, comment out for now.
# resource "aws_api_gateway_method" "admin_management_api_gateway_method_proxy_root" {
# rest_api_id = aws_api_gateway_rest_api.admin_management_api_gateway_rest_api.id
# resource_id = aws_api_gateway_rest_api.admin_management_api_gateway_rest_api.root_resource_id
# http_method = "ANY"
# authorization = "NONE"
# }

# TODO: not sure why original api has this, comment out for now.
# resource "aws_api_gateway_integration" "admin_management_api_gateway_integration_proxy_root" {
# rest_api_id = aws_api_gateway_rest_api.admin_management_api_gateway_rest_api.id
# resource_id = aws_api_gateway_method.admin_management_api_gateway_method_proxy_root.resource_id
# http_method = aws_api_gateway_method.admin_management_api_gateway_method_proxy_root.http_method

# integration_http_method = "POST"
# type = "AWS_PROXY"
# uri = aws_lambda_function.fam_admin_management_api_function.invoke_arn
# }


resource "aws_api_gateway_deployment" "admin_management_api_gateway_deployment" {
# TODO: remove this after success deployment.
# Terraform doc says: The triggers argument should be preferred over depends_on
# depends_on = [
# aws_api_gateway_integration.admin_management_api_gateway_integration_proxy,
# # aws_api_gateway_integration.admin_management_api_gateway_integration_proxy_root
# ]

rest_api_id = aws_api_gateway_rest_api.admin_management_api_gateway_rest_api.id

depends_on = [
Expand All @@ -81,18 +54,11 @@ resource "aws_api_gateway_deployment" "admin_management_api_gateway_deployment"
# using whole resouce with filesha1() that may be consider in the future.
}

# TODO: remove this after success deployment.
# stage_name = var.api_gateway_stage_name # Terraform warns about using "stage_name" in resource "aws_api_gateway_deployment".
# See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_deployment
# If possible in the future, use "aws_api_gateway_stage" resource instead. But may face issue about:
# Error: creating API Gateway Stage (v1): ConflictException: Stage already exists.
lifecycle {
create_before_destroy = true
}
}

# TODO: remove comment after success deployment.
# Terraform docs says "aws_api_gateway_stage" is preferred over "stage_name" in resource "aws_api_gateway_deployment"
resource "aws_api_gateway_stage" "admin_management_api_gateway_stage" {
deployment_id = aws_api_gateway_deployment.admin_management_api_gateway_deployment.id
rest_api_id = aws_api_gateway_rest_api.admin_management_api_gateway_rest_api.id
Expand Down

0 comments on commit e444170

Please sign in to comment.