[英]Unable to create lambda function using cloud formation
Error: Properties validation failed for resource autoTaggingLambda with message: #/Role: expected type: String, found: JSONArray错误:资源 autoTaggingLambda 的属性验证失败,消息为:#/Role:预期类型:String,找到:JSONArray
Code below:代码如下:
Resources:
autoTaggingLambda:
Properties:
Code:
ZipFile:
"import json
import boto3
import logging
import time
from datetime import date"
You can attach in-line multiline python
script in your CloudFormation template using the |
您可以使用 | 在 CloudFormation 模板中附加内嵌多行
python
脚本|
Operator操作员
autoTaggingLambda:
Type: AWS::Lambda::Function
Properties:
.
.
.
Code:
ZipFile: !Sub |
import boto3
import json
ec2 = boto3.client('ec2')
def get_instance_ids():
.
.
.
You can check the official docs for a sample implementation https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html您可以查看官方文档以获取示例实现https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.