diff --git a/java/hello-world/pom.xml b/java/hello-world/pom.xml index b89f30765..c72a83801 100644 --- a/java/hello-world/pom.xml +++ b/java/hello-world/pom.xml @@ -55,38 +55,38 @@ software.amazon.awscdk core - 1.14.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk autoscaling - 1.14.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk ec2 - 1.14.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk s3 - 1.14.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk sns - 1.14.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk sqs - 1.14.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk sns-subscriptions - 1.14.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) diff --git a/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaStack.java b/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaStack.java index 439e17d7d..b63fab649 100644 --- a/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaStack.java +++ b/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaStack.java @@ -3,7 +3,6 @@ import software.amazon.awscdk.core.Stack; import software.amazon.awscdk.core.Construct; import software.amazon.awscdk.services.autoscaling.AutoScalingGroup; -import software.amazon.awscdk.services.autoscaling.AutoScalingGroupProps; import software.amazon.awscdk.services.ec2.AmazonLinuxImage; import software.amazon.awscdk.services.ec2.InstanceType; import software.amazon.awscdk.services.ec2.Vpc; @@ -19,7 +18,7 @@ class HelloJavaStack extends Stack { public HelloJavaStack(final Construct parent, final String name) { super(parent, name); - Vpc vpc = new Vpc(this, "VPC"); + Vpc vpc = Vpc.Builder.create(this, "VPC").build(); MyAutoScalingGroupProps autoScalingGroupProps = new MyAutoScalingGroupProps(); autoScalingGroupProps.vpc = vpc; @@ -43,11 +42,11 @@ static class MyAutoScalingGroup extends Construct { MyAutoScalingGroup(final Construct parent, final String name, final MyAutoScalingGroupProps props) { super(parent, name); - new AutoScalingGroup(this, "Compute", AutoScalingGroupProps.builder() + AutoScalingGroup.Builder.create(this, "Compute") .instanceType(new InstanceType("t2.micro")) .machineImage(new AmazonLinuxImage()) .vpc(props.vpc) - .build()); + .build(); } @Override diff --git a/java/lambda-cron/pom.xml b/java/lambda-cron/pom.xml index b9d7e832b..5d5716c17 100644 --- a/java/lambda-cron/pom.xml +++ b/java/lambda-cron/pom.xml @@ -55,19 +55,19 @@ software.amazon.awscdk core - 1.12.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk lambda - 1.12.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) software.amazon.awscdk events-targets - 1.12.0.DEVPREVIEW + [1.17.0.DEVPREVIEW, 2) diff --git a/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronStack.java b/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronStack.java index 2808040d1..50fb6ae41 100644 --- a/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronStack.java +++ b/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronStack.java @@ -10,7 +10,6 @@ import software.amazon.awscdk.services.lambda.Code; import software.amazon.awscdk.services.lambda.Runtime; import software.amazon.awscdk.services.lambda.SingletonFunction; -import software.amazon.awscdk.services.lambda.SingletonFunctionProps; import java.util.UUID; @@ -21,25 +20,21 @@ class LambdaCronStack extends Stack { public LambdaCronStack(final Construct parent, final String name) { super(parent, name); - SingletonFunction lambdaFunction = new SingletonFunction(this, "cdk-lambda-cron", - SingletonFunctionProps.builder() - .description("Lambda which prints \"I'm running\"") - .code(Code.fromInline( - "def main(event, context):\n" + - " print(\"I'm running!\")\n")) - .handler("index.main") - .timeout(Duration.seconds(300)) - .runtime(Runtime.PYTHON_2_7) - .uuid(UUID.randomUUID().toString()) - .build() - ); + SingletonFunction lambdaFunction = SingletonFunction.Builder.create(this, "cdk-lambda-cron") + .description("Lambda which prints \"I'm running\"") + .code(Code.fromInline( + "def main(event, context):\n" + + " print(\"I'm running!\")\n")) + .handler("index.main") + .timeout(Duration.seconds(300)) + .runtime(Runtime.PYTHON_2_7) + .uuid(UUID.randomUUID().toString()) + .build(); - Rule rule = new Rule(this, "cdk-lambda-cron-rule", - RuleProps.builder() - .description("Run every day at 6PM UTC") - .schedule(Schedule.expression("cron(0 18 ? * MON-FRI *)")) - .build() - ); + Rule rule = Rule.Builder.create(this, "cdk-lambda-cron-rule") + .description("Run every day at 6PM UTC") + .schedule(Schedule.expression("cron(0 18 ? * MON-FRI *)")) + .build(); rule.addTarget(new LambdaFunction(lambdaFunction)); }