This repository was archived by the owner on Oct 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +17
-22
lines changed
Expand file tree Collapse file tree 6 files changed +17
-22
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ module "db" {
7171
7272module "api-gateway" {
7373 source = " ./modules/api-gateway"
74+
75+ region = local. region
76+ tags = local. tags
7477}
7578
7679# ###############################################################################
Original file line number Diff line number Diff line change 11resource "aws_api_gateway_rest_api" "minha_api" {
2- name = " my-api "
3- description = " My API Gateway "
2+ name = " rms-bff "
3+ description = " BFF do Restaurant Management System "
44}
55
66# resource "aws_api_gateway_authorizer" "my_authorizer" {
@@ -9,8 +9,3 @@ resource "aws_api_gateway_rest_api" "minha_api" {
99# type = "COGNITO_USER_POOLS"
1010# provider_arns = [var.cognito_arn]
1111# }
12-
13-
14-
15-
16-
Original file line number Diff line number Diff line change @@ -5,4 +5,3 @@ output "api_gateway_id" {
55# output "resource_id" {
66# value = aws_api_gateway_resource.my_resource.id
77# }
8-
Original file line number Diff line number Diff line change 1- # main.tf
2-
31provider "aws" {
4- region = " us-east-1 "
2+ region = var . region
53}
64
75module "gateway" {
@@ -14,22 +12,19 @@ module "rotas_api" {
1412 rotas = [
1513 {
1614 path = " catalogo"
17- http_method = " GET "
18- uri = " https ://exemplo .com/rota1"
15+ http_method = " ANY "
16+ uri = " http ://www.example .com/rota1"
1917 },
2018 {
2119 path = " pedido"
22- http_method = " POST "
23- uri = " https ://exemplo. com/rota2 "
20+ http_method = " ANY "
21+ uri = " http ://www.example. com/pedido "
2422 },
2523 {
2624 path = " pagamento"
27- http_method = " POST "
28- uri = " https ://exemplo .com/rota3"
25+ http_method = " ANY "
26+ uri = " http ://www.example .com/rota3"
2927 },
3028 # Adicione quantas rotas você precisar
3129 ]
3230}
33-
34-
35-
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ variable "rotas" {
88
99variable "gateway_id" {}
1010
11-
1211resource "aws_api_gateway_resource" "my_resource" {
1312 for_each = { for idx , rota in var . rotas : idx => rota }
1413
@@ -17,7 +16,6 @@ resource "aws_api_gateway_resource" "my_resource" {
1716 path_part = each. value . path
1817}
1918
20-
2119resource "aws_api_gateway_method" "rotas" {
2220 for_each = { for idx , rota in var . rotas : idx => rota }
2321
Original file line number Diff line number Diff line change @@ -7,3 +7,8 @@ variable "region" {
77 default = " us-east-1"
88}
99
10+ variable "tags" {
11+ description = " Tags to set."
12+ type = map (string )
13+ default = {}
14+ }
You can’t perform that action at this time.
0 commit comments