Cdk python document mixed with Node.js code example
See original GitHub issue🐛 Bug Report
What is the problem?
Python document mixed with node.js code. For example, construct a new Vpc:
https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_ec2/Vpc.html
import { SubnetType, Vpc } from '@aws-cdk/aws-ec2'
const vpc = new Vpc(this, 'TheVPC', {
cidr: "10.0.0.0/16"
})
// Iterate the private subnets
const selection = vpc.selectSubnets({
subnetType: SubnetType.PRIVATE
});
for (const subnet of selection.subnets) {
// ...
}
This is node.js / typescript code, not python code.
Advanced Subnet Configuration Connection Peers …
https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_ec2.README.html
Amazon ECR Construct Library
https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_ecr.README.html
Reproduction Steps
Simple. For Vpc, in CLI do this:
$ python
>>> from aws_cdk.aws_ec2 import Vpc
>>> help(Vpc)
Environment
- CDK CLI Version:1.8.0 (build 5244f97)
- OS:OSX Mojave
- Language:Python
Original link for issue: https://github.com/aws-samples/aws-cdk-examples/issues/119
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Working with the AWS CDK in JavaScript
cdk init uses the name of the project folder to name various elements of the project, including classes, subfolders, and files. Hyphens in...
Read more >A Beginner's Guide to Create AWS CDK Construct Library with ...
jsii allows you to generate libraries from TypeScript code to work in Python, Java, and .NET. Create project. Create a Construct Library project ......
Read more >Examples and Guides - CDK for Terraform
Resources to help you learn CDK for Terraform, including example projects in Typescript, Java, Python, C#, and Go.
Read more >AWS CDK Toolkit - npm
They are files that include everything needed to deploy your app to a cloud environment. For example, it includes an AWS CloudFormation template...
Read more >How do I build lambdas in different languages using AWS ...
... which provide standard bundling for Python and Node.js, respectively. This AWS Blog post gives some more examples for bundling.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We are actually not going to convert the examples manually, but are building a system to do it automatically. As such, there is no place to contribute for now. When we’re done everything will be converted all at once.
Thanks for the offer to contribute! There may be some examples that may need work in the future, at which point we’ll gladly take you up on that 😃.
We are aware that all examples are in TypeScript and not in your language of choice (be it Python, Java or C#).
This is unfortunately the way things are today. We’d rather leave the examples in than take them out altogether, as the shape of the code should still be the same and you should be able to use a short set of translation rules to end up with code that would work in your language.
Rest assured that we are working on providing example code in multiple languages.