Skip to main content

Setting up the Development Environment

Objective

This guide shows you how to setup the development environment to for the workshop.

warning

In this workshop there will be a number of AWS resources created in your account. These resources will incur cost and will be billed to your AWS Account, make sure you delete all resources after the workshop to avoid unnecessary costs. Please refer to the cleanup section.

You can use the following setup to create a virtual development environment by using AWS Cloud9.

1. Deploying AWS CloudFormation template for Cloud9 instance and the workshop infrastructure

Go to the AWS CloudShell console directly, or navigate to AWS CloudShell in the AWS console.

info

If using the link above make sure the AWS console has opened in the region that you wish to run the labs in.

Deploy AWS CloudFormation template

curl https://raw.githubusercontent.com/aws-samples/java-on-aws/main/labs/unicorn-store/infrastructure/cfn/java-on-aws-workshop.yaml > java-on-aws-workshop.yaml
aws cloudformation deploy --stack-name java-on-aws-workshop \
--template-file ./java-on-aws-workshop.yaml \
--capabilities CAPABILITY_NAMED_IAM

Wait until the command finish successfully.

Go to the AWS CloudFormation console directly, or navigate to AWS CloudFormation in the AWS console.

Verify that the Stacks reached the CREATE_COMPLETE status.

info

The creation of the stacks might take around 30 minutes.

cloudformation

2. Accessing AWS Cloud9 Instance

Go to the AWS Cloud 9 console directly, or navigate to Cloud9 in the AWS console:

cloud9-console

Click on "Open" for the "java-on-aws-workshop" instance to connect to Cloud9 IDE:

cloud9-list

When asked about "Working with Java?" - click "Activate" and refresh the entire browser page to activate the extension.

java-confirm

info

In case if you see Information: AWS Toolkit. "Connection expired. To continue using CodeWhisperer, connect with AWS Builder ID or AWS IAM Identity center.", click "Don't Show Again" and continue.

You have now successfully opened Cloud9 instance.

After opening the Cloud9 instance, you can find the workshop code in the left sidebar. You can close the welcome window and use the "New terminal" command to open the terminal window and execute the commands provided in the workshop.

cloud9-new-terminal

cloud9-terminal

warning

AWS Cloud9 does not auto-save your files. Please ensure to save your files before deploying any changes via Ctrl+S or the top menu File→Save all.

Conclusion

Once you've verified access to the AWS account and AWS Cloud9 instance, you should have everything you need to get started with this workshop.