

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

# Verwenden CloudFormation , um Tags für AMS Accelerate zu erstellen
<a name="acc-tag-how-works-cfn"></a>

Sie können CloudFormation sie verwenden, um Tags auf Stack-Ebene (siehe CloudFormation Dokumentation, [Resource-Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)) oder auf individueller Ressourcenebene (z. B. unter [Tagging Ihrer EC2 Amazon-Ressourcen](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)) anzuwenden.

**Wichtig**  
Für einige AMS Accelerate-Servicekomponenten sind Tags mit dem Präfix **ams:rt:** erforderlich. Resource Tagger geht davon aus, dass es Eigentümer dieser Tags ist, und löscht sie, wenn keine Resource Tagger-Konfigurationsregeln sie zulassen. Sie müssen immer ein Resource Tagger-Konfigurationsprofil für diese Tags bereitstellen, auch wenn Sie Terraform verwenden CloudFormation . 

# CloudFormation Anwendungsfälle für AMS Accelerate
<a name="acc-tag-tools-cf-ex"></a>

In diesem Abschnitt werden häufig ausgeführte Aktionen mit aufgeführt CloudFormation.

**Topics**
+ [Eine EC2 Instanz mit CloudFormation for Accelerate taggen](acc-tag-cf-ex-tag-ec2.md)
+ [Eine AutoScaling Gruppe (ASG) mit CloudFormation for Accelerate taggen](acc-tag-cf-ex-tag-asg.md)
+ [Bereitstellen eines Konfigurationsprofils mit CloudFormation for Accelerate](acc-tag-cf-ex-deploy-config.md)

# Eine EC2 Instanz mit CloudFormation for Accelerate taggen
<a name="acc-tag-cf-ex-tag-ec2"></a>

Im Folgenden finden Sie ein Beispiel dafür, wie Sie das Tag **ams:rt:ams-managed mit dem Wert **true** auf eine Amazon-Instance anwenden können, die von verwaltet** wird. EC2 CloudFormation Mit dem Tag **ams:rt:ams-managed** stimmen Sie zu, dass Ihre Ressourcen von AMS Accelerate überwacht werden.

```
 Type: AWS::EC2::Instance

Properties: 
  InstanceType: "t3.micro"
  
  # ...other properties...
  
  Tags: 
    - Key: "ams:rt:ams-managed"
      Value: "true"
```

# Eine AutoScaling Gruppe (ASG) mit CloudFormation for Accelerate taggen
<a name="acc-tag-cf-ex-tag-asg"></a>

Im Folgenden finden Sie ein Beispiel dafür, wie Sie das Tag **ams:rt:ams-managed mit dem Wert **true** auf eine Auto Scaling Scaling-Gruppe anwenden können, die von verwaltet** wird. CloudFormation Beachten Sie, dass die Auto Scaling Scaling-Gruppe ihre Tags an EC2 Amazon-Instances weitergibt, die von ihr erstellt wurden. Mit dem Tag **ams:rt:ams-managed** stimmen Sie zu, dass Ihre Ressourcen von AMS Accelerate überwacht werden.

```
  Type: AWS::AutoScaling::AutoScalingGroup
Properties: 
  AutoScalingGroupName: "SampleASG"
  
  # ...other properties...
  
  Tags: 
    - Key: "ams:rt:ams-managed"
      Value: "true"
```

# Bereitstellen eines Konfigurationsprofils mit CloudFormation for Accelerate
<a name="acc-tag-cf-ex-deploy-config"></a>

Wenn Sie Ihr `CustomerManagedTags` Konfigurationsprofil mithilfe von bereitstellen möchten CloudFormation, können Sie die folgenden CloudFormation Vorlagen verwenden. Geben Sie Ihre gewünschte JSON-Konfiguration in das `AMSResourceTaggerConfigurationVersion.Content` Feld ein.

 Wenn Sie die Vorlagen in einem CloudFormation Stack oder Stack-Set bereitstellen, schlägt die Bereitstellung der `AMSResourceTaggerDeployment ` Ressource fehl, wenn Sie das erforderliche JSON-Format für die Konfiguration nicht eingehalten haben. Einzelheiten [Syntax und Struktur](acc-tag-tools-profiles.md#acc-rt-config-doc-format) zum erwarteten Format finden Sie unter. 

 Hilfe zur Bereitstellung dieser Vorlagen als CloudFormation Stack oder Stack-Set finden Sie in der entsprechenden AWS CloudFormation Dokumentation unten: 
+  [Einen Stack auf der AWS CloudFormation Konsole erstellen](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) 
+  [Einen Stack erstellen mit AWS CLI](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-cli-creating-stack.html) 
+  [Ein Stack-Set erstellen](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) 

**Anmerkung**  
Wenn Sie eine Konfigurationsversion mithilfe einer dieser Vorlagen bereitstellen und anschließend den CloudFormation Stack/das Stack-Set löschen, bleibt die Version der Vorlagenkonfiguration die aktuell bereitgestellte Version, und es erfolgt keine weitere Bereitstellung. Wenn Sie zu einer Standardkonfiguration zurückkehren möchten, müssen Sie entweder manuell eine leere Konfiguration bereitstellen (also nur`{}`) oder Ihren Stack auf eine leere Konfiguration aktualisieren, anstatt den Stack zu löschen. 

**JSON**

```
{
  "Description": "Custom configuration for the AMS Resource Tagger.",
  "Resources": {
    "AMSResourceTaggerConfigurationVersion": {
      "Type": "AWS::AppConfig::HostedConfigurationVersion",
      "Properties": {
        "ApplicationId": {
          "Fn::ImportValue": "AMS-ResourceTagger-Configuration-ApplicationId"
        },
        "ConfigurationProfileId": {
          "Fn::ImportValue": "AMS-ResourceTagger-Configuration-CustomerManagedTags-ProfileID"
        },
        "Content": "{\"Options\": {\"ReadOnly\": false}}",
        "ContentType": "application/json"
      }
    },
    "AMSResourceTaggerDeployment": {
      "Type": "AWS::AppConfig::Deployment",
      "Properties": {
        "ApplicationId": {
          "Fn::ImportValue": "AMS-ResourceTagger-Configuration-ApplicationId"
        },
        "ConfigurationProfileId": {
          "Fn::ImportValue": "AMS-ResourceTagger-Configuration-CustomerManagedTags-ProfileID"
        },
        "ConfigurationVersion": {
          "Ref": "AMSResourceTaggerConfigurationVersion"
        },
        "DeploymentStrategyId": {
          "Fn::ImportValue": "AMS-ResourceTagger-Configuration-Deployment-StrategyID"
        }, 
        "EnvironmentId": {
          "Fn::ImportValue": "AMS-ResourceTagger-Configuration-EnvironmentId"
        }
      }
    }
  }
}
```

**YAML**

```
Description: Custom configuration for the AMS Resource Tagger.
Resources:
  AMSResourceTaggerConfigurationVersion:
    Type: AWS::AppConfig::HostedConfigurationVersion
    Properties:
      ApplicationId:
        !ImportValue AMS-ResourceTagger-Configuration-ApplicationId
      ConfigurationProfileId:
        !ImportValue AMS-ResourceTagger-Configuration-CustomerManagedTags-ProfileID
      Content: |
        {
          "Options": {
            "ReadOnly": false
          }
        }
      ContentType: application/json
  AMSResourceTaggerDeployment:
    Type: AWS::AppConfig::Deployment
    Properties:
      ApplicationId:
        !ImportValue AMS-ResourceTagger-Configuration-ApplicationId
      ConfigurationProfileId:
        !ImportValue AMS-ResourceTagger-Configuration-CustomerManagedTags-ProfileID
      ConfigurationVersion:
        !Ref AMSResourceTaggerConfigurationVersion
      DeploymentStrategyId:
        !ImportValue AMS-ResourceTagger-Configuration-Deployment-StrategyID
      EnvironmentId:
        !ImportValue AMS-ResourceTagger-Configuration-EnvironmentId
```