awsdocs / aws-cdk-guide

User guide for the AWS Cloud Development Kit (CDK).
Other
335 stars 222 forks source link

Python getting started tutorial does not match current `cdk init` code #190

Closed webdog closed 4 years ago

webdog commented 4 years ago

:wave:

When running cdk init for Python, an app.py is generated:

#!/usr/bin/env python3

from aws_cdk import core

from cdk_getting_started.cdk_getting_started_stack import CdkGettingStartedStack

app = core.App()
CdkGettingStartedStack(app, "cdk-getting-started", env={'region': 'us-west-2'})

app.synth()

The Getting Started guide indicates that there should be two stacks created upon init:

#!/usr/bin/env python3

from aws_cdk import cdk
from hello.hello_stack import MyStack

app = cdk.App()

MyStack(app, "hello-cdk-1", env={'region': 'us-east-2'})
MyStack(app, "hello-cdk-2", env={'region': 'us-west-2'})

app.run()

I tried generating cdk init with both sample-app and my custom name above to see if the code generation was different, but both create a single stack based on the name I passed to cdk.

ghost commented 4 years ago

@webdog Looking at this further, this is a blog post, not part of our Developer Guide. Blog posts typically created around product and feature releases but are inherently "of their time" and we don't (can't) keep them up-to-date as the software evolves.

The Getting Started topic in the CDK Developer Guide and the CDK Workshop are the ones we keep up to date. I'm currently working on streamlining the former, so you should see improvements to that in the near future.

I'm going to close this issue, but maybe we need a disclaimer of some kind on our blog posts and point them to our Developer Guide.