(awsClient *awslib.Client, bucket string)
| 1333 | } |
| 1334 | |
| 1335 | func setLifecycleRulesOnClusterDown(awsClient *awslib.Client, bucket string) error { |
| 1336 | err := awsClient.DeleteLifecycleRules(bucket) |
| 1337 | if err != nil { |
| 1338 | return err |
| 1339 | } |
| 1340 | |
| 1341 | expirationDate := libtime.GetCurrentUTCDate().Add(-24 * time.Hour) |
| 1342 | return awsClient.SetLifecycleRules(bucket, []s3.LifecycleRule{ |
| 1343 | { |
| 1344 | Expiration: &s3.LifecycleExpiration{ |
| 1345 | Date: &expirationDate, |
| 1346 | }, |
| 1347 | ID: pointer.String("bucket-cleaner"), |
| 1348 | Filter: &s3.LifecycleRuleFilter{ |
| 1349 | Prefix: pointer.String(""), |
| 1350 | }, |
| 1351 | Status: pointer.String("Enabled"), |
| 1352 | }, |
| 1353 | }) |
| 1354 | } |
| 1355 | |
| 1356 | func createLogGroupIfNotFound(awsClient *awslib.Client, logGroup string, tags map[string]string) error { |
| 1357 | logGroupFound, err := awsClient.DoesLogGroupExist(logGroup) |
no test coverage detected