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

From wikieduonline
Jump to navigation Jump to search
 
(21 intermediate revisions by 3 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
 
  
 +
* [[Terraform module]]:<code>[[Terraform module: s3-bucket|s3-bucket]]</code>
  
== Example ==
+
 
 +
[[redirect_all_requests_to]]
 +
 
 +
== Official 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 {
 +
    suffix = "[[index.html]]"
 +
  }
 +
 +
  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
  
  error_document {
+
== Attributes output reference ==
    key = "error.html"
+
* <code>[[website_endpoint]]</code>
  }
+
* <code>[[website_domain]]: [[s3-website-eu-west-1]].[[amazonaws.com]]</code>
  
  routing_rule {
+
== Related ==
    condition {
+
* [[Cloudflare]]
      key_prefix_equals = "docs/"
+
* <code>[[count.index]]</code>
    }
+
* [[AWS website endpoint]]
    redirect {
+
* <code>[[aws_s3_bucket_cors_configuration]]</code>
      replace_key_prefix_with = "documents/"
+
* [[aws_s3_bucket]]
    }
 
  }
 
}
 
</pre>
 
  
 
== See also ==
 
== See also ==
* {{S3}}
+
* {{tf s3}}
  
 
[[Category:AWS]]
 
[[Category:AWS]]

Latest revision as of 11:49, 8 March 2024

Advertising: