Lee (2) [Avatar] Offline

I am trying to create a stack using the template from https://s3.amazonaws.com/awsinaction/chapter2/template.json but I am unable to do so.

The status reason I get is: "Parameter validation failed: parameter value for parameter name KeyName does not exist. Rollback requested by user". Any help is appreciated.

Many Thanks,
Lee (2) [Avatar] Offline
Problem solved. The key pair I created earlier was in the wrong region.
Andreas Wittig (71) [Avatar] Offline
Hi Lee,

glad you solved the problem yourself.

Stay AWSome!
Steve R (2) [Avatar] Offline
Actually, there is still an issue that has not been clarified by the errata at this site:

Upon create at page 40, I get this error:
Template validation error: Template error: Unable to get mapping for EC2RegionMap::us-east-2::AmazonLinuxAMIHVMEBSBacked64bit

I am located in Florida (maybe location determines the default region).

On page 29, we create a key pair that is used later, during stack creation.

At page 29, my Region selector has defaulted to Ohio, us-east-2.
However, the book assumes that us-east-1 (N. Virginia) will be used.

I see that us-east-2 is not defined in the json file used on page 37:

Some options:
Option 1. The json at the link above needs to continually be updated to include new regions so it will "just work".
Option 2. Tell the user to click on their region in the upper right-hand corner and change it to N. Virginia, and then continue from page 29 (create a key pair for that region).
Option 3. **The following did not work.** I got this error during creation: "AMI 'ami-ca3b11af' with an instance-store root device is not supported for the instance type 't2.micro'. Launching EC2 instance failed."
Provide the user with steps to perform at page 37 to modify the json to add the appropriate AMI for their region which is missing. (https://aws.amazon.com/amazon-linux-ami/ , HVM Instance Store 64-bit for their matching region.. ). For my default region, Ohio, us-east-2, I had to add the following line:
"us-east-2": {"AmazonLinuxAMIHVMEBSBacked64bit": "ami-ca3b11af"},
Then save to AWS (upper left hand corner). Copy the link. Then during Cloud Formation, paste that link for the json file URL.

Also, unrelated to this post.. Searching for AWS in action errata returns this link:

This github wants the user to have Hugo, Mage, Go installed on a linux machine to do anything.. Sometimes it is a challenge to get all of that infrastructure setup (no admin access on a work pc). Respectfully, perhaps the github can link to hosted version that may exist.
Andreas Wittig (71) [Avatar] Offline
Hi Steve,

thanks a lot for your feedback, I'm sorry that you had troubles while following the examples within our book. Our examples are designed for us-east-1 only which is highlighted multiple times within the first chapters. Though, we haven't added this information to every example to reduce redundancy.

By the way: we have added us-east-2 to our examples for the 2nd edition of our book: https://github.com/AWSinAction/code2

Will add a link to the errata of our book to GitHub.

Ed (2) [Avatar] Offline
I had the same issue. In chapter 1.8.2, under figure 1.24, it says "Your region - Lets you choose your region. You'll learn about regions in section 3.5. You don't need to change anything here now."

Key pairs are created in chapter 1.8.3, at which time we're still in our default region. Mine happened to be Ohio. Given the previous advice that there was no need to change it, I left it alone and created a key pair for that region.

The bit about switching to Northern Virginia first appears in Chapter 2.1, after the key pair has been created. I switch, try the example, of course the key pair can't be found and it fails. Not hard to figure out and fix, but it shouldn't be necessary.

Andreas Wittig (71) [Avatar] Offline
Which edition are you referring to, Ed? 1st or 2nd edition?
Ed (2) [Avatar] Offline
I'm reading it on safaribooksonline. I think that makes it first edition.