This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_api_gateway_integration" "fetch_object" { | |
rest_api_id = aws_api_gateway_rest_api.photo_location_map.id | |
resource_id = aws_api_gateway_resource.fetch_object.id | |
http_method = aws_api_gateway_method.fetch_object_get.http_method | |
integration_http_method = "POST" | |
type = "AWS_PROXY" | |
uri = aws_lambda_function.fetch_object_lambda.invoke_arn | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_api_gateway_method" "fetch_object_get" { | |
rest_api_id = aws_api_gateway_rest_api.photo_location_map.id | |
resource_id = aws_api_gateway_resource.fetch_object.id | |
http_method = "GET" | |
authorization = "NONE" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_api_gateway_resource" "fetch_object" { | |
rest_api_id = aws_api_gateway_rest_api.photo_location_map.id | |
parent_id = aws_api_gateway_rest_api.photo_location_map.root_resource_id | |
path_part = local.api_gateway_fetch_object_path | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_lambda_permission" "apigw_invoke_fetch_object_lambda" { | |
statement_id = "AllowAPIGatewayInvoke" | |
action = "lambda:InvokeFunction" | |
function_name = aws_lambda_function.fetch_object_lambda.function_name | |
principal = "apigateway.amazonaws.com" | |
source_arn = "${aws_api_gateway_rest_api.photo_location_map.execution_arn}/*/*" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_api_gateway_rest_api" "photo_location_map" { | |
name = "${local.api_gateway_rest_api_name_prefix}-api-gw" | |
description = "API Gateway to front lambdas used to plot photo locations on a map" | |
endpoint_configuration { | |
types = ["REGIONAL"] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output "cognito_ui_url" { | |
value = "https://${aws_cognito_user_pool.user_pool.domain}.auth.${local.region}.amazoncognito.com/login?client_id=${aws_cognito_user_pool_client.user_pool_client.id}&response_type=code&scope=openid&redirect_uri=${tolist(aws_cognito_user_pool_client.user_pool_client.callback_urls)[0]}" | |
depends_on = [aws_cognito_user_pool.user_pool] | |
} | |
output "cognito_user_pool_id" { | |
value = aws_cognito_user_pool.user_pool.id | |
} | |
output "cognito_user_pool_client_id" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cognito_user_pool_domain" "user_pool_domain" { | |
domain = local.cognito_user_pool_domain # Must be globally unique | |
user_pool_id = aws_cognito_user_pool.user_pool.id | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cognito_user_pool_client" "user_pool_client" { | |
name = local.cognito_user_pool_client_name | |
user_pool_id = aws_cognito_user_pool.user_pool.id | |
supported_identity_providers = ["COGNITO"] | |
# Do not generate a client secret for browser-based apps | |
generate_secret = false | |
# Allowed OAuth flows and scopes for the hosted UI. | |
allowed_oauth_flows_user_pool_client = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cognito_user_pool" "user_pool" { | |
name = local.cognito_user_pool_name | |
# Customize password policy, MFA, etc., as needed | |
password_policy { | |
minimum_length = local.cognito_password_policy.minimum_length | |
require_uppercase = local.cognito_password_policy.require_uppercase | |
require_lowercase = local.cognito_password_policy.require_lowercase | |
require_numbers = local.cognito_password_policy.require_numbers | |
require_symbols = local.cognito_password_policy.require_symbols |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
storageClass: | |
name: s3-storageclass | |
provisioner: s3.csi.aws.com # Provisioner for AWS S3 | |
parameters: | |
type: standard | |
persistentVolume: | |
name: s3-pv | |
capacity: | |
storageSize: 5Gi |