https://github.com/amancevice/terraform-aws-serverless-pypi-cognito
Basic auth for the serverless-pypi Terraform module using AWS Cognito
https://github.com/amancevice/terraform-aws-serverless-pypi-cognito
Last synced: 3 months ago
JSON representation
Basic auth for the serverless-pypi Terraform module using AWS Cognito
- Host: GitHub
- URL: https://github.com/amancevice/terraform-aws-serverless-pypi-cognito
- Owner: amancevice
- License: mit
- Archived: true
- Created: 2020-02-01T14:08:13.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-30T21:15:43.000Z (over 3 years ago)
- Last Synced: 2024-12-18T14:48:06.464Z (5 months ago)
- Language: HCL
- Homepage:
- Size: 57.6 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Serverless PyPI with Cognito
[](https://registry.terraform.io/modules/amancevice/serverless-pypi/aws)
[](https://github.com/amancevice/terraform-aws-serverless-pypi-cognito/actions)
[](https://codeclimate.com/github/amancevice/terraform-aws-serverless-pypi-cognito/test_coverage)
[](https://codeclimate.com/github/amancevice/terraform-aws-serverless-pypi-cognito/maintainability)Secure a serverless PyPI deployed with the [serverless-pypi](https://github.com/amancevice/terraform-aws-serverless-pypi) Terraform module using AWS Cognito and Basic Authentication.
## Usage
Provide a single username and password to the module to create an API Gateway authorizer function for your serverless PyPI:
```terraform
resource "aws_apigatewayv2_api" "pypi" {
name = "pypi"
protocol_type = "HTTP"
# …
}module serverless_pypi {
source = "amancevice/serverless-pypi-cognito/aws"
version = "~> 4.1"api_authorization_type = "CUSTOM"
api_authorizer_id = module.serverless_pypi_cognito.authorizer.id
# …
}module serverless_pypi_cognito {
source = "amancevice/serverless-pypi-cognito/aws"
version = "~> 3.0"api_id = aws_apigatewayv2_api.pypi.id
cognito_user_pool_name = "serverless-pypi-cognito-pool"
iam_role_name = module.serverless_pypi.iam_role.name
lambda_function_name = "serverless-pypi-authorizer"
}
```