Skip to content

Commit f0880da

Browse files
committed
Fixing cloudwatch query terraform error
1 parent d516b07 commit f0880da

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

infrastructure/stacks/blue-green-link/cloudwatch-queries.tf

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ fields @timestamp, correlation_id, ods_code, function_name, message
1616
| filter level == 'ERROR'
1717
| sort @timestamp
1818
EOF
19+
20+
lifecycle {
21+
create_before_destroy = false
22+
}
1923
}
2024

2125
resource "aws_cloudwatch_query_definition" "search_by_correlation_id" {
@@ -36,6 +40,10 @@ fields @timestamp, message
3640
| filter correlation_id == 'REPLACE'
3741
| sort @timestamp
3842
EOF
43+
44+
lifecycle {
45+
create_before_destroy = false
46+
}
3947
}
4048

4149
resource "aws_cloudwatch_query_definition" "search_by_correlation_id_expanded" {
@@ -56,6 +64,10 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
5664
| filter correlation_id == 'REPLACE'
5765
| sort @timestamp
5866
EOF
67+
68+
lifecycle {
69+
create_before_destroy = false
70+
}
5971
}
6072

6173
resource "aws_cloudwatch_query_definition" "search_by_odscode" {
@@ -76,6 +88,10 @@ fields @timestamp, message
7688
| filter ods_code == 'REPLACE'
7789
| sort @timestamp
7890
EOF
91+
92+
lifecycle {
93+
create_before_destroy = false
94+
}
7995
}
8096

8197
resource "aws_cloudwatch_query_definition" "search_by_odscode_expanded" {
@@ -96,6 +112,10 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
96112
| filter ods_code == 'REPLACE'
97113
| sort @timestamp
98114
EOF
115+
116+
lifecycle {
117+
create_before_destroy = false
118+
}
99119
}
100120

101121
resource "aws_cloudwatch_query_definition" "search_for_invalid_postcode" {
@@ -110,6 +130,10 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
110130
| filter report_key == 'INVALID_POSTCODE'
111131
| sort @timestamp
112132
EOF
133+
134+
lifecycle {
135+
create_before_destroy = false
136+
}
113137
}
114138

115139
resource "aws_cloudwatch_query_definition" "search_for_invalid_opening_times" {
@@ -124,6 +148,10 @@ fields @timestamp,correlation_id,ods_code,level,message_received,function_name,
124148
| filter report_key == 'INVALID_OPEN_TIMES'
125149
| sort @timestamp
126150
EOF
151+
152+
lifecycle {
153+
create_before_destroy = false
154+
}
127155
}
128156

129157
resource "aws_cloudwatch_query_definition" "search_by_email_correlation_id" {
@@ -139,6 +167,10 @@ fields correlation_id
139167
| filter message =="Email Correlation Id"
140168
| filter email_correlation_id == "ADD_EMAIL_CORRELATION_ID"
141169
EOF
170+
171+
lifecycle {
172+
create_before_destroy = false
173+
}
142174
}
143175

144176
resource "aws_cloudwatch_query_definition" "search_by_update_request_success" {
@@ -153,6 +185,10 @@ fields @timestamp, correlation_id
153185
| filter ServiceUpdateSuccess == 1
154186
| sort @timestamp desc
155187
EOF
188+
189+
lifecycle {
190+
create_before_destroy = false
191+
}
156192
}
157193

158194
resource "aws_cloudwatch_query_definition" "search_by_update_request_failed" {
@@ -167,6 +203,10 @@ fields @timestamp, correlation_id, report_key
167203
| filter report_key == DOS_DB_UPDATE_DLQ_HANDLER_RECEIVED_EVENT
168204
| sort @timestamp desc
169205
EOF
206+
207+
lifecycle {
208+
create_before_destroy = false
209+
}
170210
}
171211

172212
resource "aws_cloudwatch_query_definition" "search_by_dos_data_item_updates" {
@@ -183,6 +223,10 @@ fields @timestamp, correlation_id
183223
| filter field == 'REPLACE'
184224
| sort @timestamp desc
185225
EOF
226+
227+
lifecycle {
228+
create_before_destroy = false
229+
}
186230
}
187231

188232
resource "aws_cloudwatch_query_definition" "search_for_report_warnings" {
@@ -204,6 +248,10 @@ fields @timestamp, correlation_id, message
204248
| filter level == 'WARNING'
205249
| sort @timestamp desc
206250
EOF
251+
252+
lifecycle {
253+
create_before_destroy = false
254+
}
207255
}
208256

209257

@@ -219,4 +267,8 @@ fields @timestamp, level, message
219267
| filter odscode = 'TO_ADD'
220268
| sort @timestamp asc
221269
EOF
270+
271+
lifecycle {
272+
create_before_destroy = false
273+
}
222274
}

0 commit comments

Comments
 (0)