Skip to content

Commit

Permalink
Make the OpsWorks cookbooks SSH key write only
Browse files Browse the repository at this point in the history
Fixes hashicorp#3635

This follows the suggestion of @apparentlymart in
hashicorp#3635 (comment)
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.
  • Loading branch information
b-ryan committed Dec 9, 2015
1 parent bb52d70 commit 921944c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions builtin/providers/aws/resource_aws_opsworks_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 921944c

Please sign in to comment.