1+ ---
2+ #
3+ # This is the canonical configuration for the `README.md`
4+ # Run `make readme` to rebuild the `README.md`
5+ #
6+
7+ # Name of this project
8+ name : Terraform AWS Api Gateway
9+
10+ # License of this project
11+ license : " MIT"
12+
13+ # Canonical GitHub repo
14+ github_repo : clouddrove/terraform-aws-api-gateway
15+
16+ # Badges to display
17+ badges :
18+ - name : " Terraform"
19+ image : " https://img.shields.io/badge/Terraform-v0.12-green"
20+ url : " https://www.terraform.io"
21+ - name : " Licence"
22+ image : " https://img.shields.io/badge/License-MIT-blue.svg"
23+ url : " LICENSE.md"
24+
25+ # description of this project
26+ description : |-
27+ Terraform module to create Route53 resource on AWS for create api gateway with it's basic elements.
28+
29+ # extra content
30+ # please not remove these two If you need add more
31+ include :
32+ - " terraform.md"
33+
34+ # How to use this project
35+ usage : |-
36+ Here are examples of how you can use this module in your inventory structure:
37+ ### Basic Example
38+ ```hcl
39+ module "api-gateway" {
40+ source = "git::https://github.com/clouddrove/terraform-aws-api-gateway.git?ref=tags/0.12.0"
41+ name = "api-gateway"
42+ application = "clouddrove"
43+ environment = "test"
44+ label_order = ["environment", "name", "application"]
45+ enabled = true
46+
47+ # Api Gateway Resource
48+ path_parts = ["mytestresource", "mytestresource1"]
49+
50+ # Api Gateway Method
51+ method_enabled = true
52+ http_methods = ["GET", "GET"]
53+
54+ # Api Gateway Integration
55+ integration_types = ["MOCK", "AWS_PROXY"]
56+ integration_http_methods = ["POST", "POST"]
57+ uri = ["", "arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:xxxxxxxxxx:function:test/invocations"]
58+ integration_request_parameters = [{
59+ "integration.request.header.X-Authorization" = "'static'"
60+ }, {}]
61+ request_templates = [{
62+ "application/xml" = <<EOF
63+ {
64+ "body" : $input.json('$')
65+ }
66+ EOF
67+ }, {}]
68+
69+ # Api Gateway Method Response
70+ status_codes = [200, 200]
71+ response_models = [{ "application/json" = "Empty" }, {}]
72+ response_parameters = [{ "method.response.header.X-Some-Header" = true }, {}]
73+
74+ # Api Gateway Integration Response
75+ integration_response_parameters = [{ "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }, {}]
76+ response_templates = [{
77+ "application/xml" = <<EOF
78+ #set($inputRoot = $input.path('$'))
79+ <?xml version="1.0" encoding="UTF-8"?>
80+ <message>
81+ $inputRoot.body
82+ </message>
83+ EOF
84+ }, {}]
85+
86+ # Api Gateway Deployment
87+ deployment_enabled = true
88+ stage_name = "deploy"
89+
90+ # Api Gateway Stage
91+ stage_enabled = true
92+ stage_names = ["qa", "dev"]
93+ }
94+ ```
95+ ### Complete Example
96+ ```hcl
97+ module "api-gateway" {
98+ source = "git::https://github.com/clouddrove/terraform-aws-api-gateway.git?ref=tags/0.12.0"
99+ name = "api-gateway"
100+ application = "clouddrove"
101+ environment = "test"
102+ label_order = ["environment", "name", "application"]
103+ enabled = true
104+
105+ # Api Gateway Resource
106+ path_parts = ["mytestresource", "mytestresource1"]
107+
108+ # Api Gateway Method
109+ method_enabled = true
110+ http_methods = ["GET", "GET"]
111+
112+ # Api Gateway Integration
113+ integration_types = ["MOCK", "AWS_PROXY"]
114+ integration_http_methods = ["POST", "POST"]
115+ uri = ["", "arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:xxxxxxxxxx:function:test/invocations"]
116+ integration_request_parameters = [{
117+ "integration.request.header.X-Authorization" = "'static'"
118+ }, {}]
119+ request_templates = [{
120+ "application/xml" = <<EOF
121+ {
122+ "body" : $input.json('$')
123+ }
124+ EOF
125+ }, {}]
126+
127+ # Api Gateway Method Response
128+ status_codes = [200, 200]
129+ response_models = [{ "application/json" = "Empty" }, {}]
130+ response_parameters = [{ "method.response.header.X-Some-Header" = true }, {}]
131+
132+ # Api Gateway Integration Response
133+ integration_response_parameters = [{ "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }, {}]
134+ response_templates = [{
135+ "application/xml" = <<EOF
136+ #set($inputRoot = $input.path('$'))
137+ <?xml version="1.0" encoding="UTF-8"?>
138+ <message>
139+ $inputRoot.body
140+ </message>
141+ EOF
142+ }, {}]
143+
144+ # Api Gateway Deployment
145+ deployment_enabled = true
146+ stage_name = "deploy"
147+
148+ # Api Gateway Stage
149+ stage_enabled = true
150+ stage_names = ["qa", "dev"]
151+
152+ # Api Gateway Client Certificate
153+ cert_enabled = true
154+ cert_description = "clouddrove"
155+
156+ # Api Gateway Authorizer
157+ authorizer_count = 2
158+ authorizer_names = ["test", "test1"]
159+ authorizer_uri = ["arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:xxxxxxxxxx:function:test/invocations", "arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:xxxxxxxxxx:function:test/invocations"]
160+ authorizer_credentials = ["arn:aws:iam::xxxxxxxxxx:role/lambda-role", "arn:aws:iam::xxxxxxxxxx:role/lambda-role"]
161+ identity_sources = ["method.request.header.Authorization", "method.request.header.Authorization"]
162+ identity_validation_expressions = ["sfdgfhghrfdsdas", ""]
163+ authorizer_types = ["TOKEN", "REQUEST"]
164+
165+ # Api Gateway Gateway Response
166+ gateway_response_count = 2
167+ response_types = ["UNAUTHORIZED", "RESOURCE_NOT_FOUND"]
168+ gateway_status_codes = ["401", "404"]
169+
170+ # Api Gateway Model
171+ model_count = 2
172+ model_names = ["test", "test1"]
173+ content_types = ["application/json", "application/json"]
174+
175+ # Api Gateway Api Key
176+ key_count = 2
177+ key_names = ["test", "test1"]
178+ }
179+ ```
0 commit comments