【发布时间】:2017-06-23 12:43:15
【问题描述】:
我有一个由 S3 存储桶触发的 AWS Lambda 函数。 Lambda 函数 ping VPC 内的 EC2 实例。 VPC 没有 NAT。由于某种原因,Lambda 无法连接到 EC2 并且正在超时。我尝试将 lambda 保留在 VPC 中和 VPC 之外。我也尝试过使用实例的公共和私有 IP,但似乎不起作用。关于我下一步可以做什么的任何建议。 lambda函数的代码如下
from __future__ import print_function
import json
import boto3
import urllib2
print('Loading function')
s3 = boto3.client('s3')
def lambda_handler(event, context):
bucket = event['Records'][0]['s3']['bucket']['name']
url = urllib2.urlopen("http://ip-address/API/")
【问题讨论】:
标签: python amazon-web-services amazon-ec2 aws-lambda