In this module we will be using AWS Cloud9. WS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser. It includes a code editor, debugger, and terminal. Cloud9 comes prepackaged with essential tools for popular programming languages, including JavaScript, Python, PHP, and more, so you don’t need to install files or configure your development machine to start new projects. Since your Cloud9 IDE is cloud-based, you can work on your projects from your office, home, or anywhere using an internet-connected machine. Cloud9 also provides a seamless experience for developing serverless applications enabling you to easily define resources, debug, and switch between local and remote execution of serverless applications. With Cloud9, you can quickly share your development environment with your team, enabling you to pair program and track each other’s inputs in real time.
Contents
Using Search box - type in cloud9
and choose Cloud9 service. Then click Create environment. This will bring up a new screen, enter Your name in the name field and click Next Step.
For Environment type, choose Create a new EC2 Instance for environment (direct access)
For Instance type, choose a t3.small
For Platform, choose Amazon Linux 2
Under VPC chose the DevAxNetworkVPC (remember, you can find the VPC ID in the AWS Console under VPC) and choose the same subnet as the DevAxWindowsHost
in the ec2 instance menu. Click Next step.
Review your settings and click Create environment.
This will take a few minutes to start up,
and you should get redirected to the AWS Cloud9 screen.
We now need to setup the required **JAVA version to be 1.8** and change the required parameters on the IDE. We will be using Amazon Corretto, a no-cost, multiplatform, production-ready distribution of OpenJDK. Corretto comes with long-term support that will include performance enhancements and security fixes.
sudo amazon-linux-extras enable corretto8
sudo yum install -y java-1.8.0-amazon-corretto-devel
1.8.0_265
):java -version
You should see output similar to the following:
Admin:~/environment $
openjdk version "1.8.0_265"
OpenJDK Runtime Environment Corretto-8.265.01.1 (build 1.8.0_265-b01)
OpenJDK 64-Bit Server VM Corretto-8.265.01.1 (build 25.265-b01, mixed mode)
We will install the AWS Serverless Application Model (SAM) Cli to our AWS Cloud9 environment. The AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications. It provides shorthand syntax to express functions, APIs, databases, and event source mappings. With just a few lines per resource, you can define the application you want and model it using YAML. During deployment, SAM transforms and expands the SAM syntax into AWS CloudFormation syntax, enabling you to build serverless applications faster.
sudo pip3 install --upgrade aws-sam-cli
We will use Apache Maven to manage project build and dependancy management for our project.
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
Unfortunately the maven installer switches our JDK to 1.7
so we need to switch back to 1.8.9
.
sudo alternatives --config java #enter the number for corretto 8
sudo alternatives --config javac #enter the number for corretto 8
You should see something similar to the following:
We need to populate a DynamoDB table with information that will be used during the lab. This information will be used to calculate trips between different cities.