

# Accelerate Alarm Manager tags
Alarm Manager tags

By default, when you onboard with AMS Accelerate, your configuration is deployed to AWS AppConfig, defining an alarm baseline for your resources. The alarm definitions are applied only to resources with the **ams:rt:\$1** tags. We recommend that these tags be applied using the [Accelerate Resource Tagger](acc-resource-tagger.md): you set up a basic Resource Tagger configuration in order to let AMS Accelerate know which resources you want managed.

Use Resource Tagger to apply the tag key **ams:rt:ams-managed** with tag value **true** to any resources you want AMS Accelerate to monitor.

**Topics**
+ [

# Accelerate tags using Resource Tagger
](acc-mem-tag-alarms-use-rt.md)
+ [

# Accelerate tags without Resource Tagger
](acc-mem-tags-no-rt.md)
+ [

# Accelerate tags using CloudFormation
](acc-mem-tags-cfn.md)
+ [

# Accelerate tags using Terraform
](acc-mem-tags-terraform.md)

# Accelerate tags using Resource Tagger
Tags using Resource Tagger

The tag-based Alarm Manager manages the lifecycle of per-resource CloudWatch alarms; however, it requires that the managed resources have specific tags defined by AMS Accelerate. To use the Resource Tagger to apply the default set of AMS-managed alarms to both Linux and Windows based instances, follow these steps.

1. Browse to the [AppConfig](https://console.aws.amazon.com/systems-manager/appconfig/) console within your account.

1. Select the ResourceTagger application.

1. Select the **Configuration profiles** tab, and then select **CustomerManagedTags**.

1. Click **Create** to create a new profile.

1. Select **JSON** and define your configuration. For more examples of filter and platform definition, see [Accelerate Resource Tagger](acc-resource-tagger.md).

   ```
   {
   "AWS::EC2::Instance": {
      "MonitorAllInstances": {
          "Enabled": true,
          "Filter": {
              "Platform": "*"
          },
          "Tags": [
              {
                  "Key": "ams:rt:ams-managed",
                  "Value": "true"
              }
          ]
      }
   }
   }
   ```

1. Click **Create hosted configuration version**.

1. Click **Start deployment**.

1. Define the following deployment details:

   ```
   Environment: AMSInfrastructure Hosted configuration version: <Select the version that you have just created> 
                  Deployment Strategy: AMSNoBakeDeployment
   ```

1. Click **Start deployment**.

Your instances become tagged with `"ams:rt:ams-managed": "true"` which ensures that additional `"ams:rt:ams-monitoring-policy": "ams-monitored"` and `"ams:rt:ams-monitoring-policy-platform": "ams-monitored-linux"` are applied to the instances. These tags then result in the appropriate alarms being created for the instance. For more information about this process, see [Monitoring in Accelerate](acc-tag-req-mon.md).

[![AWS Videos](http://img.youtube.com/vi/https://www.youtube.com/embed/ohtqVmm2yIw/0.jpg)](http://www.youtube.com/watch?v=https://www.youtube.com/embed/ohtqVmm2yIw)


# Accelerate tags without Resource Tagger
Tags without Resource Tagger

The tag-based Alarm Manager manages the lifecycle of per-resource CloudWatch alarms; however, it requires that the managed resources have specific tags defined by AMS Accelerate. AMS Accelerate provides a default configuration profile that assumes that your tags have been applied by Resource Tagger.

If you want to use an alternate method of applying tags to your resources, such as CloudFormation or Terraform, and not Resource Tagger, you need to disable the Resource Tagger so that it doesn’t apply tags to your resources and compete with your chosen tagging method. For instructions on changing your custom Resource Tagger configuration profile to enable read-only mode, see [Preventing Resource Tagger from modifying resources](acc-rt-using.md#acc-rt-preventing-rt-changes).

After the Resource Tagger has been set to read-only mode, and the configuration profile is deployed, use your chosen tagging method to apply tags to your resources according to the following guidelines:


| Resource type | Tag key | Tag value | 
| --- | --- | --- | 
| All supported resources (described in this table) | ams:rt:ams-monitoring-policy | ams-monitored | 
| EC2 instances (Linux) | ams:rt:ams-monitoring-policy-platform | ams-monitored-linux | 
| EC2 instances (Windows) | ams:rt:ams-monitoring-policy-platform | ams-monitored-windows | 
| OpenSearch Domain with KMS | ams:rt:ams-monitoring-with-kms | ams-monitored-with-kms | 
| OpenSearch Domain with Dedicated Master Node | ams:rt:ams-monitoring-with-master | ams-monitored-with-master | 

Resources that have these tag keys and values are managed by the AMS Accelerate Alarm Manager.

# Accelerate tags using CloudFormation
Tags using CloudFormation

**Note**  
Make sure you have set Resource Tagger to read-only mode first before applying tags using CloudFormation, otherwise Resource Tagger may modify the tags based on the configuration profile. For information on setting Resource Tagger to read-only mode, and guidelines on providing your own tags, see [Accelerate tags without Resource Tagger](acc-mem-tags-no-rt.md).

To apply tags using CloudFormation, you can apply tags at the stack level (see [ CloudFormation Resource Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)) or, at the individual resource level, (for example, see [ Creating EC2 Instance Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-tags)).

The following is an example of how you can apply AMS Accelerate alarm management tags to an Amazon EC2 instance managed by CloudFormation:

```
Type: AWS::EC2::Instance
Properties: 
 InstanceType: "t3.micro"
 
 # ...other properties...
 
 Tags: 
   - Key: "aws:rt:ams-monitoring-policy"
     Value: "ams-monitored"
   - Key: "aws:rt:ams-monitoring-policy-platform"
     Value: "ams-monitored-linux"
```

The following is an example of how you can apply AMS Accelerate alarm management tags to an Auto Scaling group managed by CloudFormation. Note that the Auto Scaling group will propagate its tags to Amazon EC2 instances that are created by it:

```
Type: AWS::AutoScaling::AutoScalingGroup
Properties: 
 AutoScalingGroupName: "TestASG"
 
 # ...other properties...
 
 Tags: 
   - Key: "aws:rt:ams-monitoring-policy"
     Value: "ams-monitored"
   - Key: "aws:rt:ams-monitoring-policy-platform"
     Value: "ams-monitored-linux"
```

# Accelerate tags using Terraform
Tags using Terraform

**Note**  
Make sure you have set Resource Tagger to read-only mode first before applying tags using CloudFormation, otherwise Resource Tagger may modify the tags based on the configuration profile. For information on setting Resource Tagger to read-only mode, and guidelines on providing your own tags, see [Accelerate tags without Resource Tagger](acc-mem-tags-no-rt.md).

For a description of how to manage resource tags using Terraform, see the Terraform documentation [ Resource Tagging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/resource-tagging).

The following is an example of how you can apply AMS Accelerate alarm management tags to an Amazon EC2 instance managed by Terraform.

```
resource "aws_instance" "test_linux_instance" {
     # ...ami and other properties...
     
     instance_type = "t3.micro"
   
     tags = {
       "aws:rt:ams-monitoring-policy" = "ams-monitored"
       "aws:rt:ams-monitoring-policy-platform" = "ams-monitored-linux"
     }
   }
```

The following is an example of how you can apply AMS alarm management tags to an Auto Scaling group managed by Terraform. Note that the Auto Scaling group propagates its tags to EC2 instances that are created by it:

```
 resource "aws_autoscaling_group" "test_asg" {
 name = "terraform-test"
 # ...other properties...

 tags = {
   "aws:rt:ams-monitoring-policy" = "ams-monitored"
   "aws:rt:ams-monitoring-policy-platform" = "ams-monitored-linux"
 }
}
```