Skip to content

Commit b72bc4d

Browse files
committed
Adding deployment and stage
1 parent 2cd18a7 commit b72bc4d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

apigw-lambda-qldb-terraform/main.tf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,30 @@ resource "aws_lambda_permission" "apigw_lambda_function_delete_person" {
565565
source_arn = "${aws_api_gateway_rest_api.api.execution_arn}/*/${aws_api_gateway_method.personid_delete.http_method}${aws_api_gateway_resource.personid.path}"
566566
}
567567

568+
resource "aws_api_gateway_deployment" "api" {
569+
rest_api_id = aws_api_gateway_rest_api.api.id
570+
571+
triggers = {
572+
redeployment = sha1(jsonencode(aws_api_gateway_rest_api.api.body))
573+
}
574+
575+
lifecycle {
576+
create_before_destroy = true
577+
}
578+
}
579+
580+
resource "aws_api_gateway_stage" "prod" {
581+
deployment_id = aws_api_gateway_deployment.api.id
582+
rest_api_id = aws_api_gateway_rest_api.api.id
583+
stage_name = "Prod"
584+
}
585+
568586
output "PersonLedger" {
569587
value = aws_qldb_ledger.ledger.id
570588
description = "QLDB Ledger for the sample application"
571589
}
590+
591+
output "PersonApi" {
592+
value = "${aws_api_gateway_stage.prod.invoke_url}/person"
593+
description = "API Gateway endpoint URL for Prod stage for Person functions"
594+
}

0 commit comments

Comments
 (0)