Home > Net >  Unable to get s3.Object ACL using AWS SDK in go
Unable to get s3.Object ACL using AWS SDK in go

Time:12-19

I am trying to list the objects of one bucket using the official example

    err = svc.ListObjectsPages(&s3.ListObjectsInput{
        Bucket: &bucketName,
    }, func(p *s3.ListObjectsOutput, last bool) (shouldContinue bool) {
        fmt.Println("Page,", i)
        i  

        for _, obj := range p.Contents {
            fmt.Println("Object:", *obj.Key)
        }
        return true
    })

However I see that the s3.Object type does not have any ACL information associated with it.

How can I get the s3.Object's ACL information?

CodePudding user response:

Refer to this example to learn how to get an Amazon S3 object's ACL information using the AWS SDK for Go V2.

https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/gov2/s3/GetObjectAcl

  • Related