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   + + + +
+
+ + + 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" +} 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 +} 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 = <