1
我正在通過雲形成模板創建我的lambda函數。 我的問題是,在創建這個lambda資源之後,我想將它作爲輸入傳遞給幾個變量並立即執行。有沒有辦法通過雲形成模板做到這一點?通過雲形成創建並執行aws lambda函數
AWSTemplateFormatVersion: '2010-09-09'
Description: Create a lambda function for chef rds read replica
Parameters:
Environment:
Description: Environment that will be built
Type: String
Default: q1
AllowedValues:
- q1
Mappings:
ChefEnvironmentMap:
q1:
IAMRole: CHEFAWS-RDS
Subnets:
- subnet-***
SecurityGroups:
- sg-***
NetCoreEnvironment: qa
Resources:
ChefRDSReadOnlyReplica:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket: cheftestbucket
S3Key: lambda/cheflambda.zip
Description: "Chef rds"
Environment:
Variables:
http_proxy: 'http://**'
https_proxy: 'http://**'
no_proxy: '169.254.169.254,127.0.0.1,localaddress,.localdomain.com'
Handler: createreadreplica.lambda_handler
MemorySize: 128
Role: arn:aws:iam::*****:role/CHEFAWS-RDS
Runtime: python2.7
Timeout: 60
VpcConfig:
SecurityGroupIds: !FindInMap [ChefEnvironmentMap, !Ref Environment, SecurityGroups]
SubnetIds: !FindInMap [ChefEnvironmentMap, !Ref Environment, Subnets]