Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

BugFix\fix decoded documents #125

Merged
merged 1 commit into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion resources/iam_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resources

import (
"context"
"encoding/json"
"net/url"

"github.com/aws/aws-sdk-go-v2/aws"
Expand Down Expand Up @@ -162,7 +163,11 @@ func resolveIamPolicyVersionDocument(ctx context.Context, meta schema.ClientMeta
if err != nil {
return err
}
return resource.Set("document", decodedDocument)
data := make(map[string]interface{})
if err := json.Unmarshal([]byte(decodedDocument), &data); err != nil {
return err
}
return resource.Set("document", data)
}
return nil
}
2 changes: 1 addition & 1 deletion resources/s3_buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ func resolveS3BucketsAttributes(ctx context.Context, meta schema.ClientMeta, res
var ae smithy.APIError
log := meta.Logger()
r := resource.Item.(*WrappedBucket)
log.Info("bucket name", r.Name)
log.Debug("fetching bucket attributes", "bucket", r.Name)
mgr := meta.(*client.Client).Services().S3Manager
output, err := mgr.GetBucketRegion(ctx, *r.Name)
if err != nil {
Expand Down