From d1e63af457acc3f2eb3691096f38ca612fcfe7c4 Mon Sep 17 00:00:00 2001 From: Adam Ruka Date: Fri, 12 Jul 2019 05:50:49 -0700 Subject: [PATCH] fix: CDK General Availability (1.0.0) updates (#76) Also build all examples in the PR build. --- .travis.yml | 10 ++++--- CONTRIBUTING.md | 4 +-- java/.gitignore | 2 ++ java/hello-world/pom.xml | 29 +++++++++---------- .../amazon/awscdk/examples/HelloJavaApp.java | 4 +-- .../awscdk/examples/HelloJavaStack.java | 13 ++++----- .../amazon/awscdk/examples/SinkQueue.java | 9 +++--- .../amazon/awscdk/examples/SinkQueueTest.java | 20 +++++++++---- .../testSubscribeTopics.expected.json | 8 ++--- java/lambda-cron/pom.xml | 18 ++++++------ .../amazon/awscdk/examples/LambdaCronApp.java | 4 +-- .../awscdk/examples/LambdaCronStack.java | 25 +++++++++------- .../awscdk/examples/LambdaCronStackTest.java | 6 ++-- .../amazon/awscdk/examples/TestUtils.java | 28 +++--------------- .../examples/testCronLambdaExpected.json | 8 +++-- java/package.json | 5 ++++ python/.gitignore | 2 ++ .../requirements.txt | 2 +- python/classic-load-balancer/requirements.txt | 2 +- python/custom-resource/requirements.txt | 2 +- python/ecs/cluster/requirements.txt | 2 +- .../requirements.txt | 2 +- .../requirements.txt | 2 +- .../requirements.txt | 2 +- .../requirements.txt | 2 +- .../requirements.txt | 2 +- .../requirements.txt | 2 +- python/lambda-cron/requirements.txt | 2 +- python/package.json | 5 ++++ python/stepfunctions/stepfunctions/.gitignore | 1 + scripts/build-java.sh | 6 +++- scripts/build-python.sh | 12 ++++++-- .../package.json | 2 +- .../application-load-balancer/package.json | 2 +- .../appsync-graphql-dynamodb/package.json | 2 +- typescript/classic-load-balancer/package.json | 2 +- typescript/custom-resource/package.json | 2 +- typescript/ecs/cluster/package.json | 2 +- .../ecs-load-balanced-service/package.json | 2 +- .../package.json | 2 +- .../ecs/ecs-service-with-logging/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../fargate-service-with-logging/package.json | 2 +- .../elasticbeanstalk-bg-pipeline/package.json | 2 +- .../elasticbeanstalk-environment/package.json | 2 +- typescript/lambda-cron/package.json | 2 +- typescript/my-widget-service/package.json | 2 +- typescript/resource-overrides/package.json | 2 +- typescript/static-site/package.json | 8 ++--- .../stepfunctions-job-poller/package.json | 2 +- 54 files changed, 158 insertions(+), 133 deletions(-) create mode 100644 java/package.json create mode 100644 python/.gitignore create mode 100644 python/package.json create mode 100644 python/stepfunctions/stepfunctions/.gitignore diff --git a/.travis.yml b/.travis.yml index fdecbb6f4..24ec7264a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ -language: node_js +language: generic +dist: bionic node_js: - "8" +python: + - "3.6" -install: echo Nothing to install -script: scripts/build-npm.sh - +install: sudo apt-get install python3.6-venv +script: scripts/build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 75a650bb2..f4e451024 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,7 +81,7 @@ Create a directory with a name that is descriptive of the resource type or workf ``` { "name": [name of your application], - "version": "0.23.0", + "version": "1.0.0", "description": [description of your application], "private": true, "scripts": { @@ -101,7 +101,7 @@ Create a directory with a name that is descriptive of the resource type or workf }, "dependencies": { ... - "@aws-cdk/core": "^0.36.0" + "@aws-cdk/core": "^1.0.0" } } ``` diff --git a/java/.gitignore b/java/.gitignore index 73df60d81..4eee3eb90 100644 --- a/java/.gitignore +++ b/java/.gitignore @@ -2,3 +2,5 @@ target .classpath .project .settings +node_modules +package-lock.json diff --git a/java/hello-world/pom.xml b/java/hello-world/pom.xml index d40fe7928..47aa7ce06 100644 --- a/java/hello-world/pom.xml +++ b/java/hello-world/pom.xml @@ -52,56 +52,55 @@ - - software.amazon.jsii - jsii-runtime - 0.7.14 - - software.amazon.awscdk - cdk - 0.23.0 + core + 1.0.0.DEVPREVIEW software.amazon.awscdk autoscaling - 0.23.0 + 1.0.0.DEVPREVIEW software.amazon.awscdk ec2 - 0.23.0 + 1.0.0.DEVPREVIEW software.amazon.awscdk s3 - 0.23.0 + 1.0.0.DEVPREVIEW software.amazon.awscdk sns - 0.23.0 + 1.0.0.DEVPREVIEW software.amazon.awscdk sqs - 0.23.0 + 1.0.0.DEVPREVIEW + + + software.amazon.awscdk + sns-subscriptions + 1.0.0.DEVPREVIEW com.fasterxml.jackson.core jackson-core - [2.9.8,) + 2.9.8 com.fasterxml.jackson.core jackson-databind - [2.9.8,) + 2.9.8 diff --git a/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaApp.java b/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaApp.java index 6cdec7480..85c5cbd64 100644 --- a/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaApp.java +++ b/java/hello-world/src/main/java/software/amazon/awscdk/examples/HelloJavaApp.java @@ -1,6 +1,6 @@ package software.amazon.awscdk.examples; -import software.amazon.awscdk.App; +import software.amazon.awscdk.core.App; public class HelloJavaApp { public static void main(final String[] args) { @@ -8,6 +8,6 @@ public static void main(final String[] args) { new HelloJavaStack(app, "hello-cdk"); - app.run(); + app.synth(); } } 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 2477b30e8..534a5f7a0 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 @@ -1,13 +1,12 @@ package software.amazon.awscdk.examples; -import software.amazon.awscdk.App; -import software.amazon.awscdk.Stack; -import software.amazon.awscdk.Construct; +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.VpcNetwork; +import software.amazon.awscdk.services.ec2.Vpc; import software.amazon.awscdk.services.sns.Topic; import java.util.Collections; @@ -17,10 +16,10 @@ * Hello, CDK for Java! */ class HelloJavaStack extends Stack { - public HelloJavaStack(final App parent, final String name) { + public HelloJavaStack(final Construct parent, final String name) { super(parent, name); - VpcNetwork vpc = new VpcNetwork(this, "VPC"); + Vpc vpc = new Vpc(this, "VPC"); MyAutoScalingGroupProps autoScalingGroupProps = new MyAutoScalingGroupProps(); autoScalingGroupProps.vpc = vpc; @@ -37,7 +36,7 @@ public HelloJavaStack(final App parent, final String name) { } static class MyAutoScalingGroupProps { - public VpcNetwork vpc; + public Vpc vpc; } static class MyAutoScalingGroup extends Construct { diff --git a/java/hello-world/src/main/java/software/amazon/awscdk/examples/SinkQueue.java b/java/hello-world/src/main/java/software/amazon/awscdk/examples/SinkQueue.java index 179b20fc4..b7c597e7b 100644 --- a/java/hello-world/src/main/java/software/amazon/awscdk/examples/SinkQueue.java +++ b/java/hello-world/src/main/java/software/amazon/awscdk/examples/SinkQueue.java @@ -1,7 +1,8 @@ package software.amazon.awscdk.examples; -import software.amazon.awscdk.Construct; +import software.amazon.awscdk.core.Construct; import software.amazon.awscdk.services.sns.Topic; +import software.amazon.awscdk.services.sns.subscriptions.SqsSubscription; import software.amazon.awscdk.services.sqs.Queue; import software.amazon.awscdk.services.sqs.QueueProps; @@ -32,7 +33,7 @@ public SinkQueue(final Construct parent, final String name, SinkQueueProps props // defaults QueueProps queueProps = props.getQueueProps(); - this.expectedTopicCount = props.getRequiredTopicCount() != null ? props.getRequiredTopicCount().intValue() : 10; + this.expectedTopicCount = props.getRequiredTopicCount() != null ? props.getRequiredTopicCount().intValue() : 0; // WORKAROUND: https://github.com/awslabs/aws-cdk/issues/157 if (queueProps == null) { @@ -58,10 +59,10 @@ public SinkQueue(final Construct parent, final String name) { */ public void subscribe(final Topic... topics) { for (Topic topic: topics) { - if (actualTopicCount == expectedTopicCount) { + if (expectedTopicCount != 0 && actualTopicCount >= expectedTopicCount) { throw new RuntimeException("Cannot add more topics to the sink. Maximum topics is configured to " + this.expectedTopicCount); } - topic.subscribeQueue(this.queue); + topic.addSubscription(new SqsSubscription(this.queue)); actualTopicCount++; } } diff --git a/java/hello-world/src/test/java/software/amazon/awscdk/examples/SinkQueueTest.java b/java/hello-world/src/test/java/software/amazon/awscdk/examples/SinkQueueTest.java index af77ec5f3..1d6d81cde 100644 --- a/java/hello-world/src/test/java/software/amazon/awscdk/examples/SinkQueueTest.java +++ b/java/hello-world/src/test/java/software/amazon/awscdk/examples/SinkQueueTest.java @@ -1,7 +1,11 @@ package software.amazon.awscdk.examples; -import software.amazon.awscdk.App; -import software.amazon.awscdk.Stack; +import software.amazon.awscdk.core.App; +import software.amazon.awscdk.core.ConstructNode; +import software.amazon.awscdk.core.Duration; +import software.amazon.awscdk.core.IConstruct; +import software.amazon.awscdk.core.Stack; +import software.amazon.awscdk.cxapi.CloudFormationStackArtifact; import software.amazon.awscdk.services.sns.Topic; import software.amazon.awscdk.services.sqs.QueueProps; import com.fasterxml.jackson.databind.JsonNode; @@ -31,7 +35,7 @@ public class SinkQueueTest { Stack stack = new Stack(); new SinkQueue(stack, "MySinkQueue", SinkQueueProps.builder() .withQueueProps(QueueProps.builder() - .withVisibilityTimeoutSec(500) + .withVisibilityTimeout(Duration.seconds(500)) .build()) .build()); assertTemplate(stack, "{\n" + @@ -92,7 +96,7 @@ public class SinkQueueTest { sink.subscribe(new Topic(stack, "Topic" + i)); } - app.synthesizeStack(stack.getName()); + getTemplate(stack); } private static void assertTemplate(final Stack stack, final URL expectedResource) throws IOException { @@ -104,7 +108,7 @@ private static void assertTemplate(final Stack stack, final String expectedTempl } private static void assertTemplate(final Stack stack, final JsonNode expected) throws IOException { - JsonNode actual = JSON.valueToTree(stack.toCloudFormation()); + JsonNode actual = JSON.valueToTree(getTemplate(stack)); // print to stderr if non-equal, so it will be easy to grab if (expected == null || !expected.equals(actual)) { @@ -114,4 +118,10 @@ private static void assertTemplate(final Stack stack, final JsonNode expected) t assertEquals(expected, actual); } + + private static Object getTemplate(Stack stack) { + IConstruct root = stack.getNode().getRoot(); + CloudFormationStackArtifact stackArtifact = ConstructNode.synth(root.getNode()).getStack(stack.getStackName()); + return stackArtifact.getTemplate(); + } } diff --git a/java/hello-world/src/test/resources/software/amazon/awscdk/examples/testSubscribeTopics.expected.json b/java/hello-world/src/test/resources/software/amazon/awscdk/examples/testSubscribeTopics.expected.json index 7c28ee9e0..1b63dd94e 100644 --- a/java/hello-world/src/test/resources/software/amazon/awscdk/examples/testSubscribeTopics.expected.json +++ b/java/hello-world/src/test/resources/software/amazon/awscdk/examples/testSubscribeTopics.expected.json @@ -6,7 +6,7 @@ "MySinkQueueEFCD79C2" : { "Type" : "AWS::SQS::Queue" }, - "Topic1ResourceSubscriptionD55B1556" : { + "MySinkQueueTopic1CE70DEAE" : { "Type" : "AWS::SNS::Subscription", "Properties" : { "Endpoint" : { @@ -78,7 +78,7 @@ } ] } }, - "Topic3ResourceSubscriptionA1D64BEE" : { + "MySinkQueueTopic30DEF4035" : { "Type" : "AWS::SNS::Subscription", "Properties" : { "Endpoint" : { @@ -93,7 +93,7 @@ "Topic269377B75" : { "Type" : "AWS::SNS::Topic" }, - "Topic2ResourceSubscription88B54B51" : { + "MySinkQueueTopic227CE18C6" : { "Type" : "AWS::SNS::Subscription", "Properties" : { "Endpoint" : { @@ -109,4 +109,4 @@ "Type" : "AWS::SNS::Topic" } } -} \ No newline at end of file +} diff --git a/java/lambda-cron/pom.xml b/java/lambda-cron/pom.xml index 6cdd5f2f6..f6f4c3c18 100644 --- a/java/lambda-cron/pom.xml +++ b/java/lambda-cron/pom.xml @@ -53,35 +53,35 @@ - software.amazon.jsii - jsii-runtime - 0.7.14 + software.amazon.awscdk + core + 1.0.0.DEVPREVIEW software.amazon.awscdk - cdk - 0.23.0 + lambda + 1.0.0.DEVPREVIEW software.amazon.awscdk - lambda - 0.23.0 + events-targets + 1.0.0.DEVPREVIEW com.fasterxml.jackson.core jackson-core - [2.9.8,) + 2.9.8 com.fasterxml.jackson.core jackson-databind - [2.9.8,) + 2.9.8 diff --git a/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronApp.java b/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronApp.java index 25597cb7b..43cd35795 100644 --- a/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronApp.java +++ b/java/lambda-cron/src/main/java/software/amazon/awscdk/examples/LambdaCronApp.java @@ -1,6 +1,6 @@ package software.amazon.awscdk.examples; -import software.amazon.awscdk.App; +import software.amazon.awscdk.core.App; public class LambdaCronApp { public static void main(final String[] args) { @@ -8,6 +8,6 @@ public static void main(final String[] args) { new LambdaCronStack(app, "cdk-lambda-cron-example"); - app.run(); + app.synth(); } } 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 398796232..229a5c17c 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 @@ -1,9 +1,12 @@ package software.amazon.awscdk.examples; -import software.amazon.awscdk.App; -import software.amazon.awscdk.Stack; -import software.amazon.awscdk.services.events.EventRule; -import software.amazon.awscdk.services.events.EventRuleProps; +import software.amazon.awscdk.core.Construct; +import software.amazon.awscdk.core.Duration; +import software.amazon.awscdk.core.Stack; +import software.amazon.awscdk.services.events.Rule; +import software.amazon.awscdk.services.events.RuleProps; +import software.amazon.awscdk.services.events.Schedule; +import software.amazon.awscdk.services.events.targets.LambdaFunction; import software.amazon.awscdk.services.lambda.Code; import software.amazon.awscdk.services.lambda.Runtime; import software.amazon.awscdk.services.lambda.SingletonFunction; @@ -15,7 +18,7 @@ * Lambda Cron CDK example for Java! */ class LambdaCronStack extends Stack { - public LambdaCronStack(final App parent, final String name) { + public LambdaCronStack(final Construct parent, final String name) { super(parent, name); SingletonFunction lambdaFunction = new SingletonFunction(this, "cdk-lambda-cron", @@ -26,19 +29,19 @@ public LambdaCronStack(final App parent, final String name) { "def main(event, context):\n" + " print(\"I'm running!\")\n")) .withHandler("index.main") - .withTimeout(300) - .withRuntime(Runtime.PYTHON27) + .withTimeout(Duration.seconds(300)) + .withRuntime(Runtime.PYTHON_2_7) .withUuid(UUID.randomUUID().toString()) .build() ); - EventRule rule = new EventRule(this, "cdk-lambda-cron-rule", - EventRuleProps.builder() + Rule rule = new Rule(this, "cdk-lambda-cron-rule", + RuleProps.builder() .withDescription("Run every day at 6PM UTC") - .withScheduleExpression("cron(0 18 ? * MON-FRI *)") + .withSchedule(Schedule.expression("cron(0 18 ? * MON-FRI *)")) .build() ); - rule.addTarget(lambdaFunction); + rule.addTarget(new LambdaFunction(lambdaFunction)); } } diff --git a/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/LambdaCronStackTest.java b/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/LambdaCronStackTest.java index 78f8112c4..d6e3b7ef2 100644 --- a/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/LambdaCronStackTest.java +++ b/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/LambdaCronStackTest.java @@ -3,8 +3,8 @@ import com.fasterxml.jackson.databind.JsonNode; import org.junit.Before; import org.junit.Test; -import software.amazon.awscdk.App; -import software.amazon.awscdk.Stack; +import software.amazon.awscdk.core.App; +import software.amazon.awscdk.core.Stack; import java.io.IOException; import java.util.List; @@ -78,4 +78,4 @@ public void testRule() { } } -} \ No newline at end of file +} diff --git a/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/TestUtils.java b/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/TestUtils.java index 65c944b3b..1df3a0933 100644 --- a/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/TestUtils.java +++ b/java/lambda-cron/src/test/java/software/amazon/awscdk/examples/TestUtils.java @@ -2,7 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import software.amazon.awscdk.Stack; +import software.amazon.awscdk.core.ConstructNode; +import software.amazon.awscdk.core.Stack; import java.io.IOException; import java.net.URL; @@ -10,8 +11,6 @@ import java.util.Optional; import java.util.stream.StreamSupport; -import static org.junit.Assert.assertEquals; - public class TestUtils { private static ObjectMapper JSON = new ObjectMapper(); @@ -20,31 +19,12 @@ static JsonNode fromFileResource(final URL fileResource) throws IOException { } static JsonNode toCloudFormationJson(final Stack stack) throws IOException { - JsonNode n = JSON.valueToTree(stack.toCloudFormation()); + ConstructNode rootNode = stack.getNode().getRoot().getNode(); + JsonNode n = JSON.valueToTree(ConstructNode.synth(rootNode).getStack(stack.getStackName()).getTemplate()); System.out.println(JSON.writerWithDefaultPrettyPrinter().writeValueAsString(n)); return n; } - static void assertTemplate(final Stack stack, final URL expectedResource) throws IOException { - assertTemplate(stack, JSON.readTree(expectedResource)); - } - - static void assertTemplate(final Stack stack, final String expectedTemplate) throws IOException { - assertTemplate(stack, JSON.readTree(expectedTemplate)); - } - - private static void assertTemplate(final Stack stack, final JsonNode expected) throws IOException { - JsonNode actual = toCloudFormationJson(stack); - - // print to stderr if non-equal, so it will be easy to grab - if (expected == null || !expected.equals(actual)) { - String prettyActual = JSON.writerWithDefaultPrettyPrinter().writeValueAsString(actual); - System.err.println(prettyActual); - } - - assertEquals(expected, actual); - } - static JsonNode getJsonNode(JsonNode stackJson, String type) { Iterable iterable = stackJson::elements; Optional maybe = StreamSupport.stream(iterable.spliterator(), false) diff --git a/java/lambda-cron/src/test/resources/software/amazon/awscdk/examples/testCronLambdaExpected.json b/java/lambda-cron/src/test/resources/software/amazon/awscdk/examples/testCronLambdaExpected.json index 9359bbbd8..d38f3d431 100644 --- a/java/lambda-cron/src/test/resources/software/amazon/awscdk/examples/testCronLambdaExpected.json +++ b/java/lambda-cron/src/test/resources/software/amazon/awscdk/examples/testCronLambdaExpected.json @@ -28,7 +28,11 @@ "Action" : "sts:AssumeRole", "Effect" : "Allow", "Principal" : { - "Service" : "lambda.amazonaws.com" + "Service" : { + "Fn::Join" : [ "", [ "lambda.", { + "Ref" : "AWS::URLSuffix" + } ] ] + } } } ] } @@ -64,4 +68,4 @@ } } } -} \ No newline at end of file +} diff --git a/java/package.json b/java/package.json new file mode 100644 index 000000000..5f1eb3c6c --- /dev/null +++ b/java/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "aws-cdk": "1.0.0" + } +} diff --git a/python/.gitignore b/python/.gitignore new file mode 100644 index 000000000..d5f19d89b --- /dev/null +++ b/python/.gitignore @@ -0,0 +1,2 @@ +node_modules +package-lock.json diff --git a/python/application-load-balancer/requirements.txt b/python/application-load-balancer/requirements.txt index 0e0ffb10a..66af9e0d4 100644 --- a/python/application-load-balancer/requirements.txt +++ b/python/application-load-balancer/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws-autoscaling aws-cdk.aws-ec2 diff --git a/python/classic-load-balancer/requirements.txt b/python/classic-load-balancer/requirements.txt index 8b2c935d9..83e19b1bf 100644 --- a/python/classic-load-balancer/requirements.txt +++ b/python/classic-load-balancer/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws-autoscaling aws-cdk.aws-ec2 diff --git a/python/custom-resource/requirements.txt b/python/custom-resource/requirements.txt index efc343e91..889dfa244 100644 --- a/python/custom-resource/requirements.txt +++ b/python/custom-resource/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws-cloudformation aws-cdk.aws-lambda diff --git a/python/ecs/cluster/requirements.txt b/python/ecs/cluster/requirements.txt index b0a596a34..b4d20ddaa 100644 --- a/python/ecs/cluster/requirements.txt +++ b/python/ecs/cluster/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws_autoscaling aws-cdk.aws_ec2 aws-cdk.aws_ecs diff --git a/python/ecs/ecs-load-balanced-service/requirements.txt b/python/ecs/ecs-load-balanced-service/requirements.txt index dafa03203..8c243b74b 100644 --- a/python/ecs/ecs-load-balanced-service/requirements.txt +++ b/python/ecs/ecs-load-balanced-service/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws_ec2 aws-cdk.aws_ecs aws-cdk.aws_ecs_patterns diff --git a/python/ecs/ecs-service-with-advanced-alb-config/requirements.txt b/python/ecs/ecs-service-with-advanced-alb-config/requirements.txt index ccc5f79f5..a19fbf22c 100644 --- a/python/ecs/ecs-service-with-advanced-alb-config/requirements.txt +++ b/python/ecs/ecs-service-with-advanced-alb-config/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws_ec2 aws-cdk.aws_ecs aws-cdk.aws_elasticloadbalancingv2 diff --git a/python/ecs/ecs-service-with-task-networking/requirements.txt b/python/ecs/ecs-service-with-task-networking/requirements.txt index ccc5f79f5..a19fbf22c 100644 --- a/python/ecs/ecs-service-with-task-networking/requirements.txt +++ b/python/ecs/ecs-service-with-task-networking/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws_ec2 aws-cdk.aws_ecs aws-cdk.aws_elasticloadbalancingv2 diff --git a/python/ecs/ecs-service-with-task-placement/requirements.txt b/python/ecs/ecs-service-with-task-placement/requirements.txt index ccc5f79f5..a19fbf22c 100644 --- a/python/ecs/ecs-service-with-task-placement/requirements.txt +++ b/python/ecs/ecs-service-with-task-placement/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws_ec2 aws-cdk.aws_ecs aws-cdk.aws_elasticloadbalancingv2 diff --git a/python/ecs/fargate-load-balanced-service/requirements.txt b/python/ecs/fargate-load-balanced-service/requirements.txt index dafa03203..8c243b74b 100644 --- a/python/ecs/fargate-load-balanced-service/requirements.txt +++ b/python/ecs/fargate-load-balanced-service/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws_ec2 aws-cdk.aws_ecs aws-cdk.aws_ecs_patterns diff --git a/python/ecs/fargate-service-with-autoscaling/requirements.txt b/python/ecs/fargate-service-with-autoscaling/requirements.txt index 37cfaf4b3..742cf71b3 100644 --- a/python/ecs/fargate-service-with-autoscaling/requirements.txt +++ b/python/ecs/fargate-service-with-autoscaling/requirements.txt @@ -1,4 +1,4 @@ -aws-cdk.cdk +aws-cdk.core aws-cdk.aws_ec2 aws-cdk.aws_ecs aws-cdk.aws_ecs_patterns diff --git a/python/lambda-cron/requirements.txt b/python/lambda-cron/requirements.txt index 40f09c414..fe047f34f 100644 --- a/python/lambda-cron/requirements.txt +++ b/python/lambda-cron/requirements.txt @@ -1,4 +1,4 @@ aws-cdk.aws-events aws-cdk.aws-events-targets aws-cdk.aws-lambda -aws-cdk.cdk +aws-cdk.core diff --git a/python/package.json b/python/package.json new file mode 100644 index 000000000..182121dbc --- /dev/null +++ b/python/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "aws-cdk": "*" + } +} diff --git a/python/stepfunctions/stepfunctions/.gitignore b/python/stepfunctions/stepfunctions/.gitignore new file mode 100644 index 000000000..b8dfcf426 --- /dev/null +++ b/python/stepfunctions/stepfunctions/.gitignore @@ -0,0 +1 @@ +stepfunctions.egg-info diff --git a/scripts/build-java.sh b/scripts/build-java.sh index b2124de99..333eb7f27 100755 --- a/scripts/build-java.sh +++ b/scripts/build-java.sh @@ -2,8 +2,12 @@ set -euo pipefail scriptdir=$(cd $(dirname $0) && pwd) +# install CDK CLI from npm, so that npx can find it later +cd $scriptdir/../java +npm install + # Find and build all Maven projects -for pomFile in $(find java -name pom.xml); do +for pomFile in $(find $scriptdir/../java -name pom.xml); do ( cd $(dirname $pomFile) mvn compile test diff --git a/scripts/build-python.sh b/scripts/build-python.sh index 18c8dcf3a..8a3710307 100755 --- a/scripts/build-python.sh +++ b/scripts/build-python.sh @@ -4,9 +4,17 @@ scriptdir=$(cd $(dirname $0) && pwd) python3 -m venv /tmp/.venv -# Find and build all Maven projects -for requirements in $(find python -name requirements.txt); do +# install CDK CLI from npm, so that npx can find it later +cd $scriptdir/../python +npm install + +# Find and build all Python projects +for requirements in $(find $scriptdir/../python -name requirements.txt -not -path "$scriptdir/../python/node_modules/*"); do ( + echo "==============================" + echo "building project: $requirements" + echo "==============================" + cd $(dirname $requirements) [[ ! -f DO_NOT_AUTOTEST ]] || exit 0 diff --git a/typescript/api-cors-lambda-crud-dynamodb/package.json b/typescript/api-cors-lambda-crud-dynamodb/package.json index 9dfe71738..fe7e6a39c 100644 --- a/typescript/api-cors-lambda-crud-dynamodb/package.json +++ b/typescript/api-cors-lambda-crud-dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "api-lambda-crud-dynamodb", - "version": "0.23.0", + "version": "1.0.0", "description": "Running an API Gateway with four Lambdas to do CRUD operations on DynamoDB", "private": true, "scripts": { diff --git a/typescript/application-load-balancer/package.json b/typescript/application-load-balancer/package.json index 2bd0f1029..baf3901fd 100644 --- a/typescript/application-load-balancer/package.json +++ b/typescript/application-load-balancer/package.json @@ -1,6 +1,6 @@ { "name": "application-load-balancer", - "version": "0.23.0", + "version": "1.0.0", "description": "Use of an Application Load Balancer with an AutoScaling Group", "private": true, "scripts": { diff --git a/typescript/appsync-graphql-dynamodb/package.json b/typescript/appsync-graphql-dynamodb/package.json index 2655c64bb..1ee91a833 100644 --- a/typescript/appsync-graphql-dynamodb/package.json +++ b/typescript/appsync-graphql-dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "appsync-graphql-dynamodb", - "version": "0.23.0", + "version": "1.0.0", "description": "Running a GraphQL API with four resolvers to do CRUD operations on DynamoDB", "private": true, "scripts": { diff --git a/typescript/classic-load-balancer/package.json b/typescript/classic-load-balancer/package.json index 91fd36e8a..28e196058 100644 --- a/typescript/classic-load-balancer/package.json +++ b/typescript/classic-load-balancer/package.json @@ -1,6 +1,6 @@ { "name": "classic-load-balancer", - "version": "0.23.0", + "version": "1.0.0", "description": "Use of a Classic Load Balancer with an AutoScaling Group", "private": true, "scripts": { diff --git a/typescript/custom-resource/package.json b/typescript/custom-resource/package.json index 4803f745e..a15d37b4e 100644 --- a/typescript/custom-resource/package.json +++ b/typescript/custom-resource/package.json @@ -1,6 +1,6 @@ { "name": "custom-resource", - "version": "0.23.0", + "version": "1.0.0", "description": "Shows how to use a custom resource", "private": true, "scripts": { diff --git a/typescript/ecs/cluster/package.json b/typescript/ecs/cluster/package.json index 0b80c9968..091bb03db 100644 --- a/typescript/ecs/cluster/package.json +++ b/typescript/ecs/cluster/package.json @@ -1,6 +1,6 @@ { "name": "ecs-cluster", - "version": "0.25.1", + "version": "1.0.0", "description": "Basic ECS Cluster", "private": true, "scripts": { diff --git a/typescript/ecs/ecs-load-balanced-service/package.json b/typescript/ecs/ecs-load-balanced-service/package.json index 991a33bad..739d9bd1f 100644 --- a/typescript/ecs/ecs-load-balanced-service/package.json +++ b/typescript/ecs/ecs-load-balanced-service/package.json @@ -1,6 +1,6 @@ { "name": "ecs-load-balanced-service", - "version": "0.25.1", + "version": "1.0.0", "description": "Running a load balanced service on ECS", "private": true, "scripts": { diff --git a/typescript/ecs/ecs-service-with-advanced-alb-config/package.json b/typescript/ecs/ecs-service-with-advanced-alb-config/package.json index fd2417560..fc5d2ff84 100644 --- a/typescript/ecs/ecs-service-with-advanced-alb-config/package.json +++ b/typescript/ecs/ecs-service-with-advanced-alb-config/package.json @@ -1,6 +1,6 @@ { "name": "ec2-service-with-alb", - "version": "0.25.1", + "version": "1.0.0", "description": "EC2 Service with Application Load Balancer", "private": true, "scripts": { diff --git a/typescript/ecs/ecs-service-with-logging/package.json b/typescript/ecs/ecs-service-with-logging/package.json index f2c9bbe5a..05bb21708 100644 --- a/typescript/ecs/ecs-service-with-logging/package.json +++ b/typescript/ecs/ecs-service-with-logging/package.json @@ -1,6 +1,6 @@ { "name": "ecs-service-with-logging", - "version": "0.23.0", + "version": "1.0.0", "description": "Running a load balanced service on ECS", "private": true, "scripts": { diff --git a/typescript/ecs/ecs-service-with-task-networking/package.json b/typescript/ecs/ecs-service-with-task-networking/package.json index d7f0dd10d..9134b0dda 100644 --- a/typescript/ecs/ecs-service-with-task-networking/package.json +++ b/typescript/ecs/ecs-service-with-task-networking/package.json @@ -1,6 +1,6 @@ { "name": "ecs-service-with-task-networking", - "version": "0.25.1", + "version": "1.0.0", "description": "ECS Service with Task Networking", "private": true, "scripts": { diff --git a/typescript/ecs/ecs-service-with-task-placement/package.json b/typescript/ecs/ecs-service-with-task-placement/package.json index fd2417560..fc5d2ff84 100644 --- a/typescript/ecs/ecs-service-with-task-placement/package.json +++ b/typescript/ecs/ecs-service-with-task-placement/package.json @@ -1,6 +1,6 @@ { "name": "ec2-service-with-alb", - "version": "0.25.1", + "version": "1.0.0", "description": "EC2 Service with Application Load Balancer", "private": true, "scripts": { diff --git a/typescript/ecs/fargate-load-balanced-service/package.json b/typescript/ecs/fargate-load-balanced-service/package.json index ca873f8ee..f6c5d897d 100644 --- a/typescript/ecs/fargate-load-balanced-service/package.json +++ b/typescript/ecs/fargate-load-balanced-service/package.json @@ -1,6 +1,6 @@ { "name": "fargate-load-balanced-service", - "version": "0.25.1", + "version": "1.0.0", "description": "Running a load balanced service on Fargate", "private": true, "scripts": { diff --git a/typescript/ecs/fargate-service-with-auto-scaling/package.json b/typescript/ecs/fargate-service-with-auto-scaling/package.json index e1378e0d5..15323af18 100644 --- a/typescript/ecs/fargate-service-with-auto-scaling/package.json +++ b/typescript/ecs/fargate-service-with-auto-scaling/package.json @@ -1,6 +1,6 @@ { "name": "fargate-service-with-auto-scaling", - "version": "0.25.2", + "version": "1.0.0", "description": "ECS Service of launch type FARGATE with Application Auto Scaling", "private": true, "scripts": { diff --git a/typescript/ecs/fargate-service-with-local-image/package.json b/typescript/ecs/fargate-service-with-local-image/package.json index 8520dfd3f..764780dca 100644 --- a/typescript/ecs/fargate-service-with-local-image/package.json +++ b/typescript/ecs/fargate-service-with-local-image/package.json @@ -1,6 +1,6 @@ { "name": "fargate-service-with-local-image", - "version": "0.25.1", + "version": "1.0.0", "description": "Running a load balanced service on Fargate with an image loaded locally", "private": true, "scripts": { diff --git a/typescript/ecs/fargate-service-with-logging/package.json b/typescript/ecs/fargate-service-with-logging/package.json index 39cdb675a..99cc73ed1 100644 --- a/typescript/ecs/fargate-service-with-logging/package.json +++ b/typescript/ecs/fargate-service-with-logging/package.json @@ -1,6 +1,6 @@ { "name": "fargate-service-with-logging", - "version": "0.23.0", + "version": "1.0.0", "description": "Running a load balanced service on ECS", "private": true, "scripts": { diff --git a/typescript/elasticbeanstalk/elasticbeanstalk-bg-pipeline/package.json b/typescript/elasticbeanstalk/elasticbeanstalk-bg-pipeline/package.json index f9b29ff90..30948435a 100644 --- a/typescript/elasticbeanstalk/elasticbeanstalk-bg-pipeline/package.json +++ b/typescript/elasticbeanstalk/elasticbeanstalk-bg-pipeline/package.json @@ -1,6 +1,6 @@ { "name": "elasticbeanstalk-bg-pipeline", - "version": "0.1.0", + "version": "1.0.0", "description": "Creates a Blue/Green deployment to EBS", "private": true, "scripts": { diff --git a/typescript/elasticbeanstalk/elasticbeanstalk-environment/package.json b/typescript/elasticbeanstalk/elasticbeanstalk-environment/package.json index 6aff7584f..2e982d3b1 100644 --- a/typescript/elasticbeanstalk/elasticbeanstalk-environment/package.json +++ b/typescript/elasticbeanstalk/elasticbeanstalk-environment/package.json @@ -1,6 +1,6 @@ { "name": "elasticbeanstalk-environment", - "version": "0.1.0", + "version": "1.0.0", "description": "Creates a Blue/Green deployment to EBS", "private": true, "scripts": { diff --git a/typescript/lambda-cron/package.json b/typescript/lambda-cron/package.json index 66c02855c..5b1017cd2 100644 --- a/typescript/lambda-cron/package.json +++ b/typescript/lambda-cron/package.json @@ -1,6 +1,6 @@ { "name": "lambda-cron", - "version": "0.23.0", + "version": "1.0.0", "description": "Running a Lambda on a schedule", "private": true, "scripts": { diff --git a/typescript/my-widget-service/package.json b/typescript/my-widget-service/package.json index 9214cfd77..9732c051a 100644 --- a/typescript/my-widget-service/package.json +++ b/typescript/my-widget-service/package.json @@ -1,6 +1,6 @@ { "name": "my-widget-service", - "version": "0.1.0", + "version": "1.0.0", "description": "Use Lambda to serve up widgets.", "private": true, "scripts": { diff --git a/typescript/resource-overrides/package.json b/typescript/resource-overrides/package.json index f77ad8542..71f6b5b3d 100644 --- a/typescript/resource-overrides/package.json +++ b/typescript/resource-overrides/package.json @@ -1,6 +1,6 @@ { "name": "resource-overrides", - "version": "0.23.0", + "version": "1.0.0", "description": "Shows how to access the CloudFormation layer", "private": true, "scripts": { diff --git a/typescript/static-site/package.json b/typescript/static-site/package.json index f74caed7e..9f9c826a1 100644 --- a/typescript/static-site/package.json +++ b/typescript/static-site/package.json @@ -1,6 +1,6 @@ { "name": "static-site", - "version": "0.24.2", + "version": "1.0.0", "description": "Infrastructure for an HTTPS static site using S3 and CloudFront", "scripts": { "build": "tsc", @@ -18,13 +18,13 @@ "typescript": "^3.2.4" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "^0.38.0", + "@aws-cdk/aws-certificatemanager": "*", "@aws-cdk/aws-cloudfront": "*", - "@aws-cdk/aws-iam": "^0.38.0", + "@aws-cdk/aws-iam": "*", "@aws-cdk/aws-route53": "*", "@aws-cdk/aws-route53-targets": "*", "@aws-cdk/aws-s3": "*", "@aws-cdk/core": "*", - "aws-cdk": "^0.38.0" + "aws-cdk": "*" } } diff --git a/typescript/stepfunctions-job-poller/package.json b/typescript/stepfunctions-job-poller/package.json index 52822b502..a2f012c2c 100644 --- a/typescript/stepfunctions-job-poller/package.json +++ b/typescript/stepfunctions-job-poller/package.json @@ -1,6 +1,6 @@ { "name": "stepfunctions-job-poller", - "version": "0.23.0", + "version": "1.0.0", "description": "A simple StepFunctions demo", "private": true, "scripts": {