Skip to content

Commit

Permalink
feat: added output.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
theprashantyadav committed Jul 4, 2023
1 parent 58729c9 commit 5d2ef92
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
12 changes: 7 additions & 5 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ module "api_gateway" {
environment = "test"
label_order = ["environment", "name"]

protocol_type = "HTTP"
domain_name = "test-clouddrove.com"
domain_name_certificate_arn = module.acm.arn
subnet_ids = tolist(module.public_subnets.public_subnet_id)
security_group_ids = [module.security_group.security_group_ids]
protocol_type = "HTTP"
domain_name = "test-clouddrove.com"
domain_name_certificate_arn = module.acm.arn
subnet_ids = tolist(module.public_subnets.public_subnet_id)
security_group_ids = [module.security_group.security_group_ids]
route_selection_expression = "$request.method $request.path"
api_key_selection_expression = "$request.header.x-api-key"
}
19 changes: 19 additions & 0 deletions _example/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
output "api_id" {
value = join("", module.api_gateway.*.api_id)
description = "The API identifier."
}

output "api_endpoint" {
value = join("", module.api_gateway.*.api_endpoint)
description = "The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com."
}

output "invoke_url" {
value = join("", module.api_gateway.*.invoke_url)
description = "URL to invoke the API pointing to the stage"
}

output "integration_response_selection_expression" {
value = join("", module.api_gateway.*.integration_response_selection_expression)
description = "The integration response selection expression for the integration."
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ resource "aws_apigatewayv2_domain_name" "default" {
resource "aws_route53_record" "default" {
count = var.enabled ? 1 : 0

name = join("", aws_apigatewayv2_domain_name.default.*.domain_name)
name = join("", aws_apigatewayv2_domain_name.default.*.domain_name)
type = "A"
zone_id = "Z08295059QJZ2CJCU2HZ"

Expand Down
19 changes: 19 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
output "api_id" {
value = join("", aws_apigatewayv2_api.default.*.id)
description = "The API identifier."
}

output "api_endpoint" {
value = join("", aws_apigatewayv2_api.default.*.api_endpoint)
description = "The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com."
}

output "invoke_url" {
value = join("", aws_apigatewayv2_stage.default.*.invoke_url)
description = "URL to invoke the API pointing to the stage"
}

output "integration_response_selection_expression" {
value = join("", aws_apigatewayv2_integration.default.*.integration_response_selection_expression)
description = "The integration response selection expression for the integration."
}

0 comments on commit 5d2ef92

Please sign in to comment.