@@ -27,6 +27,10 @@ fields @timestamp, correlation_id, ods_code, function_name, message
2727| sort @timestamp
2828EOF
2929
30+ lifecycle {
31+ create_before_destroy = false
32+ }
33+
3034}
3135
3236resource "aws_cloudwatch_query_definition" "search_by_correlation_id" {
@@ -48,7 +52,9 @@ fields @timestamp, message
4852| filter correlation_id == 'REPLACE'
4953| sort @timestamp
5054EOF
51-
55+ lifecycle {
56+ create_before_destroy = false
57+ }
5258}
5359
5460resource "aws_cloudwatch_query_definition" "search_by_correlation_id_expanded" {
@@ -70,7 +76,9 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
7076| filter correlation_id == 'REPLACE'
7177| sort @timestamp
7278EOF
73-
79+ lifecycle {
80+ create_before_destroy = false
81+ }
7482}
7583
7684resource "aws_cloudwatch_query_definition" "search_by_odscode" {
@@ -92,7 +100,9 @@ fields @timestamp, message
92100| filter ods_code == 'REPLACE'
93101| sort @timestamp
94102EOF
95-
103+ lifecycle {
104+ create_before_destroy = false
105+ }
96106}
97107
98108resource "aws_cloudwatch_query_definition" "search_by_odscode_expanded" {
@@ -114,7 +124,9 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
114124| filter ods_code == 'REPLACE'
115125| sort @timestamp
116126EOF
117-
127+ lifecycle {
128+ create_before_destroy = false
129+ }
118130}
119131
120132resource "aws_cloudwatch_query_definition" "search_for_invalid_postcode" {
@@ -130,7 +142,9 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
130142| filter report_key == 'INVALID_POSTCODE'
131143| sort @timestamp
132144EOF
133-
145+ lifecycle {
146+ create_before_destroy = false
147+ }
134148}
135149
136150resource "aws_cloudwatch_query_definition" "search_for_invalid_opening_times" {
@@ -146,7 +160,9 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
146160| filter report_key == 'INVALID_OPEN_TIMES'
147161| sort @timestamp
148162EOF
149-
163+ lifecycle {
164+ create_before_destroy = false
165+ }
150166}
151167
152168resource "aws_cloudwatch_query_definition" "search_by_email_correlation_id" {
@@ -163,7 +179,9 @@ fields correlation_id
163179| filter message =="Email Correlation Id"
164180| filter email_correlation_id == "ADD_EMAIL_CORRELATION_ID"
165181EOF
166-
182+ lifecycle {
183+ create_before_destroy = false
184+ }
167185}
168186
169187resource "aws_cloudwatch_query_definition" "search_by_update_request_success" {
@@ -179,7 +197,9 @@ fields @timestamp, correlation_id
179197| filter ServiceUpdateSuccess == 1
180198| sort @timestamp desc
181199EOF
182-
200+ lifecycle {
201+ create_before_destroy = false
202+ }
183203}
184204
185205resource "aws_cloudwatch_query_definition" "search_by_update_request_failed" {
@@ -195,7 +215,9 @@ fields @timestamp, correlation_id, report_key
195215| filter report_key == DOS_DB_UPDATE_DLQ_HANDLER_RECEIVED_EVENT
196216| sort @timestamp desc
197217EOF
198-
218+ lifecycle {
219+ create_before_destroy = false
220+ }
199221}
200222
201223resource "aws_cloudwatch_query_definition" "search_by_dos_data_item_updates" {
@@ -213,7 +235,9 @@ fields @timestamp, correlation_id
213235| filter field == 'REPLACE'
214236| sort @timestamp desc
215237EOF
216-
238+ lifecycle {
239+ create_before_destroy = false
240+ }
217241}
218242
219243resource "aws_cloudwatch_query_definition" "search_for_report_warnings" {
@@ -236,7 +260,9 @@ fields @timestamp, correlation_id, message
236260| filter level == 'WARNING'
237261| sort @timestamp desc
238262EOF
239-
263+ lifecycle {
264+ create_before_destroy = false
265+ }
240266}
241267
242268
@@ -253,5 +279,7 @@ fields @timestamp, level, message
253279| filter odscode = 'TO_ADD'
254280| sort @timestamp asc
255281EOF
256-
282+ lifecycle {
283+ create_before_destroy = false
284+ }
257285}
0 commit comments