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.
Test-Setup mit Amazon EC2
Dieses Setup demonstriert eine AWS-Managementkonsole Private Access-Verbindung zu Amazon Simple Storage Service von einer Amazon EC2 EC2-Instance aus. In dem Beispiel wird CloudFormation die Netzwerkkonfiguration erstellt und über Fleet Manager (eine Funktion vonAWS Systems Manager) mithilfe des Remote Desktop Protocol (RDP) eine Verbindung zur Amazon EC2 EC2-Windows-Instance hergestellt.
Das folgende Diagramm beschreibt den Vorgang für die Verwendung von Amazon EC2 für den Zugriff auf ein AWS-Managementkonsole Private Access-Setup. Es zeigt, wie ein Benutzer über einen privaten Endpunkt mit Amazon S3 verbunden wird.
Kopieren Sie die folgende CloudFormation Vorlage und speichern Sie sie in einer Datei, die Sie in Schritt drei des Verfahrens So richten Sie ein Netzwerk ein.
Description: | AWS Management Console Private Access. Parameters: VpcCIDR: Type: String Default: 172.16.0.0/16 Description: CIDR range for VPC PrivateSubnet1CIDR: Type: String Default: 172.16.1.0/24 Description: CIDR range for Private Subnet 1 PrivateSubnet2CIDR: Type: String Default: 172.16.2.0/24 Description: CIDR range for Private Subnet 2 Ec2KeyPair: Type: AWS::EC2::KeyPair::KeyName Description: The EC2 KeyPair to use to connect to the Windows instance LatestWindowsAmiId: Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id> Default: /aws/service/ami-windows-latest/Windows_Server-2022-English-Full-Base InstanceTypeParameter: Type: String Default: m5.large Resources: ######################### # VPC AND SUBNETS ######################### AppVPC: Type: AWS::EC2::VPC Properties: CidrBlock: !Ref VpcCIDR InstanceTenancy: default EnableDnsSupport: true EnableDnsHostnames: true PrivateSubnet1: Type: AWS::EC2::Subnet Properties: VpcId: !Ref AppVPC CidrBlock: !Ref PrivateSubnet1CIDR AvailabilityZone: Fn::Select: - 0 - Fn::GetAZs: "" PrivateSubnet2: Type: AWS::EC2::Subnet Properties: VpcId: !Ref AppVPC CidrBlock: !Ref PrivateSubnet2CIDR AvailabilityZone: Fn::Select: - 1 - Fn::GetAZs: "" ######################### # Route Tables ######################### PrivateRouteTable: Type: AWS::EC2::RouteTable Properties: VpcId: !Ref AppVPC PrivateSubnet1RouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref PrivateRouteTable SubnetId: !Ref PrivateSubnet1 PrivateSubnet2RouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref PrivateRouteTable SubnetId: !Ref PrivateSubnet2 ######################### # SECURITY GROUPS ######################### VPCEndpointSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: Allow TLS for VPC Endpoint VpcId: !Ref AppVPC SecurityGroupIngress: - IpProtocol: tcp FromPort: 443 ToPort: 443 CidrIp: !GetAtt AppVPC.CidrBlock EC2SecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: Default EC2 Instance SG VpcId: !Ref AppVPC SecurityGroupIngress: - IpProtocol: tcp FromPort: 3389 ToPort: 3389 CidrIp: !Ref VpcCIDR ######################### # VPC ENDPOINTS ######################### VPCEndpointInterfaceSsm: Type: AWS::EC2::VPCEndpoint Properties: VpcEndpointType: Interface PrivateDnsEnabled: true SubnetIds: - !Ref PrivateSubnet1 - !Ref PrivateSubnet2 SecurityGroupIds: - !Ref VPCEndpointSecurityGroup ServiceName: !Sub com.amazonaws.${AWS::Region}.ssm VpcId: !Ref AppVPC PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: '*' Action: '*' Resource: '*' Condition: StringEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC - Effect: Deny Principal: '*' Action: '*' Resource: '*' Condition: StringNotEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC VPCEndpointInterfaceEc2Messages: Type: AWS::EC2::VPCEndpoint Properties: VpcEndpointType: Interface PrivateDnsEnabled: true SubnetIds: - !Ref PrivateSubnet1 - !Ref PrivateSubnet2 SecurityGroupIds: - !Ref VPCEndpointSecurityGroup ServiceName: !Sub com.amazonaws.${AWS::Region}.ec2messages VpcId: !Ref AppVPC PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: '*' Action: '*' Resource: '*' Condition: StringEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC - Effect: Deny Principal: '*' Action: '*' Resource: '*' Condition: StringNotEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC VPCEndpointInterfaceSsmMessages: Type: AWS::EC2::VPCEndpoint Properties: VpcEndpointType: Interface PrivateDnsEnabled: true SubnetIds: - !Ref PrivateSubnet1 - !Ref PrivateSubnet2 SecurityGroupIds: - !Ref VPCEndpointSecurityGroup ServiceName: !Sub com.amazonaws.${AWS::Region}.ssmmessages VpcId: !Ref AppVPC PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: '*' Action: '*' Resource: '*' Condition: StringEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC - Effect: Deny Principal: '*' Action: '*' Resource: '*' Condition: StringNotEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC VPCEndpointInterfaceSignin: Type: AWS::EC2::VPCEndpoint Properties: VpcEndpointType: Interface PrivateDnsEnabled: true SubnetIds: - !Ref PrivateSubnet1 - !Ref PrivateSubnet2 SecurityGroupIds: - !Ref VPCEndpointSecurityGroup ServiceName: !Sub com.amazonaws.${AWS::Region}.signin VpcId: !Ref AppVPC PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: '*' Action: signin:Authenticate Resource: '*' Condition: StringEquals: aws:ResourceAccount: !Ref AWS::AccountId - Effect: Allow Principal: '*' Action: - signin:AuthorizeOAuth2Access - signin:CreateOAuth2Token Resource: '*' Condition: StringEquals: aws:PrincipalAccount: !Ref AWS::AccountId VPCEndpointInterfaceConsole: Type: AWS::EC2::VPCEndpoint Properties: VpcEndpointType: Interface PrivateDnsEnabled: true SubnetIds: - !Ref PrivateSubnet1 - !Ref PrivateSubnet2 SecurityGroupIds: - !Ref VPCEndpointSecurityGroup ServiceName: !Sub com.amazonaws.${AWS::Region}.console VpcId: !Ref AppVPC PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: '*' Action: '*' Resource: '*' Condition: StringEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC - Effect: Deny Principal: '*' Action: '*' Resource: '*' Condition: StringNotEquals: aws:PrincipalAccount: !Ref AWS::AccountId aws:ResourceAccount: !Ref AWS::AccountId aws:SourceVpc: !Ref AppVPC VPCEndpointInterfaceConsoleStatic: # console-static only supports the full access endpoint policy Type: AWS::EC2::VPCEndpoint Properties: VpcEndpointType: Interface PrivateDnsEnabled: true SubnetIds: - !Ref PrivateSubnet1 - !Ref PrivateSubnet2 SecurityGroupIds: - !Ref VPCEndpointSecurityGroup ServiceName: !Sub com.amazonaws.${AWS::Region}.console-static VpcId: !Ref AppVPC ######################### # EC2 INSTANCE ######################### Ec2InstanceRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: Service: - ec2.amazonaws.com Action: - sts:AssumeRole Path: / ManagedPolicyArns: - arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore Ec2InstanceProfile: Type: AWS::IAM::InstanceProfile Properties: Path: / Roles: - !Ref Ec2InstanceRole Ec2LaunchTemplate: Type: AWS::EC2::LaunchTemplate Properties: LaunchTemplateData: MetadataOptions: HttpTokens: required EC2WinInstance: Type: AWS::EC2::Instance Properties: ImageId: !Ref LatestWindowsAmiId IamInstanceProfile: !Ref Ec2InstanceProfile KeyName: !Ref Ec2KeyPair InstanceType: !Ref InstanceTypeParameter SubnetId: !Ref PrivateSubnet1 SecurityGroupIds: - !Ref EC2SecurityGroup BlockDeviceMappings: - DeviceName: /dev/sda1 Ebs: VolumeSize: 50 LaunchTemplate: LaunchTemplateId: !Ref Ec2LaunchTemplate Version: !GetAtt Ec2LaunchTemplate.LatestVersionNumber Tags: - Key: Name Value: Console VPCE test instance
So richten Sie ein Netzwerk ein:
-
Melden Sie sich bei dem Verwaltungskonto Ihrer Organisation an, und öffnen Sie die CloudFormation-Konsole
. -
Wählen Sie Stack erstellen aus.
-
Wählen Sie Mit neuen Ressourcen (Standard). Laden Sie die CloudFormation Vorlagendatei hoch, die Sie zuvor erstellt haben, und wählen Sie Weiter.
-
Geben Sie einen Namen für den Stack ein, z. B.
PrivateConsoleNetworkForS3, und wählen Sie Weiter aus. -
Geben Sie für VPC und Subnetze Ihre bevorzugten IP-CIDR-Bereiche ein, oder verwenden Sie die angegebenen Standardwerte. Wenn Sie die Standardwerte verwenden, stellen Sie sicher, dass sie sich nicht mit den vorhandenen VPC-Ressourcen in Ihrem AWS-Konto überschneiden.
-
Wählen Sie für den Ec2KeyPairParameter eines der vorhandenen Amazon EC2 EC2-Schlüsselpaare in Ihrem Konto aus. Wenn Sie nicht über ein vorhandenes Amazon EC2-Schlüsselpaar verfügen, müssen Sie eines erstellen, bevor Sie mit dem nächsten Schritt fortfahren. Weitere Informationen finden Sie unter Erstellen eines key pair mit Amazon EC2 im Amazon EC2 EC2-Benutzerhandbuch.
-
Wählen Sie Stack erstellen aus.
-
Nachdem der Stack erstellt wurde, wählen Sie die Registerkarte Ressourcen, um die erstellten Ressourcen anzuzeigen.
So stellen Sie eine Verbindung zu Ihrer Amazon-EC2-Instance her:
-
Melden Sie sich bei dem Verwaltungskonto für Ihre Organisation an, und öffnen Sie die Amazon EC2-Konsole
. -
Wählen Sie im Navigationsbereich Instances aus.
-
Wählen Sie auf der Seite Instances die VPCE-Testinstanz für die Konsole aus, die mit der Vorlage erstellt wurde. CloudFormation Wählen Sie dann Verbinden aus.
Anmerkung
In diesem Beispiel wird Fleet Manager, eine Funktion vonAWS Systems Manager Explorer, verwendet, um eine Verbindung zu Ihrem Windows Server herzustellen. Es kann einige Minuten dauern, bis die Verbindung hergestellt werden kann.
-
Wählen Sie auf der Seite Mit Instance verbinden die Option RDP Client und dann Mit Fleet Manager verbinden aus.
-
Wählen Sie Fleet Manager Remote Destop aus.
-
Um das Administratorkennwort für die Amazon EC2 EC2-Instance abzurufen und über die Weboberfläche auf den Windows-Desktop zuzugreifen, verwenden Sie den privaten Schlüssel, der dem Amazon EC2 EC2-Schlüsselpaar zugeordnet ist, das Sie bei der Erstellung der CloudFormation Vorlage verwendet haben.
-
Öffnen Sie in der Amazon EC2 EC2-Windows-Instance die AWS-Managementkonsole im Browser.
-
Nachdem Sie sich mit Ihren AWS Anmeldeinformationen angemeldet haben, öffnen Sie die Amazon S3 S3-Konsole
und stellen Sie sicher, dass Sie über AWS-Managementkonsole Private Access verbunden sind.
Um zu testenAWS-ManagementkonsoleEinrichtung des privaten Zugriffs
-
Melden Sie sich beim Verwaltungskonto Ihrer Organisation an, und öffnen Sie die Amazon S3-Konsole
. -
Wählen Sie das Lock-Private-Symbol in der Navigationsleiste, um den VPC-Endpunkt anzuzeigen. Der folgende Screenshot zeigt die Position des Lock-Private-Symbols und der VPC-Informationen.