osbuild-service-maintenance: clean up all regions
Since we started cloning images to different regions, the maintenance script should clean up all of these regions.
This commit is contained in:
parent
dc1a770c0f
commit
2e3dd16220
3 changed files with 67 additions and 40 deletions
|
|
@ -596,3 +596,16 @@ func (a *AWS) MarkS3ObjectAsPublic(bucket, objectKey string) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *AWS) Regions() ([]string, error) {
|
||||
out, err := a.ec2.DescribeRegions(&ec2.DescribeRegionsInput{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := []string{}
|
||||
for _, r := range out.Regions {
|
||||
result = append(result, aws.StringValue(r.RegionName))
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue