2. Create a workspace

The Cloud9 workspace should be built by an IAM user with Administrator privileges, not the root account user. Please ensure you are logged in as an IAM user, not the root account user.

Ad blockers, javascript disablers, and tracking blockers should be disabled for the Cloud9 domain, or connecting to the workspace might be impacted. Cloud9 requires third-party-cookies. You can whitelist these specific domains.

Create your AWS Cloud9 Environment

  1. Visit the Cloud9 Console and select Create environment.
  2. Name the environment AlienAttackWorkshop, and on the next page select t3.small as your instance type, and accept all the other defaults.
  3. Once your Cloud9 environment has launched, proceed to the next section.

Clone the repository

In this section, you will be cloning the repository for Alien Attack game. This is the code that we will need to fix. The frontend code controls what the gamers and the manager sees on the static website, while the backend code helps to deploy the architecture that handles how we process the game’s data and logic behind-the-scenes.

In your Cloud9 environment, a terminal is available. Go to the terminal and clone the Alien Attack repository into your Cloud9 environment with the following command:

git clone https://github.com/aws-samples/aws-alien-attack

At this point, if you look at the left hand side of your Cloud9 environment, your folder tree should show a main folder, aws-alien-attack, and inside it three additional folders: one for the application (the front-end), another one for the infrastructure (the back-end), and one for images which is just to support the website cosmetics and you can disregard.

Note: The frond-end is not yet compatible with mobile devices, and may not work well with some versions of Windows that support touchscreen.

Update the Environment

Next, we have to update and configure your current environment based on the new Alien Attack files that you have access to.

  1. In your terminal, enter the following command to change directories into the alienattack.workshop folder:
cd aws-alien-attack/infrastructure/

Once you’ve done this, ensure that your terminal screen shows: ~/environment/aws-alien-attack/infrastructure

  1. Next, run the following command to update and configure your environment:
source config.sh

Note: You may see some warning messages appear related to python, disregard these.

After configuring the operating system and installing the tools required to compile and build the source code, the script will ask you to input your initials to define an exclusive name for your environment. This is important to reduce the probability of naming collision for the S3 buckets that are going to be created, and to avoid resource name collisions when two or more users are sharing the same AWS account and region to run the environment.

So, suppose that someone is going to provide FMDS as the initials, you might expect to see a message like the one below:


When we define the exclusive environment name all resources
in your infrastructure will have their IDs prefixed by this
environment name.
This is a workaround to guarantee that this workshop can run
with multiple users under a single AWS account

What are your initials? fmds
Your environment name was defined as FMDSAAAD5F4D6

See that the environment name is composed by the initials provided (in this example, FMDS), followed by the string AAA (from AWS Alien Attack), and then a suffix which is a random code generate automatically (in this example D5F4D6).

It’s unlikely, but you may still incur naming collision. If that happens, we will provide you guidance on how to solve that.

Save the value of your environment name in a helper file on Cloud9. You are going to need it later.

Hint: you can still retrieve this value from your console by running the following command in your terminal:

echo $envname

or, the lowercase version if you want:

echo $envnameLowercase