Make the OpsWorks cookbooks SSH key write only

Fixes #3635

This follows the suggestion of @apparentlymart in
https://github.com/hashicorp/terraform/issues/3635#issuecomment-151000068
to fix the issue of OpsWorks stacks always complaining about the custom
cookbooks SSH key needing to be changed.

Functional tests:

* Created a new stack and gave it an SSH key. The key was written to
  OpsWorks properly.
* Ran "plan" again and terraform indicated it needed to change the SSH
  key, which is expected since terraform cannot read what the existing
  SSH is.
* Removed the key from my resource and this time, "plan" did not have
  any changes. The `tfstate` file indicated the SSH key was "" (empty
  string).
* Changed an unrelated property of the stack. Previously this was not
  working for me due to terraform attempting to change the SSH key.
This commit is contained in:
Buck Ryan 2015-12-09 16:58:05 -05:00
parent bb52d70089
commit 921944c956
1 changed files with 0 additions and 3 deletions

View File

@ -231,9 +231,6 @@ func resourceAwsOpsworksSetStackCustomCookbooksSource(d *schema.ResourceData, v
if v.Revision != nil {
m["revision"] = *v.Revision
}
if v.SshKey != nil {
m["ssh_key"] = *v.SshKey
}
nv = append(nv, m)
}