-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback on getting started with this Tutorial #2
Comments
Update: the mechanism to switch role doesn't work. The only way I've got it to work so far is to add an explicit |
This issue seems to be relevant: hashicorp/terraform-provider-aws#1184 |
Problem: vpc resource name used in subnet resource definition does not match name of vpc resource
|
Thanks @robinbowes ! Per your suggestions:
I am not seeing the 'root_module_directory' issue, then again I am pinned to an older version of terraform required by awspec 0.10.2. I tried to upgrade to 0.11.x a while back and awspec complained.. i'll dig a bit deeper on this one. g |
I found the I wonder if it changed since an older version of kitchen-terraform? |
I updated to current awspec, and it is still pinned to terraform 0.10.2:
/shrug |
What ruby version? |
I use 2.3.1: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] I am not precious on this version if there is a newer/better version of ruby you would prefer/ recommend. 2.4.3? |
I just noticed that ruby 2.5.0 resulted in kitchen-terraform 0.3.0 (ie. very old). I wondered if the version you are using resulted in a similar kitchen-terraform silent pinning? |
I am not using / familiar with kitchen-terraform. I am installing these individually:
I am not a ruby expert so take this with a hefty grain of salt. I added a few notes in README on version particulars. |
Ohhh, I see.
Try: |
did a bundle update and all hell broke loose :-) I have some work to put things back right. |
Oops :) |
ok all is well now I made your |
I should figure out something other than ec2 to use as an example. AWS holds the terminated instances around for up to an hour, and that confuses awspec to see multiple terminated instances with the same name. or refactor to include this workaround: k1LoW/awspec#155 |
ok, i have updated to use the exists but terminated work around and the suggestions above, and updated the code, tests, and deck, and ran through from front to back. I think it is good to go. I am going to take shot at a similiar exercise using the latest inspec 2.0 which is supposed to support aws resources now rather than the awspec add on. I am also going to drop kitchen in favor of straight tf and inspec via rake. all good! |
Firstly, I want to say this is a really great resource. However, I had a few issues getting started so I'm feeding them back to you.
Problem: Doesn't work with ruby 2.5.0, but doesn't fail (it installs 0.3.0 of kitchen-terraform which is way old)
Solution: Use ruby < 2.5.0, eg. 2.4.3. I used rbenv to use 2.4.3 locally
Problem: The
kitchen.yml
example is not valid. It fails with:Solution: Wrap the erb lines in quotes, eg.:
Alternatively, remove both
access_key
andsecret_key
entirely. If they are not specified, the aws provider reads them from~/.aws.credentials
directly.Problem: terraform init is executed against the wrong dir:
Solution: Wrong parameter in .kitchen.yml. Change
directory
toroot_module_directory
:Remove
terraform.tfstate.d
and.terraform
, and re-tryProblem:
Error: Required variable not set: region
Solution: Set region on the command line
Alternatively, remove region variable and use
AWS_DEFAULT_REGION
environment variable on the command line:Problem: I need to switch to a specific IAM profile when running AWS commands.
Solution: Specify this on the command line:
The tests now function, and I can start working through the exercises.
I've updated my fork of this repo with my changes: https://github.com/yo61/awspec-kitchen-terraform
Hope this is useful to you!
Thanks again for the tutorial.
The text was updated successfully, but these errors were encountered: