

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.

# Greifen Sie privat auf Container-Anwendungen auf Amazon ECS zu, indem Sie AWS Fargate PrivateLink, AWS und einen Network Load Balancer verwenden
<a name="access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer"></a>

*Kirankumar Chandrashekar, Amazon Web Services*

## Zusammenfassung
<a name="access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer-summary"></a>

Dieses Muster beschreibt, wie Sie eine Docker-Container-Anwendung privat in der Amazon Web Services (AWS) -Cloud hosten, indem Sie Amazon Elastic Container Service (Amazon ECS) mit einem AWS Fargate-Starttyp hinter einem Network Load Balancer verwenden und mithilfe von AWS auf die Anwendung zugreifen. PrivateLink Amazon Relational Database Service (Amazon RDS) hostet die relationale Datenbank für die Anwendung, die auf Amazon ECS mit hoher Verfügbarkeit (HA) ausgeführt wird. Sie können Amazon Elastic File System (Amazon EFS) verwenden, wenn die Anwendung persistenten Speicher benötigt.

Dieses Muster verwendet einen [Fargate-Starttyp](https://docs.aws.amazon.com/AmazonECS/latest/userguide/launch_types.html) für den Amazon ECS-Service, auf dem die Docker-Anwendungen ausgeführt werden, mit einem Network Load Balancer am Frontend. Es kann dann mit einem Virtual Private Cloud (VPC) -Endpunkt für den Zugriff über AWS PrivateLink verknüpft werden. Dieser VPC-Endpunktdienst kann dann mit anderen gemeinsam genutzt werden, VPCs indem deren VPC-Endpunkte verwendet werden.

Sie können Fargate mit Amazon ECS verwenden, um Container auszuführen, ohne Server oder Cluster von Amazon Elastic Compute Cloud (Amazon EC2) -Instances verwalten zu müssen. Sie können anstelle von Fargate auch eine Amazon EC2 Auto Scaling Scaling-Gruppe verwenden. Weitere Informationen finden Sie unter [Privaten Zugriff auf Containeranwendungen auf Amazon ECS mithilfe von AWS PrivateLink und einem Network Load Balancer](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-privatelink-and-a-network-load-balancer.html?did=pg_card&trk=pg_card).

## Voraussetzungen und Einschränkungen
<a name="access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer-prereqs"></a>

**Voraussetzungen**
+ Ein aktives AWS-Konto
+ [AWS-Befehlszeilenschnittstelle (AWS CLI) Version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html), installiert und konfiguriert unter Linux, macOS oder Windows
+ [Docker](https://www.docker.com/), installiert und konfiguriert unter Linux, MacOS oder Windows
+ Eine Anwendung, die auf Docker läuft

## Architektur
<a name="access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer-architecture"></a>

![\[Wird PrivateLink für den Zugriff auf eine Container-App auf Amazon ECS mit einem AWS Fargate-Starttyp verwendet.\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/images/pattern-img/31cca5e2-8d8b-45ec-b872-a06b0dd97007/images/57cc9995-45f4-4039-a0bf-2d2b3d6a05de.png)


**Technologie-Stack**
+ Amazon CloudWatch
+ Amazon Elastic Container Registry (Amazon ECR)
+ Amazon ECS
+ Amazon EFS
+ Amazon RDS
+ Amazon Simple Storage Service (Amazon-S3)
+ AWS Fargate
+ AWS PrivateLink
+ AWS Secrets Manager
+ Application Load Balancer
+ Network Load Balancer
+ VPC

**Automatisierung und Skalierung**
+ Sie können [AWS](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html) verwenden CloudFormation, um dieses Muster mithilfe von [Infrastructure as Code](https://docs.aws.amazon.com/whitepapers/latest/introduction-devops-aws/infrastructure-as-code.html) zu erstellen.

## Tools
<a name="access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer-tools"></a>

**AWS-Services**
+ [Amazon Elastic Container Registry (Amazon ECR)](https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html) ist ein verwalteter AWS-Container-Image-Registry-Service, der sicher, skalierbar und zuverlässig ist.
+ [Amazon Elastic Container Service (Amazon ECS)](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html) ist ein hoch skalierbarer, schneller Container-Management-Service, der das Ausführen, Stoppen und Verwalten von Containern in einem Cluster vereinfacht.
+ [Amazon Elastic File System (Amazon EFS)](https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html) bietet ein einfaches, skalierbares, vollständig verwaltetes elastisches NFS-Dateisystem zur Verwendung mit AWS-Cloud-Services und lokalen Ressourcen.
+ [AWS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html)ist eine Technologie, die Sie mit Amazon ECS verwenden können, um Container auszuführen, ohne Server oder Cluster von EC2 Amazon-Instances verwalten zu müssen.
+ [Amazon Relational Database Service (Amazon RDS)](https://docs.aws.amazon.com/rds/index.html) ist ein Webservice, der die Einrichtung, den Betrieb und die Skalierung einer relationalen Datenbank in der erleichtert. AWS Cloud
+ [Amazon Simple Storage Service (Amazon S3)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) ist Speicher für das Internet. Der Service ist darauf ausgelegt, Cloud Computing für Entwickler zu erleichtern.
+ Mit [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/) können Sie fest codierte Anmeldeinformationen im Code (einschließlich Passwörter) durch einen API-Aufruf an Secrets Manager ersetzen und das Geheimnis programmgesteuert abrufen.
+ [Amazon Virtual Private Cloud (Amazon VPC)](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) hilft Ihnen, AWS-Ressourcen in einem von Ihnen definierten virtuellen Netzwerk zu starten.
+ [Elastic Load Balancing (ELB)](https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html) verteilt eingehenden Anwendungs- oder Netzwerkverkehr auf mehrere Ziele wie EC2 Instances, Container und IP-Adressen in mehreren Availability Zones.

**Andere Tools**
+ [Docker](https://www.docker.com/) hilft Entwicklern dabei, jede Anwendung einfach als leichten, tragbaren und autarken Container zu packen, zu versenden und auszuführen.

## Epen
<a name="access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer-epics"></a>

### Netzwerkkomponenten erstellen
<a name="create-networking-components"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Erstellen Sie eine VPC. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 

### Erstellen Sie die Load Balancer
<a name="create-the-load-balancers"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Erstellen Sie einen Network Load Balancer.  | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html)Hilfe zu dieser und anderen Geschichten finden Sie im Abschnitt *Verwandte Ressourcen*. | Cloud-Administrator | 
| Erstellen Sie einen Application Load Balancer. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 

### Erstellen eines Amazon EFS-Dateisystems
<a name="create-an-amazon-efs-file-system"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Erstellen Sie ein Amazon EFS-Dateisystem. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 
| Mounten Sie Ziele für die Subnetze. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 
| Stellen Sie sicher, dass die Subnetze als Ziele bereitgestellt sind.  | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 

### Erstellen eines S3-Buckets
<a name="create-an-s3-bucket"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Erstellen Sie einen S3-Bucket. | Öffnen Sie die Amazon S3 S3-Konsole und [erstellen Sie bei Bedarf einen S3-Bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/GetStartedWithS3.html#creating-bucket), um die statischen Ressourcen Ihrer Anwendung zu speichern. | Cloud-Administrator | 

### Ein Secrets Manager Manager-Geheimnis erstellen
<a name="create-a-secrets-manager-secret"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
|  Erstellen Sie einen AWS-KMS-Schlüssel, um das Secrets Manager Manager-Geheimnis zu verschlüsseln. | Öffnen Sie die AWS Key Management Service (AWS KMS) -Konsole und erstellen Sie einen KMS-Schlüssel. | Cloud-Administrator | 
|  Erstellen Sie ein Secrets Manager Manager-Geheimnis, um das Amazon RDS-Passwort zu speichern. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 

### Eine Amazon RDS-Instance erstellen
<a name="create-an-amazon-rds-instance"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Erstellen einer DB-Subnetzgruppe  | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 
| Erstellen Sie eine Amazon RDS-Instance. | Erstellen und konfigurieren Sie eine Amazon RDS-Instance in den privaten Subnetzen. Stellen Sie sicher, dass **Multi-AZ** für Hochverfügbarkeit (HA) aktiviert ist. | Cloud-Administrator | 
| Laden Sie Daten in die Amazon RDS-Instance.  | Laden Sie die für Ihre Anwendung erforderlichen relationalen Daten in Ihre Amazon RDS-Instance. Dieser Prozess hängt von den Anforderungen Ihrer Anwendung sowie davon ab, wie Ihr Datenbankschema definiert und entworfen ist. | DBA | 

### Erstellen Sie die Amazon ECS-Komponenten
<a name="create-the-amazon-ecs-components"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Erstellen Sie einen ECS-Cluster. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 
| Erstellen Sie die Docker-Images. | [Erstellen Sie die Docker-Images, indem Sie den Anweisungen in der AWS Dokumentation folgen.](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-container-image.html) | Cloud-Administrator | 
| Erstellen Sie ein Amazon-ECR-Repository. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator, DevOps Ingenieur | 
| Übertragen Sie die Docker-Images in das Amazon ECR-Repository.  | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 
| Erstellen Sie eine Amazon ECS-Aufgabendefinition.  | Eine Aufgabendefinition ist erforderlich, um Docker-Container in Amazon ECS auszuführen. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html)Hilfe beim Einrichten Ihrer Aufgabendefinition finden Sie unter „Eine Aufgabendefinition erstellen“ im Abschnitt *Verwandte Ressourcen*. Stellen Sie sicher, dass Sie die Docker-Images bereitstellen, die Sie an Amazon ECR übertragen haben. | Cloud-Administrator | 
| Erstellen Sie einen ECS-Service und wählen Sie Fargate als Starttyp. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 

### AWS einrichten PrivateLink
<a name="set-up-aws-privatelink"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Richten Sie den PrivateLink AWS-Endpunkt ein. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/de_de/prescriptive-guidance/latest/patterns/access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer.html) | Cloud-Administrator | 

### Erstellen eines VPC-Endpunkts
<a name="create-a-vpc-endpoint"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Erstellen Sie einen VPC-Endpunkt. | [Erstellen Sie einen VPC-Endpunkt](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html) für den PrivateLink AWS-Endpunkt, den Sie zuvor erstellt haben. Der vollqualifizierte Domainname (FQDN) des VPC-Endpunkts zeigt auf den PrivateLink AWS-Endpunkt-FQDN. Dadurch wird eine elastic network interface zum VPC-Endpunktdienst erstellt, auf die die Domain Name Service-Endpunkte zugreifen können. | Cloud-Administrator | 

### Legen Sie das Ziel fest
<a name="set-the-target"></a>


| Aufgabe | Description | Erforderliche Fähigkeiten | 
| --- | --- | --- | 
| Fügen Sie den Application Load Balancer als Ziel hinzu. | [Folgen Sie den Anweisungen in der Dokumentation, um den Application Load Balancer als Ziel für den Network Load Balancer hinzuzufügen.AWS](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/application-load-balancer-target.html) | App-Developer | 

## Zugehörige Ressourcen
<a name="access-container-applications-privately-on-amazon-ecs-by-using-aws-fargate-aws-privatelink-and-a-network-load-balancer-resources"></a>

**Erstellen Sie die Load Balancer:**
+ [Verwenden Sie einen Network Load Balancer für Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/nlb.html)
+ [Einen Network Load Balancer erstellen](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-network-load-balancer.html)
+ [Verwenden Sie einen Application Load Balancer für Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/alb.html)
+ [Erstellen Sie einen Application Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-application-load-balancer.html)

**Erstellen Sie ein Amazon EFS-Dateisystem:**
+ [Erstellen Sie ein Amazon EFS-Dateisystem](https://docs.aws.amazon.com/efs/latest/ug/creating-using-create-fs.html)
+ [Bereitstellungsziele in Amazon EFS erstellen](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html)

**Erstellen Sie ein Secrets Manager Manager-Geheimnis:**
+ [Schlüssel in AWS KMS erstellen](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html)
+ [Erstellen Sie ein Geheimnis in AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_secret.html)

**Erstellen Sie eine Amazon RDS-Instance:**
+ [Eine Amazon RDS-DB-Instance erstellen](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html)

**Erstellen Sie die Amazon ECS-Komponenten**
+ [Erstellen Sie ein Amazon ECR-Repository](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-create.html)
+ [Authentifizieren Sie Docker mit dem Amazon ECR-Repository](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth)
+ [Ein Bild in ein Amazon ECR-Repository übertragen](https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html)
+ [Amazon ECS-Aufgabendefinition erstellen](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+ [Einen Amazon ECS-Service erstellen](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-service-console-v2.html)

**Andere Ressourcen:**
+ [Sicherer Zugriff auf Services über AWS PrivateLink](https://d1.awsstatic.com/whitepapers/aws-privatelink.pdf)