-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
@aws-cdk/aws-cloudformationRelated to AWS CloudFormationRelated to AWS CloudFormationbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1
Description
I get an undefined object when I access the attribute defaultChild from a NestedStack's node.
Reproduction Steps
I tried this code on https://play-with-cdk.com/
import * as cdk from '@aws-cdk/core';
import { CfnStack, NestedStack } from '@aws-cdk/aws-cloudformation';
// Keep the class name stable please
export class AppStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Add your code here
var nestedStack = new NestedStack(this, 'MyNestedStack');
var cfn_nestedStack = (nestedStack.node.defaultChild) as CfnStack;
cfn_nestedStack.addPropertyOverride('TemplateURL', 'http://my-url.com');
}
}
What did you expect to happen?
The stack to be synthesized without errors and with the TemplateURL parameter of the stack overriden.
What actually happened?
The synth crashes with this error:
TypeError: Cannot read property 'addPropertyOverride' of undefined
Environment
I have also tried it with Python and the same error happens.
- CLI Version : 1.59.0
- Framework Version: 1.59.0
- Node.js Version:
- OS : Ubuntu 18.04
- Language (Version): all
Other
This is 🐛 Bug Report
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cloudformationRelated to AWS CloudFormationRelated to AWS CloudFormationbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1