Exercise #0 - Environment Setup¶
There are a few services to deploy to kick off and because this is an empty account they can take a few minutes to deploy. The engineers we had hired have put together some AWS Cloud Development Kit stacks for us.
The AWS Cloud Development Kit (or, CDK) is in Developer Preview on GitHub. We are using the Java version here and you can see all the code within the infrastructure folder within AWS Cloud9.
This workshop uses AWS Cloud9 and we have only tested this workshop with Google Chrome and Mozilla Firefox. Please do not use Microsoft Edge, Internet Explorer, Safari, Opera or any of the numerous forks of browsers that exist.
Log into your AWS Account Console. You’ll need an account with Administrator Access to proceed with the workshop. Although this workshop will fit within default limits of a new AWS account, be mindful that if you are using an existing account you may hit your limits. Try and use an empty account, if possible.
When logged in, select N. Virginia as the region (us-east-1).
Type in Cloud9 into the Services box and click the suggested service name. You can also find it under All Services, within Developer Tools.
Click the Create environment button
Put in a suitable name, we suggest Fishing. Description is optional, but we suggest “I just fish we had more time”.
Click Next Step
For Instance Type, select m4.large – we’ll be doing a lot of Java. Be aware that this costs $0.1 per hour in the us-east-1 region.
Cost-saving setting – set to After 4 hours. What’s cool here is the instance will turn itself off, if you forget to delete it after the workshop, after 4 hours.
Click Next Step
Review the changes and click Create environment
After a while the IDE will appear!
You’ll be living in the Terminal for a lot of this so for now either expand it or click the button shown below to make it full browser size:
Now that we’ve completed setup of our IDE, we’re going to download the files provided by our engineers to configure our Cloud9 IDE with the packages and tools required for launching the new fishing shop website.
Run the following commands - each line is a separate command so
Although it’s tempting to copy all this at once - don’t. Copy each line one by one and it’ll be a lot more likely to be successful.
This is due to the way pasting new lines into a terminal can cause buffering issues.
You can either do this using the pre-bundled Tools Script or Manually. We recommend you using the Tools Script and look at the Manual tab for what it’s doing behind the scenes.
With the general setup done, we now need to use the AWS Cloud Development Kit to deploy our AWS CloudFormation stacks. First, we compile the Java code that defines our Stacks and then run the cdk commands to deploy it. The longest part to run is the cdk deploy so make sure you get to run that command before pausing to get coffee or watch the talks.
1 2 3 4
cd infrastructure ./mvnw package cdk bootstrap cdk deploy
This step can take around 15-20 minutes. Pause here and watch the talk or read through the Overview. Also, if you’re curious, you can take a look through the CDK code. The code is managed in infrastructure/src/main/java/fishing/lee/infrastructure/. The CDK app is located in InfrastructureApp.java, which references the construct in ShopStack.java. For more information, see AWS Cloud Development Kit.
The counter on the left of each line will go over the max number. This is due to an open issue with the AWS Cloud Development Kit and is nothing to worry about. It will finish! It’s because the stacks are optimised to reduce the deployment time to allow maximum time to work through the exercises.
You might see something like the following during the output and you can safely ignore it!
You might also see this at the top of the screen and it is also something to safely ignore.
- At the end of the process there’s some output variables and you can continue on with the exercises when instructed.
Exercise #0 is complete, please wait to be told to start Exercise #1