Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neilharia7/terraform-aws-openapi-gateway
Terraform module that creates an API Gateway using OpenAPI YAML file with an optional authorizer
https://github.com/neilharia7/terraform-aws-openapi-gateway
api-gateways aws devops-platform hcl openapi3 terraform terraform-aws-module terraform-modules
Last synced: 4 months ago
JSON representation
Terraform module that creates an API Gateway using OpenAPI YAML file with an optional authorizer
- Host: GitHub
- URL: https://github.com/neilharia7/terraform-aws-openapi-gateway
- Owner: neilharia7
- Created: 2024-02-06T11:44:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-12T11:59:24.000Z (6 months ago)
- Last Synced: 2024-09-27T19:01:23.556Z (4 months ago)
- Topics: api-gateways, aws, devops-platform, hcl, openapi3, terraform, terraform-aws-module, terraform-modules
- Language: HCL
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# terraform-aws-openapi-gateway
Terraform module that creates an API Gateway using OpenAPI YAML file with an optional authorizer## Usage
```hcl
data "github_repository_file" "workspace_open_api_file" {
repository = ""
branch = ""
file = ""
}locals {
open_api_file = data.github_repository_file.workspace_open_api_file.content
update_region = replace(local.open_api_file, "$${AWS::Region}", var.region)
cleanup = replace(local.update_region, "Fn::Sub:", "")
update_lambda = replace(local.cleanup, "$${Lambda.Arn}", aws_lambda_function.pet_function.function_arn) # replace with your function arn
final = replace(local.update_lambda, "$${CognitoLambda.Arn}", aws_lambda_function.cognito_function.function_arn) # replace with your cognito function arn
}module "openapi_gateway" {
source = "git::[email protected]:neilharia7/terraform-aws-openapi-gateway"
name = "api-gw"
enable_authorizer = true
authorizer_function_name = aws_lambda_function.cognito_function.function_name # replace with your cognito function arn
lambda_handler_function_name = aws_lambda_function.pet_function.function_name # replace with your function name
triggers = {
redeployment = local.final
}
types = ["REGIONAL"]
body = local.final
}
```## Requirements
| Name | Version |
|------|-----------|
| [terraform](#requirement\_terraform) | >= 0.15.0 |
| [aws](#requirement\_aws) | >= 3.69.0 |## Providers
| Name | Version |
|------|-----------|
| [aws](#provider\_aws) | >= 3.69.0 |