Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Add support for Terraform v0.12 (#344)
Browse files Browse the repository at this point in the history
* Update Gemfile.locks

* Add support for Terraform v0.12

* Add version constraints to attributes module

* Add version constraints to backend-ssh module

This module can not support Terraform 0.12 until the Docker provider
implements support.

hashicorp/terraform-provider-docker#144

* Add version constraints to Plug Ins module

* Add version constraints to variables module

* Update Terraform to 0.11.14 on Ubuntu

* Fix name of Ubuntu job

Terragrunt is not used on Ubuntu

* Update Terragrunt to 0.18.6 on MacOS

* Update local provider to 1.2.2

* Update Terraform to 0.12.0 on MacOS

* Add entry to CHANGELOG

* Update local provider version constraint for 0.12

* Replace path.module with path.cwd

Terraform 0.12 changed the behaviour of path.module to return a relative
pathname rather than an absolute pathname.

hashicorp/terraform#21400

* Declare terragrunt variables

Declaring these variables will suppress undeclared variable warnings.

* Remove escaped double quotes from string variable

Terraform v0.12 evaluates the quotes as part of the string.
  • Loading branch information
aaron-lane authored May 25, 2019
1 parent 39c6283 commit d145ac4
Show file tree
Hide file tree
Showing 20 changed files with 300 additions and 132 deletions.
38 changes: 19 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
directories:
- ruby-2.6/vendor/bundle
- stage: Integration Tests
name: Terraform 0.11.13 with Terragrunt 0.18.3 on Ubuntu
name: Terraform 0.11.14 on Ubuntu
dist: trusty
language: ruby
rvm: 2.4.1
Expand All @@ -86,12 +86,12 @@ jobs:
- bundle config --local without development
install:
- bundle install
- curl --remote-name --silent https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip
- sha256sum terraform_0.11.13_linux_amd64.zip | grep 5925cd4d81e7d8f42a0054df2aafd66e2ab7408dbed2bd748f0022cfe592f8d2
- unzip terraform_0.11.13_linux_amd64.zip -d "$HOME/bin"
- curl --remote-name --silent https://releases.hashicorp.com/terraform-provider-local/1.2.0/terraform-provider-local_1.2.0_linux_amd64.zip
- sha256sum terraform-provider-local_1.2.0_linux_amd64.zip | grep e8bd3d1730ce34aa93dbba837740110a3df190c862e78024d1e3b36bd3de3b21
- unzip terraform-provider-local_1.2.0_linux_amd64.zip -d test/terraform/Plug\
- curl --remote-name --silent https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_linux_amd64.zip
- sha256sum terraform_0.11.14_linux_amd64.zip | grep 9b9a4492738c69077b079e595f5b2a9ef1bc4e8fb5596610f69a6f322a8af8dd
- unzip terraform_0.11.14_linux_amd64.zip -d "$HOME/bin"
- curl --remote-name --silent https://releases.hashicorp.com/terraform-provider-local/1.2.2/terraform-provider-local_1.2.2_linux_amd64.zip
- sha256sum terraform-provider-local_1.2.2_linux_amd64.zip | grep 149e7fd6e51fe9f24a11d30b6034deefdece04f0272ced832a6803d1e2bfa37d
- unzip terraform-provider-local_1.2.2_linux_amd64.zip -d test/terraform/Plug\
Ins/Plug\ In\ Directory
before_script:
- chmod go-rw test/terraform/backend-ssh/id_ed25519
Expand All @@ -104,7 +104,7 @@ jobs:
cache:
directories:
- ruby-2.4/vendor/bundle
- name: Terraform 0.11.8 with Terragrunt 0.18.3 on MacOS
- name: Terraform 0.12.0 with Terragrunt 0.18.6 on MacOS
os: osx
language: ruby
rvm: 2.4.3
Expand All @@ -117,15 +117,15 @@ jobs:
- bundle config --local without backend_ssh:development
install:
- bundle install
- curl --remote-name --silent https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_darwin_amd64.zip
- shasum -a 256 terraform_0.11.8_darwin_amd64.zip | grep 98c168b06e8b4058c66e044e3744d49956ce7bc3664dc1679a33f8fffc84564d
- unzip terraform_0.11.8_darwin_amd64.zip -d "$HOME"/bin
- curl --location --remote-name --silent https://github.com/gruntwork-io/terragrunt/releases/download/v0.18.3/terragrunt_darwin_amd64
- shasum -a 256 terragrunt_darwin_amd64 | grep 3781f3a5152483ed8a79f0d6cbb9c6da8bb8e55fb1c026f6060c9cdaca45435f
- curl --remote-name --silent https://releases.hashicorp.com/terraform/0.12.0/terraform_0.12.0_darwin_amd64.zip
- shasum -a 256 terraform_0.12.0_darwin_amd64.zip | grep 9dbee9dea660ea64352f8ddf2539e60d1c414210e9c4a29c8585926fef366be1
- unzip terraform_0.12.0_darwin_amd64.zip -d "$HOME"/bin
- curl --location --remote-name --silent https://github.com/gruntwork-io/terragrunt/releases/download/v0.18.6/terragrunt_darwin_amd64
- shasum -a 256 terragrunt_darwin_amd64 | grep 234327294a07c312e7bc279ea749a653218c37d2d0b51c5cf2076fcf82dc298a
- chmod +x terragrunt_darwin_amd64
- curl --remote-name --silent https://releases.hashicorp.com/terraform-provider-local/1.2.0/terraform-provider-local_1.2.0_darwin_amd64.zip
- shasum -a 256 terraform-provider-local_1.2.0_darwin_amd64.zip | grep 1781aeca782710861ff3f167e14919b30be91ddd038e72fea029f3d9298843e5
- unzip terraform-provider-local_1.2.0_darwin_amd64.zip -d test/terraform/Plug\
- curl --remote-name --silent https://releases.hashicorp.com/terraform-provider-local/1.2.2/terraform-provider-local_1.2.2_darwin_amd64.zip
- shasum -a 256 terraform-provider-local_1.2.2_darwin_amd64.zip | grep 2464abf56aabecca26177f3562a4bd771cd79a79a94c78474f39691f9d4abea7
- unzip terraform-provider-local_1.2.2_darwin_amd64.zip -d test/terraform/Plug\
Ins/Plug\ In\ Directory
script:
- bundle exec rake test:kitchen:attributes-osx
Expand All @@ -149,9 +149,9 @@ jobs:
- curl --remote-name --silent https://releases.hashicorp.com/terraform/0.11.4/terraform_0.11.4_windows_amd64.zip
- sha256sum terraform_0.11.4_windows_amd64.zip | grep a762b329798b872f44df3b5db33122469a3cf1ad28c1915fee17605ec8245508
- unzip terraform_0.11.4_windows_amd64.zip
- curl --remote-name --silent https://releases.hashicorp.com/terraform-provider-local/1.2.0/terraform-provider-local_1.2.0_windows_amd64.zip
- sha256sum terraform-provider-local_1.2.0_windows_amd64.zip | grep 3b31fd13626d7fe095862eecaf311c81d73789512a9450f4bd204c10d72b4b84
- unzip terraform-provider-local_1.2.0_windows_amd64.zip -d test/terraform/Plug\
- curl --remote-name --silent https://releases.hashicorp.com/terraform-provider-local/1.2.2/terraform-provider-local_1.2.2_windows_amd64.zip
- sha256sum terraform-provider-local_1.2.2_windows_amd64.zip | grep 109262576075cd1ccf77079497beab27de5051bb9ed3a07760a8400c4ef54925
- unzip terraform-provider-local_1.2.2_windows_amd64.zip -d test/terraform/Plug\
Ins/Plug\ In\ Directory
script:
- powershell -command "& 'bundle' 'exec' 'rake' 'test:kitchen:attributes-windows'"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased][unreleased]

### Added

- Support for Terraform v0.12.

## [4.8.1] - 2019-05-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion kitchen-terraform.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ require "rubygems"
specification.add_runtime_dependency "tty-which", "~> 0.4.0"
specification.cert_chain = ["certs/gem-public_cert.pem"]
specification.required_ruby_version = [">= 2.3", "< 2.7"]
specification.requirements = ["Terraform >= 0.11.4, < 0.12.0"]
specification.requirements = ["Terraform >= v0.11.4, < v0.13.0"]
specification.signing_key = "certs/gem-private_key.pem" if $PROGRAM_NAME =~ /gem\z/
end
2 changes: 1 addition & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ suites:
variable_files:
- test/terraform/variables/variable_files/Variable File.tfvars
variables:
string: '\"A String\"'
string: 'A String'
map: '{ key = \"A Value\" }'
list: '[ \"Element One\", \"Element Two\" ]'
verifier:
Expand Down
7 changes: 5 additions & 2 deletions lib/kitchen/terraform/verify_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ class << self
# @return [void]
def call
::Kitchen::Terraform::Command::Version.run do |version:|
if !::Gem::Requirement.new(">= 0.11.4", "< 0.12.0").satisfied_by? version
raise ::Kitchen::Terraform::Error, "Terraform v#{version} is not supported; install Terraform ~> v0.11.4"
if !::Gem::Requirement.new(">= 0.11.4", "< 0.13.0").satisfied_by? version
raise(
::Kitchen::Terraform::Error,
"Terraform v#{version} is not supported; supported versions are in the range of >= v0.11.4, < v0.13.0"
)
end
end
end
Expand Down
51 changes: 26 additions & 25 deletions ruby-2.3/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ GEM
autoprefixer-rails (9.5.1.1)
execjs
aws-eventstream (1.0.3)
aws-sdk (2.11.272)
aws-sdk-resources (= 2.11.272)
aws-sdk-core (2.11.272)
aws-sdk (2.11.282)
aws-sdk-resources (= 2.11.282)
aws-sdk-core (2.11.282)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.11.272)
aws-sdk-core (= 2.11.272)
aws-sdk-resources (2.11.282)
aws-sdk-core (= 2.11.282)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
azure_graph_rbac (0.17.1)
ms_rest_azure (~> 0.11.0)
azure_mgmt_key_vault (0.17.4)
ms_rest_azure (~> 0.11.0)
azure_mgmt_resources (0.17.4)
ms_rest_azure (~> 0.11.0)
backports (3.14.0)
azure_mgmt_resources (0.17.5)
ms_rest_azure (~> 0.11.1)
backports (3.15.0)
bcrypt_pbkdf (1.0.1)
builder (3.2.3)
coderay (1.1.2)
Expand Down Expand Up @@ -122,7 +122,7 @@ GEM
fastimage (2.1.5)
favicon_maker (1.3.1)
docile (~> 1.1)
ffi (1.10.0)
ffi (1.11.1)
formatador (0.2.5)
google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1)
Expand Down Expand Up @@ -164,7 +164,7 @@ GEM
yard (>= 0.7.0)
gyoku (1.3.1)
builder (>= 2.1.2)
haml (5.0.4)
haml (5.1.1)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
Expand Down Expand Up @@ -206,7 +206,7 @@ GEM
tty-table (~> 0.10)
jmespath (1.4.0)
json (2.1.0)
jwt (2.1.0)
jwt (2.2.1)
kramdown (1.17.0)
launchy (2.4.3)
addressable (~> 2.3)
Expand All @@ -221,18 +221,18 @@ GEM
lumberjack (1.0.13)
memoist (0.16.0)
method_source (0.9.2)
middleman (4.3.3)
middleman (4.3.4)
coffee-script (~> 2.2)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-cli (= 4.3.3)
middleman-core (= 4.3.3)
middleman-cli (= 4.3.4)
middleman-core (= 4.3.4)
middleman-autoprefixer (2.10.1)
autoprefixer-rails (~> 9.1)
middleman-core (>= 3.3.3)
middleman-cli (4.3.3)
middleman-cli (4.3.4)
thor (>= 0.17.0, < 2.0)
middleman-core (4.3.3)
middleman-core (4.3.4)
activesupport (>= 4.2, < 5.1)
addressable (~> 2.3)
backports (~> 3.6)
Expand Down Expand Up @@ -268,7 +268,7 @@ GEM
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mini_racer (0.2.5)
mini_racer (0.2.6)
libv8 (>= 6.9.411)
minitest (5.11.3)
mixlib-install (3.11.18)
Expand All @@ -278,17 +278,18 @@ GEM
mixlib-log (3.0.1)
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.7)
ms_rest (0.7.3)
ms_rest (0.7.4)
concurrent-ruby (~> 1.0)
faraday (~> 0.9)
timeliness (~> 0.3)
ms_rest_azure (0.11.0)
timeliness (~> 0.3.10)
ms_rest_azure (0.11.1)
concurrent-ruby (~> 1.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
ms_rest (~> 0.7.2)
ms_rest (~> 0.7.4)
unf_ext (= 0.0.7.2)
multi_json (1.13.1)
multipart-post (2.1.0)
multipart-post (2.1.1)
necromancer (0.4.0)
nenv (0.3.0)
net-http-persistent (2.9.4)
Expand Down Expand Up @@ -357,7 +358,7 @@ GEM
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubyntlm (0.6.2)
rubyzip (1.2.2)
rubyzip (1.2.3)
sassc (2.0.1)
ffi (~> 1.9)
rake
Expand Down Expand Up @@ -396,7 +397,7 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
timeliness (0.4.0)
timeliness (0.3.10)
timers (4.3.0)
tins (1.20.2)
tomlrb (1.2.8)
Expand Down Expand Up @@ -455,7 +456,7 @@ GEM
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unf_ext (0.0.7.2)
unicode-display_width (1.6.0)
unicode_utils (1.4.0)
websocket (1.2.8)
Expand Down
51 changes: 26 additions & 25 deletions ruby-2.4/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ GEM
autoprefixer-rails (9.5.1.1)
execjs
aws-eventstream (1.0.3)
aws-sdk (2.11.272)
aws-sdk-resources (= 2.11.272)
aws-sdk-core (2.11.272)
aws-sdk (2.11.282)
aws-sdk-resources (= 2.11.282)
aws-sdk-core (2.11.282)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.11.272)
aws-sdk-core (= 2.11.272)
aws-sdk-resources (2.11.282)
aws-sdk-core (= 2.11.282)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
azure_graph_rbac (0.17.1)
ms_rest_azure (~> 0.11.0)
azure_mgmt_key_vault (0.17.4)
ms_rest_azure (~> 0.11.0)
azure_mgmt_resources (0.17.4)
ms_rest_azure (~> 0.11.0)
backports (3.14.0)
azure_mgmt_resources (0.17.5)
ms_rest_azure (~> 0.11.1)
backports (3.15.0)
bcrypt_pbkdf (1.0.1)
builder (3.2.3)
coderay (1.1.2)
Expand Down Expand Up @@ -122,7 +122,7 @@ GEM
fastimage (2.1.5)
favicon_maker (1.3.1)
docile (~> 1.1)
ffi (1.10.0)
ffi (1.11.1)
formatador (0.2.5)
google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1)
Expand Down Expand Up @@ -164,7 +164,7 @@ GEM
yard (>= 0.7.0)
gyoku (1.3.1)
builder (>= 2.1.2)
haml (5.0.4)
haml (5.1.1)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
Expand Down Expand Up @@ -206,7 +206,7 @@ GEM
tty-table (~> 0.10)
jmespath (1.4.0)
json (2.1.0)
jwt (2.1.0)
jwt (2.2.1)
kramdown (1.17.0)
launchy (2.4.3)
addressable (~> 2.3)
Expand All @@ -221,18 +221,18 @@ GEM
lumberjack (1.0.13)
memoist (0.16.0)
method_source (0.9.2)
middleman (4.3.3)
middleman (4.3.4)
coffee-script (~> 2.2)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-cli (= 4.3.3)
middleman-core (= 4.3.3)
middleman-cli (= 4.3.4)
middleman-core (= 4.3.4)
middleman-autoprefixer (2.10.1)
autoprefixer-rails (~> 9.1)
middleman-core (>= 3.3.3)
middleman-cli (4.3.3)
middleman-cli (4.3.4)
thor (>= 0.17.0, < 2.0)
middleman-core (4.3.3)
middleman-core (4.3.4)
activesupport (>= 4.2, < 5.1)
addressable (~> 2.3)
backports (~> 3.6)
Expand Down Expand Up @@ -268,7 +268,7 @@ GEM
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mini_racer (0.2.5)
mini_racer (0.2.6)
libv8 (>= 6.9.411)
minitest (5.11.3)
mixlib-install (3.11.18)
Expand All @@ -278,17 +278,18 @@ GEM
mixlib-log (3.0.1)
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.7)
ms_rest (0.7.3)
ms_rest (0.7.4)
concurrent-ruby (~> 1.0)
faraday (~> 0.9)
timeliness (~> 0.3)
ms_rest_azure (0.11.0)
timeliness (~> 0.3.10)
ms_rest_azure (0.11.1)
concurrent-ruby (~> 1.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
ms_rest (~> 0.7.2)
ms_rest (~> 0.7.4)
unf_ext (= 0.0.7.2)
multi_json (1.13.1)
multipart-post (2.1.0)
multipart-post (2.1.1)
necromancer (0.4.0)
nenv (0.3.0)
net-http-persistent (2.9.4)
Expand Down Expand Up @@ -357,7 +358,7 @@ GEM
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubyntlm (0.6.2)
rubyzip (1.2.2)
rubyzip (1.2.3)
sassc (2.0.1)
ffi (~> 1.9)
rake
Expand Down Expand Up @@ -396,7 +397,7 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
timeliness (0.4.0)
timeliness (0.3.10)
timers (4.3.0)
tins (1.20.2)
tomlrb (1.2.8)
Expand Down Expand Up @@ -455,7 +456,7 @@ GEM
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unf_ext (0.0.7.2)
unicode-display_width (1.6.0)
unicode_utils (1.4.0)
websocket (1.2.8)
Expand Down
Loading

0 comments on commit d145ac4

Please sign in to comment.