From 1bc3050fc114bbaa11a49dd78dd63c098475db43 Mon Sep 17 00:00:00 2001 From: joon Date: Sun, 26 Jun 2022 15:17:42 -0700 Subject: [PATCH] Update README to use github.com source --- README.md | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9281ec5..e69ec82 100644 --- a/README.md +++ b/README.md @@ -31,17 +31,11 @@ This module DOES NOT deploy ## Usage -Clone or submodule this repo. For example: - -``` -git clone https://github.com/pirxthepilot/terraform-aws-static-site.git ./modules/terraform-aws-static-site -``` - In the terraform project `main.tf`: ``` module "my_site" { - source = "./modules/terraform-aws-static-site" + source = "github.com/pirxthepilot/terraform-aws-static-site?ref=v0.0.1" name = "my_site" domain = "example.com" @@ -57,6 +51,8 @@ module "my_site" { } ``` +It is highly recommended that you pin to a specific tag or commit ID by including `?ref=` in the `source` declaration. Otherwise, future changes to this repo might break your site's deployment. + Inputs: * `source` - path to this module relative to your project directory @@ -73,9 +69,29 @@ Run from your terraform project: teraform fmt terraform init terraform plan +``` + +Review the plan, and if everything looks good, proceed to apply: + +``` terraform apply ``` +### Using a cloned copy of the repo + +Alternatively, if you want to use the module but need to make custom changes, you can simply clone it to your local: + +``` +git clone https://github.com/pirxthepilot/terraform-aws-static-site.git ./modules/terraform-aws-static-site +``` + +then reference the cloned directory in your module declaration: + +``` + source = "./modules/terraform-aws-static-site" +``` + + ## Uploading files to S3 After deploy, you can upload your static files to the newly-created S3 bucket via AWS Console or `aws-cli`: