Skip to content

Commit be4b09e

Browse files
authored
Merge pull request #12 from chris-qa-org/add-a-default-index-html-file
Add a default index.html file
2 parents 7803a77 + 0eb6257 commit be4b09e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ module "static_site_hosting" {
105105
| [aws_s3_bucket_versioning.logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_versioning) | resource |
106106
| [aws_s3_bucket_versioning.static_site](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_versioning) | resource |
107107
| [aws_s3_bucket_website_configuration.static_site](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration) | resource |
108+
| [aws_s3_object.static_site_index](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_object) | resource |
108109
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
109110
| [aws_canonical_user_id.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/canonical_user_id) | data source |
110111
| [aws_route53_zone.static_site](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |

s3-static-site.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ resource "aws_s3_bucket_policy" "static_site" {
5656
bucket = aws_s3_bucket.static_site.id
5757
policy = local.static_site_bucket_policy
5858
}
59+
60+
resource "aws_s3_object" "static_site_index" {
61+
bucket = aws_s3_bucket.static_site.id
62+
key = "index.html"
63+
content = local.project_name
64+
65+
lifecycle {
66+
prevent_destroy = true
67+
}
68+
}

0 commit comments

Comments
 (0)