Skip to content

Commit 5d2ef92

Browse files
feat: added output.tf
1 parent 58729c9 commit 5d2ef92

File tree

4 files changed

+46
-6
lines changed

4 files changed

+46
-6
lines changed

_example/example.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ module "api_gateway" {
7272
environment = "test"
7373
label_order = ["environment", "name"]
7474

75-
protocol_type = "HTTP"
76-
domain_name = "test-clouddrove.com"
77-
domain_name_certificate_arn = module.acm.arn
78-
subnet_ids = tolist(module.public_subnets.public_subnet_id)
79-
security_group_ids = [module.security_group.security_group_ids]
75+
protocol_type = "HTTP"
76+
domain_name = "test-clouddrove.com"
77+
domain_name_certificate_arn = module.acm.arn
78+
subnet_ids = tolist(module.public_subnets.public_subnet_id)
79+
security_group_ids = [module.security_group.security_group_ids]
80+
route_selection_expression = "$request.method $request.path"
81+
api_key_selection_expression = "$request.header.x-api-key"
8082
}

_example/outputs.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
output "api_id" {
2+
value = join("", module.api_gateway.*.api_id)
3+
description = "The API identifier."
4+
}
5+
6+
output "api_endpoint" {
7+
value = join("", module.api_gateway.*.api_endpoint)
8+
description = "The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com."
9+
}
10+
11+
output "invoke_url" {
12+
value = join("", module.api_gateway.*.invoke_url)
13+
description = "URL to invoke the API pointing to the stage"
14+
}
15+
16+
output "integration_response_selection_expression" {
17+
value = join("", module.api_gateway.*.integration_response_selection_expression)
18+
description = "The integration response selection expression for the integration."
19+
}

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ resource "aws_apigatewayv2_domain_name" "default" {
7777
resource "aws_route53_record" "default" {
7878
count = var.enabled ? 1 : 0
7979

80-
name = join("", aws_apigatewayv2_domain_name.default.*.domain_name)
80+
name = join("", aws_apigatewayv2_domain_name.default.*.domain_name)
8181
type = "A"
8282
zone_id = "Z08295059QJZ2CJCU2HZ"
8383

outputs.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
output "api_id" {
2+
value = join("", aws_apigatewayv2_api.default.*.id)
3+
description = "The API identifier."
4+
}
5+
6+
output "api_endpoint" {
7+
value = join("", aws_apigatewayv2_api.default.*.api_endpoint)
8+
description = "The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com."
9+
}
10+
11+
output "invoke_url" {
12+
value = join("", aws_apigatewayv2_stage.default.*.invoke_url)
13+
description = "URL to invoke the API pointing to the stage"
14+
}
15+
16+
output "integration_response_selection_expression" {
17+
value = join("", aws_apigatewayv2_integration.default.*.integration_response_selection_expression)
18+
description = "The integration response selection expression for the integration."
19+
}

0 commit comments

Comments
 (0)