Description
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- I've gone though the API reference
- I've checked AWS Forums and StackOverflow for answers
- I've searched for previous similar issues and didn't find any solution
Describe the bug
I'm using AWS SDK V2 to describe S3 StorageLensConfiguations. The result is always empty even though I definitely have the storage lens in the region. The StoragelLensConfiguationsList is always empty.
Version of AWS SDK for Go?
Example: v1.29.22
aws-sdk-go-v2/service/[email protected]
Version of Go (go version
)?
go 1.17
To Reproduce (observed behavior)
Steps to reproduce the behavior (please share code or minimal repo)
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3control"
)
....
const AccountId = "XXXXX"
func DescribeS3StorageLens(ctx context.Context, cfg aws.Config) ([]interface{}, error) {
....
client := s3control.NewFromConfig(cfg)
output, err := client.ListStorageLensConfigurations(ctx, &s3control.ListStorageLensConfigurationsInput{
AccountId: AccountId,
})
if err != nil {
return nil, err
}
b, _ := json.Marshal(output.StorageLensConfigurationList)
fmt.Println(string(b))
....
}
When I turn on AWS Client logging, I see
<ListStorageLensConfigurationResult xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/">
<StorageLensConfiguration>
<StorageLensArn>arn:aws:s3:us-east-1:XXXXXX:storage-lens/MyDashboard</StorageLensArn>
<Id>MyDashboard</Id><HomeRegion>us-east-1</HomeRegion>
<IsEnabled>true</IsEnabled>
</StorageLensConfiguration>
<StorageLensConfiguration>
<StorageLensArn>arn:aws:s3:us-east-1:XXXXXXX:storage-lens/default-account-dashboard</StorageLensArn>
<Id>default-account-dashboard</Id>
<HomeRegion>us-east-1</HomeRegion>
<IsEnabled>true</IsEnabled>
</StorageLensConfiguration>
</ListStorageLensConfigurationResult>
From me looking around, I think it is because the deserializer.go is looking for StorageLensConfigurationList
in the XML however, there is none as shown in the output about
Expected behavior
A clear and concise description of what you expected to happen.
I expect the output.StorageLensConfigurationList
to be populated with the result.
Additional context
Add any other context about the problem here.