From 15ef32078035f4dbf8cba253e0f58a90ce1a72c2 Mon Sep 17 00:00:00 2001 From: Itamar <104310066+ItamarMalka@users.noreply.github.com> Date: Sun, 8 May 2022 17:21:16 +0300 Subject: [PATCH 1/4] Create main.tf --- hello-world/main.tf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 hello-world/main.tf diff --git a/hello-world/main.tf b/hello-world/main.tf new file mode 100644 index 0000000..e291348 --- /dev/null +++ b/hello-world/main.tf @@ -0,0 +1,10 @@ + + +provider "aws" { + version = "~> 2.0" + region = "us-east-1" +} + +terraform { + required_version = ">= 0.12" +} From 95f7e8c7f208c555346bb9792bc308a246df4ec4 Mon Sep 17 00:00:00 2001 From: Itamar <104310066+ItamarMalka@users.noreply.github.com> Date: Sun, 8 May 2022 17:22:07 +0300 Subject: [PATCH 2/4] Create output.tf --- hello-world/output.tf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 hello-world/output.tf diff --git a/hello-world/output.tf b/hello-world/output.tf new file mode 100644 index 0000000..dfa4fb4 --- /dev/null +++ b/hello-world/output.tf @@ -0,0 +1,3 @@ +output "url" { + value = aws_s3_bucket.website_bucket.website_endpoint +} From 95b617576567086ef6cb32e2db991ed07f8240ad Mon Sep 17 00:00:00 2001 From: Itamar <104310066+ItamarMalka@users.noreply.github.com> Date: Sun, 8 May 2022 17:22:30 +0300 Subject: [PATCH 3/4] Create index.template.html --- hello-world/index.template.html | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 hello-world/index.template.html diff --git a/hello-world/index.template.html b/hello-world/index.template.html new file mode 100644 index 0000000..8448d0e --- /dev/null +++ b/hello-world/index.template.html @@ -0,0 +1,54 @@ + + + + + Hello from env0! + + + + + + +
+

Welcome to your own environment !!!USER!!!

+ + hello +
+ Powered by   + + + +
+
+ + + From 6fd3f4394f95114d449136e8c0c2c6a4eea19162 Mon Sep 17 00:00:00 2001 From: Itamar <104310066+ItamarMalka@users.noreply.github.com> Date: Sun, 8 May 2022 17:22:55 +0300 Subject: [PATCH 4/4] Create s3.tf --- hello-world/s3.tf | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 hello-world/s3.tf diff --git a/hello-world/s3.tf b/hello-world/s3.tf new file mode 100644 index 0000000..f81d90b --- /dev/null +++ b/hello-world/s3.tf @@ -0,0 +1,48 @@ +provider "random" {} + +resource "random_string" "random" { + length = 16 + special = false + min_lower = 16 +} + +resource "aws_s3_bucket" "website_bucket" { + bucket = "hello-env0-${random_string.random.result}" + acl = "public-read" + + force_destroy = true + + website { + index_document = "index.html" + error_document = "index.html" + } +} + +resource "aws_s3_bucket_policy" "website_bucket_policy" { + bucket = aws_s3_bucket.website_bucket.id + + policy = <