diff --git a/aws/resource_aws_s3_bucket.go b/aws/resource_aws_s3_bucket.go index c8d641c9c48f..c7cd27397b0c 100644 --- a/aws/resource_aws_s3_bucket.go +++ b/aws/resource_aws_s3_bucket.go @@ -381,6 +381,7 @@ func resourceAwsS3Bucket() *schema.Resource { Optional: true, ValidateFunc: validation.StringInSlice([]string{ s3.StorageClassStandard, + s3.StorageClassOnezoneIa, s3.StorageClassStandardIa, s3.StorageClassReducedRedundancy, }, false), diff --git a/aws/resource_aws_s3_bucket_object.go b/aws/resource_aws_s3_bucket_object.go index f9165eafde6a..63a3e7d83226 100644 --- a/aws/resource_aws_s3_bucket_object.go +++ b/aws/resource_aws_s3_bucket_object.go @@ -106,6 +106,7 @@ func resourceAwsS3BucketObject() *schema.Resource { ValidateFunc: validation.StringInSlice([]string{ s3.StorageClassStandard, s3.StorageClassReducedRedundancy, + s3.StorageClassOnezoneIa, s3.StorageClassStandardIa, }, false), }, diff --git a/aws/resource_aws_s3_bucket_test.go b/aws/resource_aws_s3_bucket_test.go index e9fcf45fb95a..4b72922e75bc 100644 --- a/aws/resource_aws_s3_bucket_test.go +++ b/aws/resource_aws_s3_bucket_test.go @@ -636,11 +636,17 @@ func TestAccAWSS3Bucket_Lifecycle(t *testing.T) { resource.TestCheckResourceAttr( "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.2000431762.storage_class", "STANDARD_IA"), resource.TestCheckResourceAttr( - "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.6450812.date", ""), + "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.3008443917.date", ""), resource.TestCheckResourceAttr( - "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.6450812.days", "60"), + "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.3008443917.days", "60"), resource.TestCheckResourceAttr( - "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.6450812.storage_class", "GLACIER"), + "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.3008443917.storage_class", "ONEZONE_IA"), + resource.TestCheckResourceAttr( + "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.2476382906.date", ""), + resource.TestCheckResourceAttr( + "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.2476382906.days", "90"), + resource.TestCheckResourceAttr( + "aws_s3_bucket.bucket", "lifecycle_rule.0.transition.2476382906.storage_class", "GLACIER"), resource.TestCheckResourceAttr( "aws_s3_bucket.bucket", "lifecycle_rule.1.id", "id2"), resource.TestCheckResourceAttr( @@ -1707,8 +1713,14 @@ resource "aws_s3_bucket" "bucket" { days = 30 storage_class = "STANDARD_IA" } + transition { days = 60 + storage_class = "ONEZONE_IA" + } + + transition { + days = 90 storage_class = "GLACIER" } } diff --git a/aws/validators.go b/aws/validators.go index 590f2539c512..a8a762a5e689 100644 --- a/aws/validators.go +++ b/aws/validators.go @@ -543,6 +543,7 @@ func validateS3BucketLifecycleTimestamp(v interface{}, k string) (ws []string, e func validateS3BucketLifecycleStorageClass() schema.SchemaValidateFunc { return validation.StringInSlice([]string{ + s3.TransitionStorageClassOnezoneIa, s3.TransitionStorageClassStandardIa, s3.TransitionStorageClassGlacier, }, false) diff --git a/website/docs/r/s3_bucket.html.markdown b/website/docs/r/s3_bucket.html.markdown index 3f628655e22b..10d25b65102f 100644 --- a/website/docs/r/s3_bucket.html.markdown +++ b/website/docs/r/s3_bucket.html.markdown @@ -118,6 +118,11 @@ resource "aws_s3_bucket" "bucket" { "autoclean" = "true" } + transition { + days = 15 + storage_class = "ONEZONE_IA" + } + transition { days = 30 storage_class = "STANDARD_IA" @@ -385,7 +390,7 @@ The `transition` object supports the following * `date` (Optional) Specifies the date after which you want the corresponding action to take effect. * `days` (Optional) Specifies the number of days after object creation when the specific rule action takes effect. -* `storage_class` (Required) Specifies the Amazon S3 storage class to which you want the object to transition. Can be `STANDARD_IA` or `GLACIER`. +* `storage_class` (Required) Specifies the Amazon S3 storage class to which you want the object to transition. Can be `ONEZONE_IA`, `STANDARD_IA`, or `GLACIER`. The `noncurrent_version_expiration` object supports the following @@ -394,7 +399,7 @@ The `noncurrent_version_expiration` object supports the following The `noncurrent_version_transition` object supports the following * `days` (Required) Specifies the number of days an object is noncurrent object versions expire. -* `storage_class` (Required) Specifies the Amazon S3 storage class to which you want the noncurrent versions object to transition. Can be `STANDARD_IA` or `GLACIER`. +* `storage_class` (Required) Specifies the Amazon S3 storage class to which you want the noncurrent versions object to transition. Can be `ONEZONE_IA`, `STANDARD_IA`, or `GLACIER`. The `replication_configuration` object supports the following: diff --git a/website/docs/r/s3_bucket_object.html.markdown b/website/docs/r/s3_bucket_object.html.markdown index daab1d7e4dbe..eb5421d75bd2 100644 --- a/website/docs/r/s3_bucket_object.html.markdown +++ b/website/docs/r/s3_bucket_object.html.markdown @@ -79,7 +79,7 @@ The following arguments are supported: * `content_type` - (Optional) A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input. * `website_redirect` - (Optional) Specifies a target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html). * `storage_class` - (Optional) Specifies the desired [Storage Class](http://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) -for the object. Can be either "`STANDARD`", "`REDUCED_REDUNDANCY`", or "`STANDARD_IA`". Defaults to "`STANDARD`". +for the object. Can be either "`STANDARD`", "`REDUCED_REDUNDANCY`", "`ONEZONE_IA`", or "`STANDARD_IA`". Defaults to "`STANDARD`". * `etag` - (Optional) Used to trigger updates. The only meaningful value is `${md5(file("path/to/file"))}`. This attribute is not compatible with `kms_key_id`. * `server_side_encryption` - (Optional) Specifies server-side encryption of the object in S3. Valid values are "`AES256`" and "`aws:kms`".