Complete the code to define a nested stack resource in AWS CloudFormation.
Resources:
NestedStack:
Type: [1]
Properties:
TemplateURL: https://s3.amazonaws.com/mybucket/mytemplate.yamlThe nested stack resource type in CloudFormation is AWS::CloudFormation::Stack. This allows you to include another template inside your main template.
Complete the code to pass a parameter named 'EnvType' to the nested stack.
Resources:
NestedStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/mybucket/mytemplate.yaml
Parameters:
EnvType: [1]To pass a parameter from the parent stack to the nested stack, you use !Ref EnvType to reference the parameter value defined in the parent stack.
Fix the error in the nested stack resource by completing the missing property key.
Resources:
NestedStack:
Type: AWS::CloudFormation::Stack
Properties:
[1]: https://s3.amazonaws.com/mybucket/mytemplate.yamlThe correct property to specify the location of the nested stack template is TemplateURL. It must be a URL to the template file in S3 or another accessible location.
Fill both blanks to define outputs in the nested stack and reference them in the parent stack.
Resources:
NestedStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/mybucket/mytemplate.yaml
Outputs:
NestedOutputValue:
Value: ![1] NestedStack.[2]To get an output value from a nested stack, you use !GetAtt NestedStack.Outputs.OutputName. Here, Outputs is the key to access the nested stack's outputs.
Fill all three blanks to pass multiple parameters and set the timeout for the nested stack.
Resources:
NestedStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/mybucket/mytemplate.yaml
Parameters:
EnvType: [1]
InstanceType: [2]
[3]: 30To pass parameters, use !Ref to reference parent stack parameters. The timeout property for nested stacks is TimeoutInMinutes.