AWSTemplateFormatVersion: "2010-09-09" Transform: AWS::Serverless-2016-10-31 Globals: Function: Timeout: 10 Parameters: ParentLayer: Description: The name of the layer Type: String HelloWorldLayerName: Type: String Description: Name of the HelloWorldLayer which will be used with current deployment Resources: ChildFunction: Type: AWS::Serverless::Function Properties: # Currently if a base_dir option is provided, the nested stack code URIs # Needs to be relative to the base_dir instead of the child templates # Changing this behaviour raises concerns of breaking change since # Build with nested stack already exhibits this behaviour CodeUri: child_functions/ Handler: child_function.lambda_handler Runtime: python3.7 Layers: - Ref: ParentLayer Tracing: Active HelloWorldLayer: Type: AWS::Serverless::LayerVersion Properties: LayerName: !Ref HelloWorldLayerName Description: Hello World Layer # Currently if a base_dir option is provided, the nested stack code URIs # Needs to be relative to the base_dir instead of the child templates # Changing this behaviour raises concerns of breaking change since # Build with nested stack already exhibits this behaviour ContentUri: ../root_layer/ CompatibleRuntimes: - python3.7 Metadata: BuildMethod: python3.7 ChildChildStack: Type: AWS::Serverless::Application Properties: # This however can only resolve relative to the current template Location: child_child_stack/template.yaml Parameters: ParentLayer1: !Ref HelloWorldLayer ParentLayer2: !Ref ParentLayer