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

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 
* 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 {
 +
    suffix = "index.html"
 +
  }
 +
 +
  error_document {
 +
    key = "error.html"
 +
  }
 +
 +
  routing_rule {
 +
    condition {
 +
      key_prefix_equals = "docs/"
 +
    }
 +
    redirect {
 +
      replace_key_prefix_with = "documents/"
 +
    }
 +
  }
 +
}
 +
</pre>
  
 
== See also ==
 
== See also ==

Revision as of 11:38, 13 January 2023

resource "aws_s3_bucket_website_configuration" "example" {
  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/"
    }
  }
}

See also

Advertising: