-
Notifications
You must be signed in to change notification settings - Fork 608
Expand file tree
/
Copy pathapi_gateway_config.tf
More file actions
50 lines (42 loc) · 1.65 KB
/
Copy pathapi_gateway_config.tf
File metadata and controls
50 lines (42 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
resource "aws_api_gateway_rest_api" "this" {
name = "${local.prefix_with_domain}"
description = "${var.comment_prefix}${var.api_domain}"
}
resource "aws_api_gateway_deployment" "this" {
rest_api_id = "${aws_api_gateway_rest_api.this.id}"
depends_on = [
"aws_api_gateway_integration.proxy_root",
"aws_api_gateway_integration.proxy_other",
]
}
resource "aws_api_gateway_stage" "this" {
stage_name = "${var.stage_name}"
description = "${var.comment_prefix}${var.api_domain}"
rest_api_id = "${aws_api_gateway_rest_api.this.id}"
deployment_id = "${aws_api_gateway_deployment.this.id}"
tags = "${var.tags}"
}
resource "aws_api_gateway_method_settings" "this" {
rest_api_id = "${aws_api_gateway_rest_api.this.id}"
stage_name = "${aws_api_gateway_stage.this.stage_name}"
method_path = "*/*"
settings {
metrics_enabled = "${var.api_gateway_cloudwatch_metrics}"
logging_level = "${var.api_gateway_logging_level}"
data_trace_enabled = "${var.api_gateway_logging_level == "OFF" ? false : true}"
throttling_rate_limit = "${var.throttling_rate_limit}"
throttling_burst_limit = "${var.throttling_burst_limit}"
}
}
resource "aws_api_gateway_domain_name" "this" {
domain_name = "${var.api_domain}"
regional_certificate_arn = "${aws_acm_certificate_validation.this.certificate_arn}"
endpoint_configuration {
types = ["REGIONAL"]
}
}
resource "aws_api_gateway_base_path_mapping" "this" {
api_id = "${aws_api_gateway_rest_api.this.id}"
stage_name = "${aws_api_gateway_stage.this.stage_name}"
domain_name = "${aws_api_gateway_domain_name.this.domain_name}"
}