File tree 4 files changed +51
-5
lines changed
4 files changed +51
-5
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ check-docs:
59
59
.PHONY : check-docs
60
60
61
61
clean :
62
- rm ** /* .tfstate* ; true
62
+ rm ** /* .tfstate* ; true
63
63
.PHONY : clean
64
64
65
65
test : fmt
Original file line number Diff line number Diff line change @@ -18,6 +18,27 @@ resource "aws_s3_bucket" "bucket" {
18
18
enabled = var. enable_versioning
19
19
}
20
20
21
+ lifecycle_rule {
22
+ enabled = true
23
+
24
+ abort_incomplete_multipart_upload_days = var. abort_incomplete_multipart_upload_days
25
+
26
+ expiration {
27
+ expired_object_delete_marker = true
28
+ }
29
+
30
+ noncurrent_version_transition {
31
+ days = 30
32
+ storage_class = " STANDARD_IA"
33
+ }
34
+
35
+ noncurrent_version_expiration {
36
+ days = 365
37
+ }
38
+ }
39
+
40
+
41
+
21
42
# TODO
22
43
# logging {
23
44
# target_bucket = ""
Original file line number Diff line number Diff line change @@ -3,12 +3,31 @@ package test
3
3
import (
4
4
"testing"
5
5
6
+ "github.com/chanzuckerberg/cztack/testutil"
6
7
"github.com/gruntwork-io/terratest/modules/terraform"
7
8
)
8
9
9
10
func TestPrivateBucket (t * testing.T ) {
10
- options := & terraform.Options {
11
- TerraformDir : "." ,
12
- }
13
- terraform .Init (t , options )
11
+
12
+ project := testutil .UniqueId ()
13
+ env := testutil .UniqueId ()
14
+ service := testutil .UniqueId ()
15
+ owner := testutil .UniqueId ()
16
+
17
+ bucketName := testutil .UniqueId ()
18
+
19
+ options := testutil .Options (
20
+ testutil .DefaultRegion ,
21
+ map [string ]interface {}{
22
+ "project" : project ,
23
+ "env" : env ,
24
+ "service" : service ,
25
+ "owner" : owner ,
26
+
27
+ "bucket_name" : bucketName ,
28
+ },
29
+ )
30
+
31
+ defer terraform .Destroy (t , options )
32
+ testutil .Run (t , options )
14
33
}
Original file line number Diff line number Diff line change @@ -28,3 +28,9 @@ variable "enable_versioning" {
28
28
description = " Keep old versions of overwritten S3 objects."
29
29
default = true
30
30
}
31
+
32
+ variable "abort_incomplete_multipart_upload_days" {
33
+ type = number
34
+ description = " Number of days after which an incomplete multipart upload is canceled."
35
+ default = 14
36
+ }
You can’t perform that action at this time.
0 commit comments