You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log Failed to load resource_id_mappings.json, using default mapping WARN
161
-
${resource_id_mapping}= Create Dictionary
162
-
END
163
-
164
169
${resource_id}= Set Variable ${resource_id_mapping.get('${resource_type}')}
165
-
IF len("${resource_id}") > 0
166
-
RW.Core.Add Issue
167
-
... severity=4
168
-
... expected=AWS `${resource_type_title}` `${item['${resource_id}']}` in AWS Region `${region}` in AWS account `${AWS_ACCOUNT_ID}` should have the following Tags `${missing_tags}`.
169
-
... actual=AWS `${resource_type_title}` `${item['${resource_id}']}` in AWS Region `${region}` in AWS account `${AWS_ACCOUNT_ID}` missing tags `${missing_tags}`
170
-
... title=Missing tags `${missing_tags}` on `${resource_type_title}` `${item['${resource_id}']} detected in AWS Account `${AWS_ACCOUNT_ID}`
171
-
... reproduce_hint=${c7n_output.cmd}
172
-
... details=${pretty_item}
173
-
... next_steps=Add missing tags `${missing_tags}` to AWS `${resource_type_title}` in AWS region `${region}` and AWS account `${AWS_ACCOUNT_ID}`.
174
-
ELSE
175
-
RW.Core.Add Issue
176
-
... severity=4
177
-
... expected=AWS `${resource_type_title}` in AWS Region `${region}` in AWS account `${AWS_ACCOUNT_ID}` should have the following Tags `${AWS_TAGS}`.
178
-
... actual=AWS `${resource_type_title}` in AWS Region `${region}` in AWS account `${AWS_ACCOUNT_ID}` missing tags `${AWS_TAGS}`
179
-
... title=Missing tags `${AWS_TAGS}` on `${resource_type_title}` detected in AWS Account `${AWS_ACCOUNT_ID}`
180
-
... reproduce_hint=${c7n_output.cmd}
181
-
... details=${pretty_item}
182
-
... next_steps=Escalate to the service owner to review AWS ${resource_type_title} in AWS region `${region}` and AWS account `${AWS_ACCOUNT_ID}` for missing tags: `${AWS_TAGS}`.\nAdd missing tags `${AWS_TAGS}` to AWS `${RESOURCE_TYPE}` in AWS region `${region}` and AWS account `${AWS_ACCOUNT_ID}`.
183
-
END
170
+
171
+
# Add resource to region-specific list
172
+
${resource_details}= Create Dictionary
173
+
... type=${resource_type_title}
174
+
... id=${item['${resource_id}'] if len("${resource_id}") > 0 else "N/A"}
175
+
... missing_tags=${missing_tags}
176
+
Append To List ${region_resources}${resource_details}
184
177
END
185
178
END
186
179
END
180
+
181
+
# If we found resources with issues in this region
182
+
IF len(@{region_resources}) > 0
183
+
# Create markdown table of resources
184
+
${table_header}= Set Variable | Resource Type | Resource ID | Missing Tags |\n|--------------|-------------|--------------|
185
+
${table_rows}= Create List
186
+
FOR ${resource} IN @{region_resources}
187
+
${row}= Set Variable | ${resource['type']} | ${resource['id']} | ${resource['missing_tags']} |
188
+
Append To List ${table_rows}${row}
189
+
END
190
+
${table}= Set Variable ${table_header}
191
+
FOR ${row} IN @{table_rows}
192
+
${table}= Set Variable ${table}\n${row}
193
+
END
194
+
195
+
# Add table to report
196
+
RW.Core.Add Pre To Report ${table}
197
+
198
+
# Get the count of resources with issues
199
+
${resource_count}= Get Length ${region_resources}
200
+
201
+
# Create single issue per region
202
+
RW.Core.Add Issue
203
+
... severity=4
204
+
... expected=All resources in AWS Region `${region}` should have the following Tags `${AWS_TAGS}`.
205
+
... actual=Found ${resource_count} resources in AWS Region `${region}` missing required tags.
206
+
... title=Missing tags `${AWS_TAGS}` detected in AWS Region `${region}`
207
+
... reproduce_hint=${c7n_output.cmd}
208
+
... details=The following resources are missing required tags:\n\n${table}
209
+
... next_steps=Apply missing tags `${AWS_TAGS}` to resources in AWS region `${region}` and AWS account `${AWS_ACCOUNT_ID}`.
210
+
END
187
211
ELSE
188
-
Log No directories found to process. WARN
212
+
Log No resources found in region ${region}. INFO
213
+
RW.Core.Add Pre To Report No resources found in region ${region}.
0 commit comments