We received a tip from one of the remaining UnicornGames developers that a certain config file is an important piece of the Alien Attack application. If it’s not properly configured, the application will not run.
What are we fixing? The config file for the downloaded application is missing some critical information about your AWS backend.
In the Cloud9 Console, open the file aws-alien-attack/application/resources/js/awsconfig.js. It should look something like this:
const DEBUG = true;
const AWS_CONFIG = {
"region" : "<region where the env is deployed>",
"API_ENDPOINT" : "<API Gateway invoke URL>/v1/",
"APPNAME" : "<name of the application>"
}
You need to replace the <> fields with values related to the Alien Attack environment that you have just deployed using the AWS CDK. These values are the same ones you just copied over from the Outputs section when you ran cdk deploy
. If you need to find them again, follow the instructions below:
Find the API Endpoint for your API_ENDPOINT
field:
API_ENDPOINT
field inside of awsconfig.js. Add /v1/
to the end of that API_ENDPOINT value that you just pasted in.Find the region for your region
field:
The region will be the same region you’ve been working in for this workshop. You can extract the region name from your API Endpoint. It will look something like “us-west-2”, varying based on which region you are working out of.
Find the Application Name for your APPNAME
field:
This one is easy. Simply copy the value that you have selected for YourEnvironmentName, but make sure to convert this value to UPPERCASE. For example, if your environment name was alien123456789012, then the value for this field would be ALIEN123456789012.
If you entered everything correctly, your aws_config.js file will look something like this:
const DEBUG = true;
const AWS_CONFIG = {
"region" : "us-west-2",
"API_ENDPOINT" : " https://x22cd4aa99.execute-api.us-west-2.amazonaws.com/prod/v1/",
"APPNAME" : "ALIEN123456789012"
}
If you’re developing with a local terminal and IDE, be sure to save the config file using UTF-8 (pure text). Avoid editors that save the files with special characters. Don’t forget to maintain the quotes in the config file’s fields. e.g. “region” : “us-west-2”. Always remember to use uppercase for the value of the field APPNAME.