internal/awscloud: use AWS.MarkS3ObjectAsPublic() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
13ba870fc6
commit
a73820b4a8
2 changed files with 0 additions and 24 deletions
|
|
@ -17,7 +17,6 @@ import (
|
|||
"github.com/aws/aws-sdk-go-v2/service/ec2"
|
||||
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
|
||||
images_awscloud "github.com/osbuild/images/pkg/cloud/awscloud"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
|
@ -559,23 +558,6 @@ func (a *AWS) S3ObjectPresignedURL(bucket, objectKey string) (string, error) {
|
|||
return req.URL, nil
|
||||
}
|
||||
|
||||
func (a *AWS) MarkS3ObjectAsPublic(bucket, objectKey string) error {
|
||||
logrus.Infof("[AWS] 👐 Making S3 object public %s/%s", bucket, objectKey)
|
||||
_, err := a.s3.PutObjectAcl(
|
||||
context.Background(),
|
||||
&s3.PutObjectAclInput{
|
||||
Bucket: aws.String(bucket),
|
||||
Key: aws.String(objectKey),
|
||||
ACL: s3types.ObjectCannedACL(s3types.ObjectCannedACLPublicRead),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logrus.Info("[AWS] ✔️ Making S3 object public successful")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *AWS) Regions() ([]string, error) {
|
||||
out, err := a.ec2.DescribeRegions(context.Background(), &ec2.DescribeRegionsInput{})
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue