Export and Import Alerts
Alert rules and alert folders can be exported as YAML and imported into another workspace. Use it to reuse the same rules across staging and production, or to set up a new workspace from an existing one. Alerts use the same export and import as dashboards and workflows, described in Config as code.
Export a rule or a folder
Section titled “Export a rule or a folder”To export a single rule, go to Alerts → Rules, open the more options (⋯) menu on the rule’s row, and select Export….
To export an entire folder, switch the Rules page to Folder view, open the folder header’s kebab menu, and select Export…. The export includes every rule in the folder, including any that the search box or state filter is hiding.
Click Copy or Download to get the YAML file.
Import rules into a workspace
Section titled “Import rules into a workspace”- Open Alerts in the destination workspace and click Import.
- Paste the exported YAML, or click Choose file.
- Click Check to see what each rule would create or update.
- If a rule queries an AWS account that isn’t found in this workspace, select one from the Pick a match list.
- Click Apply.
What carries over
Section titled “What carries over”- The folder. A rule lands in a folder with the same name, and the import creates the folder if the destination doesn’t have one. A folder export also carries the folder’s defaults. A single rule’s export carries only the folder’s name, so a folder the import creates for it starts with the system defaults. See Folders.
- The paused state. A rule that was paused when it was exported stays paused after the import.
- The AWS account. A rule binds to the account with the same account number, or to the only account the destination has.
- The Dashboard link. It’s kept when the linked dashboard came from the same workspace, for example when you import the dashboard along with the rule. Otherwise the import drops the link.
- Existing rules. Importing a rule that already exists in the destination updates it, so importing the same file twice doesn’t create duplicates.
A rule whose AWS account has no match is imported disabled. Point it at an account and resume evaluation. Region, namespace, and dimensions are copied unchanged, so review them if the destination account’s resources differ.
Smart Alerts rules aren’t exported. Alerts JSON files from the earlier export can’t be imported, so export the rules again.
Related
Section titled “Related”- Config as code: the shared export and import, and the kmctl CLI for keeping rules in git.
- Creating Alerts: building a rule from scratch, from a template, or with AI.
- Folders: grouping rules and giving them shared defaults.