Skip to content

Commit

Permalink
formatting/typos
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye committed May 15, 2019
1 parent 22dbe72 commit e186724
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions third_party/terraform/resources/resource_kms_crypto_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func disableCryptoKeyRotation(cryptoKeyId *kmsCryptoKeyId, config *Config) error
// a) marking all key versions for destruction (24hr soft-delete)
// b) disabling rotation of the key
// c) removing it from state
// This disables all usage of previous versions of the ky and makes it
// This disables all usage of previous versions of the key and makes it
// generally useless for encryption and decryption of data.
// Re-creation of this resource through Terraform will produce an error.
func resourceKmsCryptoKeyDelete(d *schema.ResourceData, meta interface{}) error {
Expand All @@ -255,14 +255,12 @@ func resourceKmsCryptoKeyDelete(d *schema.ResourceData, meta interface{}) error
and all its CryptoKeyVersions will be destroyed, but it will still be present on the server.`, cryptoKeyId.cryptoKeyId())

// Delete all versions of the key
err = clearCryptoKeyVersions(cryptoKeyId, config)
if err != nil {
if err := clearCryptoKeyVersions(cryptoKeyId, config); err != nil {
return err
}

// Make sure automatic key rotation is disabled.
err = disableCryptoKeyRotation(cryptoKeyId, config)
if err != nil {
if err := disableCryptoKeyRotation(cryptoKeyId, config); err != nil {
return fmt.Errorf(
"While cryptoKeyVersions were cleared, Terraform was unable to disable automatic rotation of key due to an error: %s."+
"Please retry or manually disable automatic rotation to prevent creation of a new version of this key.", err)
Expand Down

0 comments on commit e186724

Please sign in to comment.