Skip to content

Commit

Permalink
Merge pull request #41 from Cox-Automotive/updateErrorHandling
Browse files Browse the repository at this point in the history
updates error handling on migration method for iam role resource
  • Loading branch information
americk0 authored Feb 4, 2019
2 parents 208c00f + d746faa commit 9c14255
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions resource_alks_iamrole.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"fmt"
"log"
"time"

Expand Down Expand Up @@ -224,10 +225,11 @@ func populateResourceDataFromRole(role *alks.IamRoleResponse, d *schema.Resource
}

func migrateState(version int, state *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) {
if version == 0 {
switch version {
case 0:
state.Attributes["enable_alks_access"] = "false"
return state, nil
default:
return state, fmt.Errorf("Unrecognized version '%q' in schema for instance of ALKS IAM role", version)
}

return state, nil
}

0 comments on commit 9c14255

Please sign in to comment.