Skip to content

Commit

Permalink
Fix parsing error when using assume_role
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-yuen committed Dec 13, 2023
1 parent d445880 commit 5312cfc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,12 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
profile := d.Get("profile").(string)
region := d.Get("region").(string)
endpoint := d.Get("dynamodb_endpoint").(string)
assume_role_config := d.Get("assume_role").([]interface{})
assume_role_config := d.Get("assume_role").(map[string]interface{})
validate := d.Get("validate").(bool)

role_arn := ""
if len(assume_role_config) > 0 {
configmap := assume_role_config[0].(map[string]interface{})
if v, ok := configmap["role_arn"].(string); ok && v != "" {
if v, ok := assume_role_config["role_arn"].(string); ok && v != "" {
role_arn = v
}
}
Expand Down

0 comments on commit 5312cfc

Please sign in to comment.