description = "Set to true if your S3 bucket is configured as a website and publicly accessible. Set to false if it's a regular S3 bucket and only privately accessible to CloudFront. If it's a public website, you can use all the S3 website features (e.g. routing, error pages), but users can bypass CloudFront and talk to S3 directly. If it's a private S3 bucket, users can only reach it via CloudFront, but you don't get all the website features."
type = string
}
variable "index_document" {
description = "The path that you want CloudFront to query on the origin server when an end user requests the root URL (e.g. index.html)."
type = string
}
variable "default_ttl" {
description = "The default amount of time, in seconds, that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an 'Cache-Control max-age' or 'Expires' header."
type = number
}
Questions? Ask away.
We're here to talk about our services, answer any questions, give advice, or just to chat.
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"b3f1def258708ffa6e05f272e5a1acd1532f9e59"}]},{"name":".gitignore","path":".gitignore","sha":"ad5cc76ae57a274bc72838eda5ee1f5f8ea3aaf1"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"76191b4678792b12eff3c8ed1038df33074d91fe"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"7a0d0af6ee8361466674f9367fab91f9037b5c75"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.md","path":"README.md","sha":"231c20db895bd0eafe77d5004d2feba59c4037ba"},{"name":"examples","children":[{"name":"bin","children":[{"name":"s3-upload.sh","path":"examples/bin/s3-upload.sh","sha":"616167707b12a9ed678286f6829d06ae39b8bfb0"}]},{"name":"cloudfront-s3-private-origin-group","children":[{"name":"README.md","path":"examples/cloudfront-s3-private-origin-group/README.md","sha":"a0c7c49eb8bb405624377174bf28c48e806baf44"},{"name":"main.tf","path":"examples/cloudfront-s3-private-origin-group/main.tf","sha":"59d6add5e91e7b6069bc868c9e342710bc23c227"},{"name":"outputs.tf","path":"examples/cloudfront-s3-private-origin-group/outputs.tf","sha":"7ad8a7de25248890dd41ec74575fb18e206cf93b"},{"name":"vars.tf","path":"examples/cloudfront-s3-private-origin-group/vars.tf","sha":"58848af7c7064fe5054c4612f3f48911db5182eb"}]},{"name":"cloudfront-s3-private","children":[{"name":"README.md","path":"examples/cloudfront-s3-private/README.md","sha":"03ae92790de376455152698d267caf86d2348911"},{"name":"main.tf","path":"examples/cloudfront-s3-private/main.tf","sha":"deabff392a491c684719e89d2869d401e56f0d7a"},{"name":"outputs.tf","path":"examples/cloudfront-s3-private/outputs.tf","sha":"4028b7c112eb547208079b450305f8560d451deb"},{"name":"vars.tf","path":"examples/cloudfront-s3-private/vars.tf","sha":"6c831e531701b3ae5745aa968008d28e1c6bc7a1"}]},{"name":"cloudfront-s3-public-origin-group","children":[{"name":"README.md","path":"examples/cloudfront-s3-public-origin-group/README.md","sha":"80e5a99578d8c9eba230531ac040a8e82aebfebd"},{"name":"main.tf","path":"examples/cloudfront-s3-public-origin-group/main.tf","sha":"fbff2e84ec5cdf3018541ea7952a41402c9808b3"},{"name":"outputs.tf","path":"examples/cloudfront-s3-public-origin-group/outputs.tf","sha":"7ad8a7de25248890dd41ec74575fb18e206cf93b"},{"name":"vars.tf","path":"examples/cloudfront-s3-public-origin-group/vars.tf","sha":"627d6c64c757b21e2b4ac175dfa72a9cf4df36b9"}]},{"name":"cloudfront-s3-public","children":[{"name":"README.md","path":"examples/cloudfront-s3-public/README.md","sha":"aed32ebaa3e145939ee0e027125583200673c104"},{"name":"main.tf","path":"examples/cloudfront-s3-public/main.tf","sha":"51771d53cfb640a95de6d75697eaba3e085bd5ec"},{"name":"outputs.tf","path":"examples/cloudfront-s3-public/outputs.tf","sha":"4028b7c112eb547208079b450305f8560d451deb"},{"name":"vars.tf","path":"examples/cloudfront-s3-public/vars.tf","sha":"48d19258f4605b2c687d13336f6ac77358d45c54"}]},{"name":"example-website","children":[{"name":"README.md","path":"examples/example-website/README.md","sha":"359ae6d06f8e77244f18c42704637b8e6ef498c6"},{"name":"error.html","path":"examples/example-website/error.html","sha":"0a959f6cec57577c7c167d362c143e31f215b07c"},{"name":"grunty.png","path":"examples/example-website/grunty.png","sha":"fa4bab8d46d843cd22b20f16bcda72e9d4c86680"},{"name":"index.html","path":"examples/example-website/index.html","sha":"a1457ee18744c564fe0b19b1b1ee1f97434f901d"}]},{"name":"s3-static-website","children":[{"name":"README.md","path":"examples/s3-static-website/README.md","sha":"a2d9c34b338551214ccf7df40d63bfa98ae5bae6"},{"name":"main.tf","path":"examples/s3-static-website/main.tf","sha":"0286dbddfea68e90a8e692f35cbee90a9f89b4bd"},{"name":"outputs.tf","path":"examples/s3-static-website/outputs.tf","sha":"7c6be384ebcdb5c66d9432617ae165919160e006"},{"name":"vars.tf","path":"examples/s3-static-website/vars.tf","sha":"03f9fb0227c14930cf32e3f38ef0bdf820506a9d"}]}]},{"name":"modules","children":[{"name":"_docs","children":[{"name":"s3-architecture.png","path":"modules/_docs/s3-architecture.png","sha":"24664de39064d5c6767105b75d002bddf763ff82"},{"name":"s3.png","path":"modules/_docs/s3.png","sha":"667a181c90817858914551e9b2fa376fa1c8f177"}]},{"name":"s3-cloudfront","children":[{"name":"README.md","path":"modules/s3-cloudfront/README.md","sha":"5b69068481d80e58832ea79b945458ce392e6ad7"},{"name":"main.tf","path":"modules/s3-cloudfront/main.tf","sha":"fdf4a086225629cc068440f2d184512c796a4fad"},{"name":"outputs.tf","path":"modules/s3-cloudfront/outputs.tf","sha":"ae4893b663e1cb7514c68590dd93949f26d8807b"},{"name":"vars.tf","path":"modules/s3-cloudfront/vars.tf","sha":"3125794f5d7d2cb36864a0d9209c801420778f16","toggled":true}],"toggled":true},{"name":"s3-static-website","children":[{"name":"README.adoc","path":"modules/s3-static-website/README.adoc","sha":"100efe1cf27554388b979b4546d24787e62937ea"},{"name":"core-concepts.md","path":"modules/s3-static-website/core-concepts.md","sha":"6831fb0e8e930349314c03dd0db5ca16a0703dc5"},{"name":"main.tf","path":"modules/s3-static-website/main.tf","sha":"563bb2fb15d15de7a1c787e66c1dc10baa61d42a"},{"name":"outputs.tf","path":"modules/s3-static-website/outputs.tf","sha":"ea4c26bd50ec6f84234a7c132820cd8e162cd1bd"},{"name":"vars.tf","path":"modules/s3-static-website/vars.tf","sha":"b54fdd921c33b0ff52a4a2e5784a9a42f1780466"}]}],"toggled":true},{"name":"terraform-cloud-enterprise-private-module-registry-placeholder.tf","path":"terraform-cloud-enterprise-private-module-registry-placeholder.tf","sha":"ae586c0fe830819580e1009d41a9074f16e65bed"},{"name":"test","children":[{"name":"README.md","path":"test/README.md","sha":"677e87a94c28a43bc370cf3641fa5390a3cd3b63"},{"name":"go.mod","path":"test/go.mod","sha":"815d01ecc69dce414bb8627e1a812e97c4a331ae"},{"name":"go.sum","path":"test/go.sum","sha":"65ce4a0a505a92cd2cc6be260ce27612d97457cf"},{"name":"s3_cloudfront_canonical_user_test.go","path":"test/s3_cloudfront_canonical_user_test.go","sha":"cdddc74e688c82fffea183946fe0ed3d66581de8"},{"name":"s3_cloudfront_origin_group_test.go","path":"test/s3_cloudfront_origin_group_test.go","sha":"46aa9d45071a6d563596e131df875d34df054532"},{"name":"s3_cloudfront_perpetual_diff_test.go","path":"test/s3_cloudfront_perpetual_diff_test.go","sha":"7f08a006ec3dd839af4e0f7456de3648052abf06"},{"name":"s3_cloudfront_test.go","path":"test/s3_cloudfront_test.go","sha":"bd6afba183d1d17670746c3040a2d87f9e6246ee"},{"name":"s3_static_website_test.go","path":"test/s3_static_website_test.go","sha":"57110da7d6ecc3e3b941c59128c84b3c25524cf3"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"906937e4fa32171f1bbe799c64f2828ac2681439"}]}]},"detailsContent":"<div class=\"preview__body--content\"><div><ul class=\"code__list\"><li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># ---------------------------------------------------------------------------------------------------------------------</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># REQUIRED MODULE PARAMETERS</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># These variables must be passed in by the operator.</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># ---------------------------------------------------------------------------------------------------------------------</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\">variable <span class=\"hljs-string\">\"bucket_name\"</span> {</span></li>\n<li class=\"code__item\"><span class=\"code__text\"> description = <span class=\"hljs-string\">\"The name of the S3 bucket.\"</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"> <span class=\"hljs-built_in\">type</span> = string</span></li>\n<li class=\"code__item\"><span class=\"code__text\">}</span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\">variable <span class=\"hljs-string\">\"s3_bucket_is_public_website\"</span> {</span></li>\n<li class=\"code__item\"><span class=\"code__text\"> description = <span class=\"hljs-string\">\"Set to true if your S3 bucket is configured as a website and publicly accessible. Set to false if it's a regular S3 bucket and only privately accessible to CloudFront. If it's a public website, you can use all the S3 website features (e.g. routing, error pages), but users can bypass CloudFront and talk to S3 directly. If it's a private S3 bucket, users can only reach it via CloudFront, but you don't get all the website features.\"</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"> <span class=\"hljs-built_in\">type</span> = string</span></li>\n<li class=\"code__item\"><span class=\"code__text\">}</span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\">variable <span class=\"hljs-string\">\"index_document\"</span> {</span></li>\n<li class=\"code__item\"><span class=\"code__text\"> description = <span class=\"hljs-string\">\"The path that you want CloudFront to query on the origin server when an end user requests the root URL (e.g. index.html).\"</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"> <span class=\"hljs-built_in\">type</span> = string</span></li>\n<li class=\"code__item\"><span class=\"code__text\">}</span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\">variable <span class=\"hljs-string\">\"default_ttl\"</span> {</span></li>\n<li class=\"code__item\"><span class=\"code__text\"> description = <span class=\"hljs-string\">\"The default amount of time, in seconds, that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an 'Cache-Control max-age' or 'Expires' header.\"</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"> <span class=\"hljs-built_in\">type</span> = number</span></li>\n<li class=\"code__item\"><span class=\"code__text\">}</span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li></ul></div></div>","repoName":"package-static-assets","repoRef":"v0.10.0","serviceDescriptor":{"serviceName":"CloudFront","serviceRepoName":"package-static-assets","serviceRepoOrg":"gruntwork-io","serviceMainReadmePath":"/modules/s3-cloudfront","cloudProviders":["aws"],"description":"Deploy CloudFront as a CDN in front of your S3 bucket. Supports cache settings, Route 53 DNS entries, and TLS certs.","imageUrl":"cloudfront.png","licenseType":"subscriber","technologies":["Terraform"],"compliance":[],"tags":[""]},"serviceCategoryName":"Static content","fileName":"vars.tf","filePath":"/modules/s3-cloudfront/vars.tf","title":"Repo Browser: CloudFront","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}