Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
를 사용한 VPC Lattice 예제 AWS CLI
다음 코드 예제에서는 VPC Lattice와 AWS Command Line Interface 함께를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.
작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 관련 시나리오의 컨텍스트에 따라 표시되며, 개별 서비스 함수를 직접적으로 호출하는 방법을 보여줍니다.
각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.
주제
작업
다음 코드 예시에서는 create-listener의 사용 방법을 보여줍니다.
- AWS CLI
-
리스너 생성
다음
create-listener예시에서는 트래픽을 지정된 VPC Lattice 대상 그룹에 전달하는 기본 규칙을 사용하여 HTTPS 리스너를 생성합니다.aws vpc-lattice create-listener \ --namemy-service-listener\ --protocolHTTPS\ --port443\ --service-identifiersvc-0285b53b2eEXAMPLE\ --default-actionfile://listener-config.jsonlistener-config.json의 콘텐츠:{ "forward": { "targetGroups": [ { "targetGroupIdentifier": "tg-0eaa4b9ab4EXAMPLE" } ] } }출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE/listener/listener-07cc7fb0abEXAMPLE", "defaultAction": { "forward": { "targetGroups": [ { "targetGroupIdentifier": "tg-0eaa4b9ab4EXAMPLE", "weight": 100 } ] } }, "id": "listener-07cc7fb0abEXAMPLE", "name": "my-service-listener", "port": 443, "protocol": "HTTPS", "serviceArn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE", "serviceId": "svc-0285b53b2eEXAMPLE" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 리스너를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateListener
를 참조하세요.
-
다음 코드 예시는 create-resource-configuration의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 구성 만들기
다음
create-resource-configuration예제에서는 단일 IPv4 주소를 지정하는 리소스 구성을 만듭니다.aws vpc-lattice create-resource-configuration \ --namemy-resource-config\ --typeSINGLE\ --resource-gateway-identifierrgw-0bba03f3d56060135\ --resource-configuration-definition 'ipResource={ipAddress=10.0.14.85}'출력:
{ "allowAssociationToShareableServiceNetwork": true, "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625", "id": "rcfg-07129f3acded87625", "name": "my-resource-config", "portRanges": [ "1-65535" ], "protocol": "TCP", "resourceConfigurationDefinition": { "ipResource": { "ipAddress": "10.0.14.85" } }, "resourceGatewayId": "rgw-0bba03f3d56060135", "status": "ACTIVE", "type": "SINGLE" }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource configurations for VPC resources 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateResourceConfiguration
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 create-resource-gateway의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 게이트웨이 만들기
다음
create-resource-gateway예제에서는 지정된 서브넷에 대한 리소스 게이트웨이를 만듭니다.aws vpc-lattice create-resource-gateway \ --namemy-resource-gateway\ --vpc-identifiervpc-0bf4c2739bc05a69\ --subnet-idssubnet-08e8943905b63a683출력:
{ "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135", "id": "rgw-0bba03f3d56060135", "ipAddressType": "IPV4", "name": "my-resource-gateway", "securityGroupIds": [ "sg-087ffd596c5fe962c" ], "status": "ACTIVE", "subnetIds": [ "subnet-08e8943905b63a683" ], "vpcIdentifier": "vpc-0bf4c2739bc05a694" }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource gateways in VPC Lattice 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateResourceGateway
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 create-service-network-service-association의 사용 방법을 보여 줍니다.
- AWS CLI
-
서비스 연결 생성
다음
create-service-network-service-association예시에서는 지정된 서비스를 지정된 서비스 네트워크에 연결합니다.aws vpc-lattice create-service-network-service-association \ --service-identifiersvc-0285b53b2eEXAMPLE\ --service-network-identifiersn-080ec7dc93EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkserviceassociation/snsa-0e16955a8cEXAMPLE", "createdBy": "123456789012", "dnsEntry": { "domainName": "my-lattice-service-0285b53b2eEXAMPLE.7d67968.vpc-lattice-svcs.us-east-2.on.aws", "hostedZoneId": "Z09127221KTH2CEXAMPLE" }, "id": "snsa-0e16955a8cEXAMPLE", "status": "CREATE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateServiceNetworkServiceAssociation
을 참조하세요.
-
다음 코드 예시에서는 create-service-network-vpc-association의 사용 방법을 보여줍니다.
- AWS CLI
-
VPC 연결 생성
다음
create-service-network-vpc-association예시에서는 지정된 VPC를 지정된 서비스 네트워크에 연결합니다. 지정된 보안 그룹은 서비스 네트워크 및 해당 서비스에 액세스할 수 있는 VPC의 리소스를 제어합니다.aws vpc-lattice create-service-network-vpc-association \ --vpc-identifiervpc-0a1b2c3d4eEXAMPLE\ --service-network-identifiersn-080ec7dc93EXAMPLE\ --security-group-idssg-0aee16bc6cEXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkvpcassociation/snva-0821fc8631EXAMPLE", "createdBy": "123456789012", "id": "snva-0821fc8631EXAMPLE", "securityGroupIds": [ "sg-0aee16bc6cEXAMPLE" ], "status": "CREATE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 VPC 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateServiceNetworkVpcAssociation
을 참조하세요.
-
다음 코드 예시에서는 create-service-network의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 네트워크 생성
다음
create-service-network예시에서는 지정된 이름을 사용하여 서비스 네트워크를 생성합니다.aws vpc-lattice create-service-network \ --namemy-service-network출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE", "authType": "NONE", "id": "sn-080ec7dc93EXAMPLE", "name": "my-service-network" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 네트워크를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateServiceNetwork
를 참조하세요.
-
다음 코드 예시에서는 create-service의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 생성
다음
create-service예시에서는 지정된 이름을 사용하여 서비스를 생성합니다.aws vpc-lattice create-service \ --namemy-lattice-service출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE", "authType": "NONE", "dnsEntry": { "domainName": "my-lattice-service-0285b53b2eEXAMPLE.1a2b3c4.vpc-lattice-svcs.us-east-2.on.aws", "hostedZoneId": "Z09127221KTH2CEXAMPLE" }, "id": "svc-0285b53b2eEXAMPLE", "name": "my-lattice-service", "status": "CREATE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 VPC Lattice 서비스를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateService
를 참조하세요.
-
다음 코드 예시에서는 create-target-group의 사용 방법을 보여줍니다.
- AWS CLI
-
예시 1: INSTANCE 유형의 대상 그룹 생성
다음
create-target-group예시에서는 지정된 이름, 유형 및 구성을 사용하여 대상 그룹을 생성합니다.aws vpc-lattice create-target-group \ --namemy-lattice-target-group-instance\ --typeINSTANCE\ --configfile://tg-config.jsontg-config.json의 콘텐츠:{ "port": 443, "protocol": "HTTPS", "protocolVersion": "HTTP1", "vpcIdentifier": "vpc-f1663d9868EXAMPLE" }출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE", "config": { "healthCheck": { "enabled": true, "healthCheckIntervalSeconds": 30, "healthCheckTimeoutSeconds": 5, "healthyThresholdCount": 5, "matcher": { "httpCode": "200" }, "path": "/", "protocol": "HTTPS", "protocolVersion": "HTTP1", "unhealthyThresholdCount": 2 }, "port": 443, "protocol": "HTTPS", "protocolVersion": "HTTP1", "vpcIdentifier": "vpc-f1663d9868EXAMPLE" }, "id": "tg-0eaa4b9ab4EXAMPLE", "name": "my-lattice-target-group-instance", "status": "CREATE_IN_PROGRESS", "type": "INSTANCE" }예시 2: IP 유형의 대상 그룹 생성
다음
create-target-group예시에서는 지정된 이름, 유형 및 구성을 사용하여 대상 그룹을 생성합니다.aws vpc-lattice create-target-group \ --namemy-lattice-target-group-ip\ --typeIP\ --configfile://tg-config.jsontg-config.json의 콘텐츠:{ "ipAddressType": "IPV4", "port": 443, "protocol": "HTTPS", "protocolVersion": "HTTP1", "vpcIdentifier": "vpc-f1663d9868EXAMPLE" }출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE", "config": { "healthCheck": { "enabled": true, "healthCheckIntervalSeconds": 30, "healthCheckTimeoutSeconds": 5, "healthyThresholdCount": 5, "matcher": { "httpCode": "200" }, "path": "/", "protocol": "HTTPS", "protocolVersion": "HTTP1", "unhealthyThresholdCount": 2 }, "ipAddressType": "IPV4", "port": 443, "protocol": "HTTPS", "protocolVersion": "HTTP1", "vpcIdentifier": "vpc-f1663d9868EXAMPLE" }, "id": "tg-0eaa4b9ab4EXAMPLE", "name": "my-lattice-target-group-ip", "status": "CREATE_IN_PROGRESS", "type": "IP" }예시 3: LAMBDA 유형의 대상 그룹 생성
다음
create-target-group예시에서는 지정된 이름, 유형 및 구성을 사용하여 대상 그룹을 생성합니다.aws vpc-lattice create-target-group \ --namemy-lattice-target-group-lambda\ --typeLAMBDA출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE", "id": "tg-0eaa4b9ab4EXAMPLE", "name": "my-lattice-target-group-lambda", "status": "CREATE_IN_PROGRESS", "type": "LAMBDA" }예시 4: ALB 유형의 대상 그룹 생성
다음
create-target-group예시에서는 지정된 이름, 유형 및 구성을 사용하여 대상 그룹을 생성합니다.aws vpc-lattice create-target-group \ --namemy-lattice-target-group-alb\ --typeALB\ --configfile://tg-config.jsontg-config.json의 콘텐츠:{ "port": 443, "protocol": "HTTPS", "protocolVersion": "HTTP1", "vpcIdentifier": "vpc-f1663d9868EXAMPLE" }출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE", "config": { "port": 443, "protocol": "HTTPS", "protocolVersion": "HTTP1", "vpcIdentifier": "vpc-f1663d9868EXAMPLE" }, "id": "tg-0eaa4b9ab4EXAMPLE", "name": "my-lattice-target-group-alb", "status": "CREATE_IN_PROGRESS", "type": "ALB" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 대상 그룹을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateTargetGroup
을 참조하세요.
-
다음 코드 예시에서는 delete-auth-policy의 사용 방법을 보여줍니다.
- AWS CLI
-
인증 정책 삭제
다음
delete-auth-policy예시에서는 지정된 서비스의 인증 정책을 삭제합니다.aws vpc-lattice delete-auth-policy \ --resource-identifiersvc-0285b53b2eEXAMPLE이 명령은 출력을 생성하지 않습니다.
자세한 내용은 Amazon VPC Lattice 사용자 안내서의 인증 정책을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteAuthPolicy
를 참조하세요.
-
다음 코드 예시에서는 delete-listener의 사용 방법을 보여줍니다.
- AWS CLI
-
리스너를 삭제하려면
다음
delete-listener예시에서는 지정된 리스너를 삭제합니다.aws vpc-lattice delete-listener \ --listener-identifierlistener-07cc7fb0abEXAMPLE\ --service-identifiersvc-0285b53b2eEXAMPLE이 명령은 출력을 생성하지 않습니다.
자세한 내용은 Amazon VPC Lattice 사용자 안내서의 리스너를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteListener
를 참조하세요.
-
다음 코드 예시는 delete-resource-configuration의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 구성 삭제
다음
delete-resource-configuration예제에서는 지정한 리소스 구성을 삭제합니다.aws vpc-lattice delete-resource-configuration \ --resource-configuration-identifierrcfg-07129f3acded87625이 명령은 출력을 생성하지 않습니다.
자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource gateways in VPC Lattice 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteResourceConfiguration
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 delete-resource-gateway의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 게이트웨이 삭제
다음
delete-resource-gateway예제에서는 지정된 리소스 게이트웨이를 삭제합니다.aws vpc-lattice delete-resource-gateway \ --resource-gateway-identifierrgw-0bba03f3d56060135출력:
{ "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135", "id": "rgw-0bba03f3d56060135", "name": "my-resource-gateway", "status": "DELETE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource gateways in VPC Lattice 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteResourceGateway
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 delete-service-network-service-association의 사용 방법을 보여 줍니다.
- AWS CLI
-
서비스 연결 삭제
다음
delete-service-network-service-association예시에서는 지정된 서비스 연결을 해제합니다.aws vpc-lattice delete-service-network-service-association \ --service-network-service-association-identifiersnsa-031fabb4d8EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkserviceassociation/snsa-031fabb4d8EXAMPLE", "id": "snsa-031fabb4d8EXAMPLE", "status": "DELETE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteServiceNetworkServiceAssociation
을 참조하세요.
-
다음 코드 예시에서는 delete-service-network-vpc-association의 사용 방법을 보여줍니다.
- AWS CLI
-
VPC 연결 삭제
다음
delete-service-network-vpc-association예시에서는 지정된 VPC 연결을 해제합니다.aws vpc-lattice delete-service-network-vpc-association \ --service-network-vpc-association-identifiersnva-0821fc8631EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkvpcassociation/snva-0821fc8631EXAMPLE", "id": "snva-0821fc8631EXAMPLE", "status": "DELETE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 VPC 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteServiceNetworkVpcAssociation
을 참조하세요.
-
다음 코드 예시에서는 delete-service-network의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 네트워크 삭제
다음
delete-service-network예시에서는 지정된 서비스 네트워크를 삭제합니다.aws vpc-lattice delete-service-network \ --service-network-identifiersn-080ec7dc93EXAMPLE이 명령은 출력을 생성하지 않습니다.
자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 네트워크를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteServiceNetwork
를 참조하세요.
-
다음 코드 예시에서는 delete-service의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 삭제
다음
delete-service예시에서는 지정된 서비스를 삭제합니다.aws vpc-lattice delete-service \ --service-identifiersvc-0285b53b2eEXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-west-2:123456789012:service/svc-0285b53b2eEXAMPLE", "id": "svc-0285b53b2eEXAMPLE", "name": "my-lattice-service", "status": "DELETE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 VPC Lattice 서비스를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteService
를 참조하세요.
-
다음 코드 예시에서는 delete-target-group의 사용 방법을 보여줍니다.
- AWS CLI
-
대상 그룹 삭제
다음
delete-target-group예시에서는 지정된 대상 그룹을 삭제합니다.aws vpc-lattice delete-target-group \ --target-group-identifiertg-0eaa4b9ab4EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE", "id": "tg-0eaa4b9ab4EXAMPLE", "status": "DELETE_IN_PROGRESS" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 대상 그룹을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteTargetGroup
을 참조하세요.
-
다음 코드 예시에서는 deregister-targets의 사용 방법을 보여줍니다.
- AWS CLI
-
대상 등록 취소
다음
deregister-targets예시에서는 지정된 대상 그룹에서 지정된 대상을 등록 취소합니다.aws vpc-lattice deregister-targets \ --targetsi-07dd579bc5EXAMPLE\ --target-group-identifiertg-0eaa4b9ab4EXAMPLE출력:
{ "successful": [ { "id": "i-07dd579bc5EXAMPLE", "port": 443 } ], "unsuccessful": [] }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 대상 등록을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeregisterTargets
를 참조하세요.
-
다음 코드 예시에서는 get-auth-policy의 사용 방법을 보여줍니다.
- AWS CLI
-
인증 정책 정보 가져오기
다음
get-auth-policy예시에서는 지정된 서비스의 인증 정책에 대한 정보를 가져옵니다.aws vpc-lattice get-auth-policy \ --resource-identifiersvc-0285b53b2eEXAMPLE출력:
{ "createdAt": "2023-06-07T03:51:20.266Z", "lastUpdatedAt": "2023-06-07T04:39:27.082Z", "policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/my-clients\"},\"Action\":\"vpc-lattice-svcs:Invoke\",\"Resource\":\"arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE\"}]}", "state": "Active" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 인증 정책을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetAuthPolicy
를 참조하세요.
-
다음 코드 예시에서는 get-listener의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 리스너 정보 가져오기
다음
get-listener예시에서는 지정된 서비스의 지정된 리스너에 대한 정보를 가져옵니다.aws vpc-lattice get-listener \ --listener-identifierlistener-0ccf55918cEXAMPLE\ --service-identifiersvc-0285b53b2eEXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE/listener/listener-0ccf55918cEXAMPLE", "createdAt": "2023-05-07T05:08:45.192Z", "defaultAction": { "forward": { "targetGroups": [ { "targetGroupIdentifier": "tg-0ff213abb6EXAMPLE", "weight": 1 } ] } }, "id": "listener-0ccf55918cEXAMPLE", "lastUpdatedAt": "2023-05-07T05:08:45.192Z", "name": "http-80", "port": 80, "protocol": "HTTP", "serviceArn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE", "serviceId": "svc-0285b53b2eEXAMPLE" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 라우팅 정의를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetListener
를 참조하세요.
-
다음 코드 예시는 get-resource-configuration의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 구성에 관한 정보 가져오기
다음
get-resource-configuration예제에서는 지정된 구성에 관한 정보를 가져옵니다.aws vpc-lattice get-resource-configuration \ --resource-configuration-identifierrcfg-07129f3acded87625출력:
{ "allowAssociationToShareableServiceNetwork": true, "amazonManaged": false, "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625", "createdAt": "2025-02-01T00:57:35.871000+00:00", "id": "rcfg-07129f3acded87625", "lastUpdatedAt": "2025-02-01T00:57:46.874000+00:00", "name": "my-resource-config", "portRanges": [ "1-65535" ], "protocol": "TCP", "resourceConfigurationDefinition": { "ipResource": { "ipAddress": "10.0.14.85" } }, "resourceGatewayId": "rgw-0bba03f3d56060135", "status": "ACTIVE", "type": "SINGLE" }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource gateways in VPC Lattice 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 GetResourceConfiguration
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 get-resource-gateway의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 게이트웨이에 관한 정보 가져오기
다음
get-resource-gateway예제에서는 지정된 리소스 게이트웨이에 관한 정보를 가져옵니다.aws vpc-lattice get-resource-gateway \ --resource-gateway-identifierrgw-0bba03f3d56060135출력:
{ "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135", "createdAt": "2025-02-01T00:57:33.241000+00:00", "id": "rgw-0bba03f3d56060135", "ipAddressType": "IPV4", "lastUpdatedAt": "2025-02-01T00:57:44.351000+00:00", "name": "my-resource-gateway", "securityGroupIds": [ "sg-087ffd596c5fe962c" ], "status": "ACTIVE", "subnetIds": [ "subnet-08e8943905b63a683" ], "vpcId": "vpc-0bf4c2739bc05a694" }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource gateways in VPC Lattice 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 GetResourceGateway
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 get-service-network-service-association의 사용 방법을 보여 줍니다.
- AWS CLI
-
서비스 연결 정보 가져오기
다음
get-service-network-service-association예시에서는 지정된 서비스 연결의 정보를 가져옵니다.aws vpc-lattice get-service-network-service-association \ --service-network-service-association-identifiersnsa-031fabb4d8EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkserviceassociation/snsa-031fabb4d8EXAMPLE", "createdAt": "2023-05-05T21:48:16.076Z", "createdBy": "123456789012", "dnsEntry": { "domainName": "my-lattice-service-0285b53b2eEXAMPLE.7d67968.vpc-lattice-svcs.us-east-2.on.aws", "hostedZoneId": "Z09127221KTH2CEXAMPLE" }, "id": "snsa-031fabb4d8EXAMPLE", "serviceArn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE", "serviceId": "svc-0285b53b2eEXAMPLE", "serviceName": "my-lattice-service", "serviceNetworkArn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE", "serviceNetworkId": "sn-080ec7dc93EXAMPLE", "serviceNetworkName": "my-service-network", "status": "ACTIVE" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetServiceNetworkServiceAssociation
을 참조하세요.
-
다음 코드 예시에서는 get-service-network-vpc-association의 사용 방법을 보여줍니다.
- AWS CLI
-
VPC 연결 정보 가져오기
다음
get-service-network-vpc-association예시에서는 지정된 VPC 연결의 정보를 가져옵니다.aws vpc-lattice get-service-network-vpc-association \ --service-network-vpc-association-identifiersnva-0821fc8631EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkvpcassociation/snva-0821fc8631EXAMPLE", "createdAt": "2023-06-06T23:41:08.421Z", "createdBy": "123456789012", "id": "snva-0c5dcb60d6EXAMPLE", "lastUpdatedAt": "2023-06-06T23:41:08.421Z", "securityGroupIds": [ "sg-0aee16bc6cEXAMPLE" ], "serviceNetworkArn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE", "serviceNetworkId": "sn-080ec7dc93EXAMPLE", "serviceNetworkName": "my-service-network", "status": "ACTIVE", "vpcId": "vpc-0a1b2c3d4eEXAMPLE" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 VPC 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetServiceNetworkVpcAssociation
을 참조하세요.
-
다음 코드 예시에서는 get-service-network의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 네트워크 정보 가져오기
다음
get-service-network예시에서는 지정된 서비스 네트워크의 정보를 가져옵니다.aws vpc-lattice get-service-network \ --service-network-identifiersn-080ec7dc93EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE", "authType": "AWS_IAM", "createdAt": "2023-05-05T15:26:08.417Z", "id": "sn-080ec7dc93EXAMPLE", "lastUpdatedAt": "2023-05-05T15:26:08.417Z", "name": "my-service-network", "numberOfAssociatedServices": 2, "numberOfAssociatedVPCs": 3 }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 네트워크를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetServiceNetwork
를 참조하세요.
-
다음 코드 예시에서는 get-service의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 정보 가져오기
다음
get-service예시에서는 지정된 서비스의 정보를 가져옵니다.aws vpc-lattice get-service \ --service-identifiersvc-0285b53b2eEXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE", "authType": "AWS_IAM", "createdAt": "2023-05-05T21:35:29.339Z", "dnsEntry": { "domainName": "my-lattice-service-0285b53b2eEXAMPLE.7d67968.vpc-lattice-svcs.us-east-2.on.aws", "hostedZoneId": "Z09127221KTH2CFUOHIZH" }, "id": "svc-0285b53b2eEXAMPLE", "lastUpdatedAt": "2023-05-05T21:35:29.339Z", "name": "my-lattice-service", "status": "ACTIVE" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetService
를 참조하세요.
-
다음 코드 예시에서는 get-target-group의 사용 방법을 보여줍니다.
- AWS CLI
-
대상 그룹 정보 가져오기
다음
get-target-group예시에서는 대상 유형이INSTANCE인 지정된 대상 그룹의 정보를 가져옵니다.aws vpc-lattice get-target-group \ --target-group-identifiertg-0eaa4b9ab4EXAMPLE출력:
{ "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE", "config": { "healthCheck": { "enabled": true, "healthCheckIntervalSeconds": 30, "healthCheckTimeoutSeconds": 5, "healthyThresholdCount": 5, "matcher": { "httpCode": "200" }, "path": "/", "protocol": "HTTPS", "protocolVersion": "HTTP1", "unhealthyThresholdCount": 2 }, "port": 443, "protocol": "HTTPS", "protocolVersion": "HTTP1", "vpcIdentifier": "vpc-f1663d9868EXAMPLE" }, "createdAt": "2023-05-06T04:41:04.122Z", "id": "tg-0eaa4b9ab4EXAMPLE", "lastUpdatedAt": "2023-05-06T04:41:04.122Z", "name": "my-target-group", "serviceArns": [ "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE" ], "status": "ACTIVE", "type": "INSTANCE" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 대상 그룹을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetTargetGroup
을 참조하세요.
-
다음 코드 예시에서는 list-listeners의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 리스너 나열
다음
list-listeners예시에서는 지정된 서비스의 리스너를 나열합니다.aws vpc-lattice list-listeners \ --service-identifiersvc-0285b53b2eEXAMPLE출력:
{ "items": [ { "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE/listener/listener-0ccf55918cEXAMPLE", "createdAt": "2023-05-07T05:08:45.192Z", "id": "listener-0ccf55918cEXAMPLE", "lastUpdatedAt": "2023-05-07T05:08:45.192Z", "name": "http-80", "port": 80, "protocol": "HTTP" } ] }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 라우팅 정의를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListListeners
를 참조하세요.
-
다음 코드 예시는 list-resource-configurations의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 구성 나열
다음
list-resource-configurations예제에서는 리소스 구성을 나열합니다.aws vpc-lattice list-resource-configurations출력:
{ "items": [ { "amazonManaged": false, "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625", "createdAt": "2025-02-01T00:57:35.871000+00:00", "id": "rcfg-07129f3acded87625", "lastUpdatedAt": "2025-02-01T00:57:46.874000+00:00", "name": "my-resource-config", "resourceGatewayId": "rgw-0bba03f3d56060135", "status": "ACTIVE", "type": "SINGLE" } ] }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource configurations 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 ListResourceConfigurations
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 list-resource-endpoint-associations의 사용 방법을 보여 줍니다.
- AWS CLI
-
VPC 엔드포인트 연결 나열
다음
list-resource-endpoint-associations예제에서는 지정된 리소스 구성에 연결된 VPC 엔드포인트를 나열합니다.aws vpc-lattice list-resource-endpoint-associations \ --resource-configuration-identifierrcfg-07129f3acded87625출력:
{ "items": [ { "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceendpointassociation/rea-0956a7435baf89326", "createdAt": "2025-02-01T00:57:38.998000+00:00", "id": "rea-0956a7435baf89326", "resourceConfigurationArn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625", "resourceConfigurationId": "rcfg-07129f3acded87625", "vpcEndpointId": "vpce-019b90d6f16d4f958", "vpcEndpointOwner": "123456789012" } ] }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Manage associations for a VPC Lattice resource configuration 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 ListResourceEndpointAssociations
섹션을 참조하시기 바랍니다.
-
다음 코드 예시는 list-resource-gateways의 사용 방법을 보여 줍니다.
- AWS CLI
-
리소스 게이트웨이 나열
다음
list-resource-gateways예제에서는 리소스 게이트웨이를 나열합니다.aws vpc-lattice list-resource-gateways출력:
{ "items": [ { "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135", "createdAt": "2025-02-01T00:57:33.241000+00:00", "id": "rgw-0bba03f3d56060135", "ipAddressType": "IPV4", "lastUpdatedAt": "2025-02-01T00:57:44.351000+00:00", "name": "my-resource-gateway", "seurityGroupIds": [ "sg-087ffd596c5fe962c" ], "status": "ACTIVE", "subnetIds": [ "subnet-08e8943905b63a683" ], "vpcIdentifier": "vpc-0bf4c2739bc05a694" } ] }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Resource gateways in VPC Lattice 섹션을 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 ListResourceGateways
를 참조하시기 바랍니다.
-
다음 코드 예시는 list-service-network-service-associations의 사용 방법을 보여 줍니다.
- AWS CLI
-
서비스 연결 나열
다음
list-service-network-service-associations예시에서는 지정된 서비스 네트워크의 서비스 연결을 나열합니다.--query옵션은 출력 범위를 서비스 연결의 ID로 지정합니다.aws vpc-lattice list-service-network-service-associations \ --service-network-identifiersn-080ec7dc93EXAMPLE\ --queryitems[*].id출력:
[ "snsa-031fabb4d8EXAMPLE", "snsa-0e16955a8cEXAMPLE" ]자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListServiceNetworkServiceAssociations
를 참조하세요.
-
다음 코드 예시에서는 list-service-network-vpc-associations의 사용 방법을 보여줍니다.
- AWS CLI
-
VPC 연결 나열
다음
list-service-network-vpc-associations예시에서는 지정된 서비스 네트워크의 VPC 연결을 나열합니다.--query옵션은 출력 범위를 VPC 연결의 ID로 지정합니다.aws vpc-lattice list-service-network-vpc-associations \ --service-network-identifiersn-080ec7dc93EXAMPLE\ --queryitems[*].id출력:
[ "snva-0821fc8631EXAMPLE", "snva-0c5dcb60d6EXAMPLE" ]자세한 내용은 Amazon VPC Lattice 사용자 안내서의 VPC 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListServiceNetworkVpcAssociations
를 참조하세요.
-
다음 코드 예시는 list-service-network-vpc-endpoint-associations의 사용 방법을 보여 줍니다.
- AWS CLI
-
VPC 엔드포인트 연결 나열
다음
list-service-network-vpc-endpoint-associations예제에서는 지정된 서비스 네트워크와 연결된 VPC 엔드포인트를 나열합니다.aws vpc-lattice list-service-network-vpc-endpoint-associations \ --service-network-identifiersn-0808d1748faee0c1e출력:
{ "items": [ { "createdAt": "2025-02-01T01:21:36.667000+00:00", "serviceNetworkArn": "arn:aws:vpc-lattice:us-east-1:123456789012:servicenetwork/sn-0808d1748faee0c1e", "state": "ACTIVE", "vpcEndpointId": "vpce-0cc199f605eaeace7", "vpcEndpointOwnerId": "123456789012" } ] }자세한 내용은 Amazon VPC Lattice 사용 설명서의 Manage the associations for a VPC Lattice service network를 참조하시기 바랍니다.
-
API 세부 정보는 AWS CLI 명령 참조의 ListServiceNetworkVpcEndpointAssociations
를 참조하시기 바랍니다.
-
다음 코드 예시는 list-service-networks의 사용 방법을 보여 줍니다.
- AWS CLI
-
서비스 네트워크 나열
다음
list-service-networks예시에서는 직접 호출하는 계정이 소유하거나 해당 계정에 공유된 서비스 네트워크를 나열합니다.--query옵션은 결과 범위를 서비스 네트워크의 Amazon 리소스 이름(ARN)으로 지정합니다.aws vpc-lattice list-service-networks \ --queryitems[*].arn출력:
[ "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE", "arn:aws:vpc-lattice:us-east-2:111122223333:servicenetwork/sn-0ec4d436cfEXAMPLE" ]자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스 네트워크를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListServiceNetworks
를 참조하세요.
-
다음 코드 예시에서는 list-services의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 나열
다음
list-services예시에서는 직접 호출하는 계정이 소유하거나 해당 계정에 공유된 서비스를 나열합니다.--query옵션은 결과 범위를 서비스의 Amazon 리소스 이름(ARN)으로 지정합니다.aws vpc-lattice list-services \ --queryitems[*].arn출력:
[ "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE", "arn:aws:vpc-lattice:us-east-2:111122223333:service/svc-0b8ac96550EXAMPLE" ]자세한 내용은 Amazon VPC Lattice 사용자 안내서의 서비스를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListServices
를 참조하세요.
-
다음 코드 예시에서는 list-target-groups의 사용 방법을 보여줍니다.
- AWS CLI
-
대상 그룹 나열
다음
list-target-groups예시에서는 대상 유형이LAMBDA인 대상 그룹을 나열합니다.aws vpc-lattice list-target-groups \ --target-group-typeLAMBDA출력:
{ "items": [ { "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-045c1b7d9dEXAMPLE", "createdAt": "2023-05-06T05:22:16.637Z", "id": "tg-045c1b7d9dEXAMPLE", "lastUpdatedAt": "2023-05-06T05:22:16.637Z", "name": "my-target-group-lam", "serviceArns": [ "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE" ], "status": "ACTIVE", "type": "LAMBDA" } ] }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 대상 그룹을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListTargetGroups
를 참조하세요.
-
다음 코드 예시에서는 list-targets의 사용 방법을 보여줍니다.
- AWS CLI
-
대상 그룹의 대상 나열
다음
list-targets예시에서는 지정된 대상 그룹의 대상을 나열합니다.aws vpc-lattice list-targets \ --target-group-identifiertg-0eaa4b9ab4EXAMPLE출력:
{ "items": [ { "id": "i-07dd579bc5EXAMPLE", "port": 443, "status": "HEALTHY" }, { "id": "i-047b3c9078EXAMPLE", "port": 443, "reasonCode": "HealthCheckFailed", "status": "UNHEALTHY" } ] }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 대상 그룹을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListTargets
를 참조하세요.
-
다음 코드 예시에서는 put-auth-policy의 사용 방법을 보여줍니다.
- AWS CLI
-
서비스 인증 정책 생성
다음
put-auth-policy예시에서는 지정된 IAM 역할을 사용하는 인증된 위탁자의 요청에 대한 액세스 권한을 부여합니다. 리소스는 정책이 연결된 서비스의 ARN입니다.aws vpc-lattice put-auth-policy \ --resource-identifiersvc-0285b53b2eEXAMPLE\ --policyfile://auth-policy.jsonauth-policy.json의 콘텐츠:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:role/my-clients" }, "Action": "vpc-lattice-svcs:Invoke", "Resource": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE" } ] }출력:
{ "policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/my-clients\"},\"Action\":\"vpc-lattice-svcs:Invoke\",\"Resource\":\"arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE\"}]}", "state": "Active" }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 인증 정책을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 PutAuthPolicy
를 참조하세요.
-
다음 코드 예시에서는 register-targets의 사용 방법을 보여줍니다.
- AWS CLI
-
대상 등록
다음
register-targets예시에서는 지정된 대상 그룹에 지정된 대상을 등록합니다.aws vpc-lattice register-targets \ --targetsid=i-047b3c9078EXAMPLEid=i-07dd579bc5EXAMPLE\ --target-group-identifiertg-0eaa4b9ab4EXAMPLE출력:
{ "successful": [ { "id": "i-07dd579bc5EXAMPLE", "port": 443 } ], "unsuccessful": [ { "failureCode": "UnsupportedTarget", "failureMessage": "Instance targets must be in the same VPC as their target group", "id": "i-047b3c9078EXAMPLE", "port": 443 } ] }자세한 내용은 Amazon VPC Lattice 사용자 안내서의 대상 등록을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 RegisterTargets
를 참조하세요.
-