📅  最后修改于: 2022-03-11 14:58:26.240000             🧑  作者: Mango
There is no way (yet) to pass every parameter at once from the root stack to the nested stack. If you want to pass every parameter, you have to do it one by one.
Here is sample template to give you an idea.
Master.yaml:
Resources:
Cloudspan:
Type: "AWS::CloudFormation::Stack"
Properties:
Parameters:
LambdaName: Cloudspan
BucketName:
S3KeyName:
FunctionName:
TemplateURL:
Alignment:
Type: "AWS::CloudFormation::Stack"
Properties:
Parameters:
LambdaName: Alignment
BucketName:
S3KeyName:
FunctionName:
TemplateURL:
Lambda-child.yaml:
Parameters:
LambdaName:
Type: String
BucketName:
Type: String
S3KeyName:
Type: String
FunctionName:
Type: String
Resources:
LambdaFunction:
Type: "AWS::Lambda::Function"
Properties:
Handler: !Sub '${LambdaName}-{FunctionName}.Handler'
Role:
Fn::GetAtt: ['LambdaExecutionRole', Arn ]
Code:
S3Bucket: !Sub '${LambdaName}{BucketName}'
S3Key: !Sub '${LambdaName}{S3KeyName}'
Runtime: "python3.6"