Skip to content

Commit 17de205

Browse files
committed
Life cycle
1 parent 608f6d6 commit 17de205

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

infrastructure/terraform/components/api/api_gateway_base_path_mapping.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ resource "aws_api_gateway_base_path_mapping" "main" {
22
api_id = aws_api_gateway_rest_api.main.id
33
stage_name = aws_api_gateway_stage.main.stage_name
44
domain_name = aws_api_gateway_domain_name.main.domain_name
5+
6+
lifecycle {
7+
replace_triggered_by = [terraform_data.rest_api_security_policy]
8+
create_before_destroy = false
9+
}
510
}
611

712
# AWS requires base path mappings to be removed before the associated stage can

infrastructure/terraform/components/api/api_gateway_stage.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ resource "aws_api_gateway_stage" "main" {
44
rest_api_id = aws_api_gateway_rest_api.main.id
55
deployment_id = aws_api_gateway_deployment.main.id
66

7+
lifecycle {
8+
replace_triggered_by = [terraform_data.rest_api_security_policy]
9+
}
10+
711
access_log_settings {
812
destination_arn = aws_cloudwatch_log_group.api_gateway_access.arn
913

0 commit comments

Comments
 (0)