Difference between revisions of "Terraform resource: aws s3 bucket website configuration"

From wikieduonline
Jump to navigation Jump to search
Line 5: Line 5:
 
== Example ==
 
== Example ==
 
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration
 
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration
<pre>
 
resource "aws_s3_bucket_website_configuration" "example" {
 
  bucket = aws_s3_bucket.example.bucket
 
  
  index_document {
+
resource "aws_s3_bucket_website_configuration" "example" {
    suffix = "[[index.html]]"
+
  bucket = aws_s3_bucket.example.bucket
  }
+
 
+
  index_document {
  error_document {
+
    suffix = "[[index.html]]"
    key = "error.html"
+
  }
  }
+
 
+
  error_document {
  routing_rule {
+
    key = "error.html"
    condition {
+
  }
      key_prefix_equals = "docs/"
+
    }
+
  routing_rule {
    redirect {
+
    condition {
      replace_key_prefix_with = "documents/"
+
      key_prefix_equals = "docs/"
    }
+
    }
  }
+
    redirect {
}
+
      replace_key_prefix_with = "documents/"
</pre>
+
    }
 +
  }
 +
}
  
 
== Related ==
 
== Related ==

Revision as of 12:43, 7 March 2023

Advertising: