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

From wikieduonline
Jump to navigation Jump to search
 
(23 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{lc}}
+
* <code>[[aws_s3_bucket_website_configuration]]</code> 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>
+
* [[Terraform module]]:<code>[[Terraform module: s3-bucket|s3-bucket]]</code>
resource "aws_s3_bucket_website_configuration" "example" {
 
  bucket = aws_s3_bucket.example.bucket
 
  
  index_document {
 
    suffix = "index.html"
 
  }
 
  
  error_document {
+
[[redirect_all_requests_to]]
    key = "error.html"
 
  }
 
  
  routing_rule {
+
== Official example ==
    condition {
+
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration
      key_prefix_equals = "docs/"
+
 
    }
+
resource "aws_s3_bucket_website_configuration" "example" {
    redirect {
+
  bucket = aws_s3_bucket.example.bucket
      replace_key_prefix_with = "documents/"
+
    }
+
  index_document {
  }
+
    suffix = "[[index.html]]"
}
+
  }
</pre>
+
 +
  error_document {
 +
    key = "error.html"
 +
  }
 +
 +
  routing_rule {
 +
    condition {
 +
      key_prefix_equals = "docs/"
 +
    }
 +
    redirect {
 +
      replace_key_prefix_with = "documents/"
 +
    }
 +
  }
 +
}
 +
 
 +
Terraform-kubernetes-django example:
 +
* https://github.com/djangoflow/terraform-kubernetes-django/blob/main/modules/aws/storage.tf
 +
 
 +
== Attributes output reference ==
 +
* <code>[[website_endpoint]]</code>
 +
* <code>[[website_domain]]: [[s3-website-eu-west-1]].[[amazonaws.com]]</code>
 +
 
 +
== Related ==
 +
* [[Cloudflare]]
 +
* <code>[[count.index]]</code>
 +
* [[AWS website endpoint]]
 +
* <code>[[aws_s3_bucket_cors_configuration]]</code>
 +
* [[aws_s3_bucket]]
  
 
== See also ==
 
== See also ==
* {{S3}}
+
* {{tf s3}}
  
 
[[Category:AWS]]
 
[[Category:AWS]]

Latest revision as of 11:49, 8 March 2024

Advertising: