File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -118,23 +118,23 @@ resource "aws_api_gateway_integration" "root_method_integration" {
118118}
119119
120120resource "aws_api_gateway_resource" "resource" {
121- count = length (var. method-paths )
122- path_part = var. method-paths [count . index ]
121+ count = length (var. methods )
122+ path_part = var. methods [count . index ]. path
123123 parent_id = aws_api_gateway_rest_api. api . root_resource_id
124124 rest_api_id = aws_api_gateway_rest_api. api . id
125125}
126126
127127resource "aws_api_gateway_method" "method" {
128- count = length (var. method-paths )
128+ count = length (var. methods )
129129 rest_api_id = aws_api_gateway_rest_api. api . id
130130 resource_id = aws_api_gateway_resource. resource [count . index ]. id
131- http_method = var. method-types [count . index ]
131+ http_method = var. methods [count . index ]. type
132132 authorization = var. resource-authorization
133133 request_parameters = var. resource-request-params
134134}
135135
136136resource "aws_api_gateway_integration" "integration" {
137- count = length (var. method-paths )
137+ count = length (var. methods )
138138 rest_api_id = aws_api_gateway_rest_api. api . id
139139 resource_id = aws_api_gateway_resource. resource [count . index ]. id
140140 http_method = aws_api_gateway_method. method [count . index ]. http_method
Original file line number Diff line number Diff line change @@ -42,14 +42,11 @@ variable "account-id" {
4242 type = string
4343}
4444
45- variable "method-paths" {
46- type = list (string )
47- default = []
48- }
49-
50- variable "method-types" {
51- type = list (string )
52- default = []
45+ variable "methods" {
46+ type = list (object ({
47+ path = string
48+ type = string
49+ }))
5350}
5451
5552variable "root-resource" {
You can’t perform that action at this time.
0 commit comments