

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# `AWSSupport-TroubleshootLambdaInternetAccess`
<a name="AWSSupport-TroubleshootLambdaInternetAccess"></a>

 **설명** 

 `AWSSupport-TroubleshootLambdaInternetAccess` 실행서는 Amazon Virtual Private Cloud(Amazon VPC)에서 시작된 AWS Lambda 함수의 인터넷 액세스 문제를 해결하는 데 도움이 됩니다. 서브넷 경로, 보안 그룹 규칙, 네트워크 액세스 제어 목록(ACL) 규칙과 같은 리소스를 검토하여 아웃바운드 인터넷 액세스가 허용되는지 확인합니다.

 [이 자동화 실행(콘솔)](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootLambdaInternetAccess) 

**문서 유형**

자동화

**소유자**

Amazon

**플랫폼**

Linux, macOS, Windows 

**파라미터**
+ AutomationAssumeRole

  유형: 문자열

  설명: (선택 사항) 사용자를 대신하여 Systems Manager Automation을 통해 작업을 수행할 수 있도록 허용하는 AWS Identity and Access Management (IAM) 역할의 Amazon 리소스 이름(ARN)입니다. 역할을 지정하지 않은 경우, Systems Manager Automation에서는 이 실행서를 시작하는 사용자의 권한을 사용합니다.
+ FunctionName

  유형: 문자열

  설명: (필수) 인터넷 액세스 문제를 해결할 Lambda 함수의 이름입니다.
+ destinationIp

  유형: 문자열

  설명: (필수) 아웃바운드 연결을 설정하려는 대상 IP 주소입니다.
+ destinationPort

  유형: 문자열

  기본값: 443

  설명: (선택 사항) 아웃바운드 연결을 설정하려는 대상 포트입니다.

**필수 IAM 권한**

실행서를 성공적으로 사용하려면 `AutomationAssumeRole` 파라미터에 다음 작업이 필요합니다.
+  `lambda:GetFunction` 
+  `ec2:DescribeRouteTables` 
+  `ec2:DescribeNatGateways` 
+  `ec2:DescribeSecurityGroups` 
+  `ec2:DescribeNetworkAcls` 

 **문서 단계** 
+  `aws:executeScript` - Lambda 함수가 시작된 VPC의 다양한 리소스 구성을 확인합니다.
+  `aws:branch` - 지정된 Lambda 함수가 VPC에 있는지 여부를 기반으로 분기합니다.
+  `aws:executeScript` - Lambda 함수가 시작된 서브넷의 라우팅 테이블 경로를 검토하고 Network Address Translation(NAT) 게이트웨이 및 인터넷 게이트웨이로 가는 경로가 있는지 확인합니다. Lambda 함수가 퍼블릭 서브넷에 있지 않음을 확인합니다.
+  `aws:executeScript` - `destinationIp` 및 `destinationPort` 파라미터에 대해 지정된 값을 기반으로 Lambda 함수와 연결된 보안 그룹이 아웃바운드 인터넷 액세스를 허용하는지 확인합니다.
+  `aws:executeScript` - `destinationIp` 및 `destinationPort` 파라미터에 대해 지정된 값을 기반으로 Lambda 함수의 서브넷과 연결된 ACL 규칙 및 NAT 게이트웨이가 아웃바운드 인터넷 액세스를 허용하는지 확인합니다.

 **출력** 

checkVpc.vpc - Lambda 함수가 시작된 VPC의 ID입니다.

checkVpc.subnet - Lambda 함수가 시작된 서브넷의 ID입니다.

checkVpc.securityGroups - Lambda 함수와 연결된 보안 그룹입니다.

 checkNACL.NACL - 리소스 이름이 포함된 분석 메시지.`LambdaIp`는 Lambda 함수의 탄력적 네트워크 인터페이스의 프라이빗 IP 주소를 나타냅니다. `LambdaIpRules` 객체는 NAT 게이트웨이로 연결되는 경로가 있는 서브넷에 대해서만 생성됩니다. 다음 콘텐츠는 출력 예제입니다.

```
{
   "subnet-1234567890":{
      "NACL":"acl-1234567890",
      "destinationIp_Egress":"Allowed",
      "destinationIp_Ingress":"notAllowed",
      "Analysis":"This NACL has an allow rule for Egress traffic but there is no Ingress rule. Please allow the destination IP / destionation port in Ingress rule",
      "LambdaIpRules":{
         "{LambdaIp}":{
            "Egress":"notAllowed",
            "Ingress":"notAllowed",
            "Analysis":"This is a NAT subnet NACL. It does not have ingress or egress rule allowed in it for Lambda's corresponding private ip {LambdaIp} Please allow this IP in your egress and ingress NACL rules"
         }
      }
   },
   "subnet-0987654321":{
      "NACL":"acl-0987654321",
      "destinationIp_Egress":"Allowed",
      "destinationIp_Ingress":"notAllowed",
      "Analysis":"This NACL has an allow rule for Egress traffic but there is no Ingress rule. Please allow the destination IP / destionation port in Ingress rule"
   }
}
```

checkSecurityGroups.secgrps - Lambda 함수와 연결된 보안 그룹에 대한 분석입니다. 다음 콘텐츠는 출력 예제입니다.

```
{
   "sg-123456789":{
      "Status":"Allowed",
      "Analysis":"This security group has allowed destintion IP and port in its outbuond rule."
   }
}
```

checkSubnet.subnets - Lambda 함수와 연결된 VPC의 서브넷에 대한 분석입니다. 다음 콘텐츠는 출력 예제입니다.

```
{
   "subnet-0c4ee6cdexample15":{
      "Route":{
         "DestinationCidrBlock":"8.8.8.0/26",
         "NatGatewayId":"nat-00f0example69fdec",
         "Origin":"CreateRoute",
         "State":"active"
      },
      "Analysis":"This Route Table has an active NAT gateway path. Also, The NAT gateway is launched in public subnet",
      "RouteTable":"rtb-0b1fexample16961b"
   }
}
```