diff --git a/packages/aws-cdk/lib/init-templates/v1/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java b/packages/aws-cdk/lib/init-templates/v1/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java index b9a43e4549097..ba81d115702f8 100644 --- a/packages/aws-cdk/lib/init-templates/v1/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +++ b/packages/aws-cdk/lib/init-templates/v1/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java @@ -2,6 +2,7 @@ import software.amazon.awscdk.core.App; import software.amazon.awscdk.core.Environment; +import software.amazon.awscdk.core.StackProps; import java.util.Arrays; @@ -9,31 +10,36 @@ public class %name.PascalCased%App { public static void main(final String[] args) { App app = new App(); - %name.PascalCased%Stack.Builder.create(app, "%name.PascalCased%Stack") - // If you don't specify 'env', this stack will be environment-agnostic. - // Account/Region-dependent features and context lookups will not work, - // but a single synthesized template can be deployed anywhere. + // If you don't specify 'env', this stack will be environment-agnostic. + // Account/Region-dependent features and context lookups will not work, + // but a single synthesized template can be deployed anywhere. + new %name.PascalCased%Stack(app, "%name.PascalCased%Stack"); - // Uncomment the next block to specialize this stack for the AWS Account - // and Region that are implied by the current CLI configuration. - /* + // Replace the above stack intialization with the following to specialize + // this stack for the AWS Account and Region that are implied by the current + // CLI configuration. + /* + new %name.PascalCased%Stack(app, "%name.PascalCased%Stack", StackProps.builder() .env(Environment.builder() .account(System.getenv("CDK_DEFAULT_ACCOUNT")) .region(System.getenv("CDK_DEFAULT_REGION")) .build()) - */ + .build()); + */ - // Uncomment the next block if you know exactly what Account and Region you - // want to deploy the stack to. - /* + // Replace the above stack initialization with the following if you know exactly + // what Account and Region you want to deploy the stack to. + /* + new %name.PascalCased%Stack(app, "%name.PascalCased%Stack", StackProps.builder() .env(Environment.builder() .account("123456789012") .region("us-east-1") .build()) - */ - // For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html - .build(); + .build()); + */ + + // For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html app.synth(); } diff --git a/packages/aws-cdk/lib/init-templates/v2/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java b/packages/aws-cdk/lib/init-templates/v2/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java index d68e49440506b..fb0d9b89350fa 100644 --- a/packages/aws-cdk/lib/init-templates/v2/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +++ b/packages/aws-cdk/lib/init-templates/v2/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java @@ -9,31 +9,36 @@ public class %name.PascalCased%App { public static void main(final String[] args) { App app = new App(); - %name.PascalCased%Stack.Builder.create(app, "%name.PascalCased%Stack") - // If you don't specify 'env', this stack will be environment-agnostic. - // Account/Region-dependent features and context lookups will not work, - // but a single synthesized template can be deployed anywhere. - - // Uncomment the next block to specialize this stack for the AWS Account - // and Region that are implied by the current CLI configuration. - /* + // If you don't specify 'env', this stack will be environment-agnostic. + // Account/Region-dependent features and context lookups will not work, + // but a single synthesized template can be deployed anywhere. + new %name.PascalCased%Stack(app, "%name.PascalCased%Stack"); + + // Replace the above stack intialization with the following to specialize + // this stack for the AWS Account and Region that are implied by the current + // CLI configuration. + /* + new %name.PascalCased%Stack(app, "%name.PascalCased%Stack", StackProps.builder() .env(Environment.builder() .account(System.getenv("CDK_DEFAULT_ACCOUNT")) .region(System.getenv("CDK_DEFAULT_REGION")) .build()) - */ + .build()); + */ - // Uncomment the next block if you know exactly what Account and Region you - // want to deploy the stack to. - /* + // Replace the above stack initialization with the following if you know exactly + // what Account and Region you want to deploy the stack to. + /* + new %name.PascalCased%Stack(app, "%name.PascalCased%Stack", StackProps.builder() .env(Environment.builder() .account("123456789012") .region("us-east-1") .build()) - */ - // For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html - .build(); + .build()); + */ + + // For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html app.synth(); }