質問: function (event, context) { context.succeed(\"hello, world!\"); };" }, "description": "user handler.", "handler": "index.handler", "memorysize": 128, "role": { "fn::getatt": ["lambdaexecutionrole", "arn" ] }, "runtime": "nodejs4.3", "timeout": 30, "vpcconfig": { "securitygroupids": [{ "fn::getatt": ["lambdasecuritygroup", "groupid"] }], "subnetids": [{"ref": "subnetprivatea"}, {"ref": "subnetprivateb"}] } } }, "apigateway": { "type": "aws::apigateway::restapi", "properties": { "body": [removed from post, its long], "failonwarnings": true, "name": { "fn::join": ["-", { "fn::split": [".", { "fn::join": ["", ["api.", { "ref": "domainname" }]]}]}]} } }, "apideployment": { "type": "aws::apigateway::deployment", "properties": { "restapiid": { "ref": "apigateway" }, "description": "deploy for live", "stagename": "live" } }, "websitebucket": { "type": "aws::s3::bucket", "properties": { "bucketname": {"ref":"domainname"}, "accesscontrol": "publicread", "websiteconfiguration": { "indexdocument": "index.html", "errordocument": "404.html" }, "tags" : [ {"key": "name", "value": { "fn::join" : ["_", ["websitebucket", { "ref": "aws::stackname" } ]]}}, {"key": "domain", "value": { "ref": "domainname" }} ] }, "deletionpolicy": "retain" }, "wwwbucket": { "type": "aws::s3::bucket", "properties": { "bucketname": { "fn::join": ["", ["www.", { "ref":"domainname" }]] }, "accesscontrol": "bucketownerfullcontrol", "websiteconfiguration": { "redirectallrequeststo": { "hostname": {"ref": "websitebucket"} } }, "tags" : [ {"key": "name", "value": { "fn::join" : ["_", ["wwwbucket", { "ref": "aws::stackname" } ]]}}, {"key": "domain", "value": { "ref": "domainname" }} ] } }, "websitebucketpolicy": { "type": "aws::s3::bucketpolicy", "properties": { "bucket": {"ref": "websitebucket"}, "policydocument": { "statement": [{ "action": [ "s3:getobject" ], "effect": "allow", "resource": { "fn::join" : ["", ["arn:aws:s3:::", { "ref": "websitebucket" } , "/*" ]]}, "principal": "*" }] } } }, "wwwbucketpolicy": { "type": "aws::s3::bucketpolicy", "properties": { "bucket": {"ref": "wwwbucket"}, "policydocument": { "statement": [{ "action": [ "s3:getobject" ], "effect": "allow", "resource": { "fn::join" : ["", ["arn:aws:s3:::", { "ref": "wwwbucket" } , "/*" ]]}, "principal": "*" }] } } }, "dns": { "type": "aws::route53::hostedzone", "properties": { "hostedzoneconfig": { "comment": { "fn::join" : ["", ["hosted zone for ", { "ref": "domainname" }]]} }, "name": { "ref": "domainname" }, "hostedzonetags" : [{ "key": "application", "value": "blog" }] } }, "dnsrecord": { "type": "aws::route53::recordsetgroup", "properties": { "hostedzonename": { "fn::join": [ "", [{ "ref": "domainname" }, "." ]] }, "comment": "zone records.", "recordsets": [ { "name": { "ref": "domainname" }, "type": "a", "aliastarget": { "hostedzoneid": { "fn::findinmap" : [ "s3regionmap", { "ref": "aws::region" }, "s3hostedzoneid" ]}, "dnsname": { "fn::findinmap" : [ "s3regionmap", { "ref": "aws::region" }, "s3websiteendpoint" ]} } }, { "name": { "fn::join" : ["", ["www.", { "ref": "domainname" }]]}, "type": "a", "aliastarget": { "hostedzoneid": { "fn::findinmap" : [ "s3regionmap", { "ref": "aws::region" }, "s3hostedzoneid" ]}, "dnsname": { "fn::findinmap" : [ "s3regionmap", { "ref": "aws::region" }, "s3websiteendpoint" ]} } } ] } } }, "outputs": { "s3websiteurl": { "value": { "fn::getatt": ["websitebucket", "websiteurl" ] }, "description": "url for website hosted on s3" }, "databaseendpoint": { "value": { "fn::join" : [":", [{ "fn::getatt": ["database", "endpoint.address" ] }, { "fn::getatt": ["database", "endpoint.port" ] }]]}, "description": "database endpoint" }, "natip" : { "description" : "nat ip address", "value" : { "fn::getatt" : [ "nat", "publicip" ] } } } }
回答: lambda関数がnatインスタンスまたはnatゲートウェイ、サブネットのネットワークaclを確認します(送信ルール)。セキュリティグループも確認してください。