Skip to content

Commit

Permalink
Update README to use github.com source
Browse files Browse the repository at this point in the history
  • Loading branch information
pirxthepilot committed Jun 26, 2022
1 parent 61104df commit 1bc3050
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -57,6 +51,8 @@ module "my_site" {
}
```

It is highly recommended that you pin to a specific tag or commit ID by including `?ref=<tag_or_commit>` 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
Expand All @@ -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`:
Expand Down

0 comments on commit 1bc3050

Please sign in to comment.