Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Commit

Permalink
Fix resource aws ospworks application secure, ssh_key, password handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsaito authored and fmasuhr committed Apr 24, 2018
1 parent 1535d71 commit dc65189
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
16 changes: 10 additions & 6 deletions aws/resource_aws_opsworks_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,7 @@ func resourceAwsOpsworksSetApplicationEnvironmentVariable(d *schema.ResourceData
data["value"] = *config.Value
}
if config.Secure != nil {

if bool(*config.Secure) {
data["secure"] = &opsworksTrueString
} else {
data["secure"] = &opsworksFalseString
}
data["secure"] = *config.Secure
}
log.Printf("[DEBUG] v: %s", data)
}
Expand Down Expand Up @@ -478,6 +473,15 @@ func resourceAwsOpsworksSetApplicationSource(d *schema.ResourceData, v *opsworks
if v.Revision != nil {
m["revision"] = *v.Revision
}

// v.Password will, on read, contain the placeholder string
// "*****FILTERED*****", so we ignore it on read and let persist
// the value already in the state.
m["password"] = d.Get("app_source.0.password").(string)
// ssh_key can not be read via api, so we ignore it on read and let persist
// the value already in the state.
m["ssh_key"] = d.Get("app_source.0.ssh_key").(string)

nv = append(nv, m)
}

Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_opsworks_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ func resourceAwsOpsworksSetStackCustomCookbooksSource(d *schema.ResourceData, v
// v.Password will, on read, contain the placeholder string
// "*****FILTERED*****", so we ignore it on read and let persist
// the value already in the state.
m["password"] = d.Get("custom_cookbooks_source.0.password").(string)
// ssh_key can not be read via api, so we ignore it on read and let persist
// the value already in the state.
m["ssh_key"] = d.Get("custom_cookbooks_source.0.ssh_key").(string)

nv = append(nv, m)
}

Expand Down

0 comments on commit dc65189

Please sign in to comment.