Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from gruntwork-io/root_example
Browse files Browse the repository at this point in the history
Add root example
  • Loading branch information
autero1 authored May 8, 2019
2 parents 4430e9b + 9fe990a commit f2c0a49
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 10 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,33 @@

This repo contains modules for managing static assets (CSS, JS, images) in GCP.

## Code included in this Module
## Quickstart

* [cloud-storage-static-website](/modules/cloud-storage-static-website): Deploy a [Google Cloud Storage](https://cloud.google.com/storage/) bucket that can be used to host a [static website](https://cloud.google.com/storage/docs/hosting-static-website).
* [http-load-balancer-website](/modules/http-load-balancer-website): Deploy a [HTTP Load Balancer](https://cloud.google.com/load-balancing/docs/https/) that routes requests to a [Google Cloud Storage](https://cloud.google.com/storage/) bucket for static content hosting.
If you want to quickly launch a static website using [Google Cloud Storage](https://cloud.google.com/storage/),
you can run the example that is in the root of this repo. Check out the [cloud-storage-static-website example documentation](https://github.com/gruntwork-io/terraform-google-static-assets/blob/master/examples/cloud-storage-static-website) for instructions.

## What's in this repo

This repo has the following folder structure:

* [root](https://github.com/gruntwork-io/terraform-google-static-assets/tree/master): The root folder contains an example of how to launch a static website using [Google Cloud Storage](https://cloud.google.com/storage/). See [cloud-storage-static-website example documentation](https://github.com/gruntwork-io/terraform-google-static-assets/blob/master/examples/cloud-storage-static-website) for the documentation.

* [modules](https://github.com/gruntwork-io/terraform-google-static-assets/blob/master/modules): This folder contains the main implementation code for this Module.

The primary modules are:

* [cloud-storage-static-website](https://github.com/gruntwork-io/terraform-google-static-assets/blob/master/modules/cloud-storage-static-website):
The Cloud Storage Static Website module is used to create a [Google Cloud Storage](https://cloud.google.com/storage/)
bucket that can be used to host a [static website](https://cloud.google.com/storage/docs/hosting-static-website).

* [http-load-balancer-website](https://github.com/gruntwork-io/terraform-google-static-assets/blob/master/modules/http-load-balancer-website):
The HTTP Load Balancer Website module is used to create a [HTTP Load Balancer](https://cloud.google.com/load-balancing/docs/https/)
that routes requests to a [Google Cloud Storage](https://cloud.google.com/storage/) bucket for static content hosting,
allowing you to also configure SSL with a custom domain name.

* [examples](https://github.com/gruntwork-io/terraform-google-static-assets/blob/master/examples): This folder contains examples of how to use the submodules.

* [test](https://github.com/gruntwork-io/terraform-google-static-assets/blob/master/test): Automated tests for the submodules and examples.

## Who maintains this Module?

Expand Down
3 changes: 2 additions & 1 deletion examples/cloud-storage-static-website/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cloud Storage Static Website Example

This folder shows an example of how to use the [cloud-storage-static-website module](/modules/cloud-storage-static-website) to launch a
The root folder of this repo shows an example of how to use the [cloud-storage-static-website module](/modules/cloud-storage-static-website) to launch a
static website on top of [Google Cloud Storage](https://cloud.google.com/storage/).


Expand All @@ -9,6 +9,7 @@ static website on top of [Google Cloud Storage](https://cloud.google.com/storage
To run this example, you need to:

1. Install [Terraform](https://www.terraform.io/).
1. Make sure you are in the root folder of the repo.
1. Open up `variables.tf` and set secrets at the top of the file as environment variables and fill in any other variables in the file that don't have defaults.
1. `terraform init`.
1. `terraform plan`.
Expand Down
2 changes: 1 addition & 1 deletion ...ples/cloud-storage-static-website/main.tf → main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module "static_site" {
# When using these modules in your own templates, you will need to use a Git URL with a ref attribute that pins you
# to a specific version of the modules, such as the following example:
# source = "git::[email protected]:gruntwork-io/terraform-google-static-assets.git//modules/cloud-storage-static-website?ref=v0.1.0"
source = "../../modules/cloud-storage-static-website"
source = "./modules/cloud-storage-static-website"

project = "${var.project}"

Expand Down
2 changes: 1 addition & 1 deletion modules/http-load-balancer-website/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ locals {
}

module "load_balancer" {
source = "git::git@github.com:gruntwork-io/terraform-google-load-balancer.git//modules/http-load-balancer?ref=v0.0.1"
source = "git::https://github.com/gruntwork-io/terraform-google-load-balancer.git//modules/http-load-balancer?ref=v0.1.0"

name = "${local.website_domain_name_dashed}"
project = "${var.project}"
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion test/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions test/cloud_storage_static_website_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package test
import (
"fmt"
"net/http"
"path/filepath"
"strings"
"testing"

Expand All @@ -22,8 +21,8 @@ func TestCloudStorageStaticSite(t *testing.T) {
//os.Setenv("SKIP_web_tests", "true")
//os.Setenv("SKIP_teardown", "true")

_examplesDir := test_structure.CopyTerraformFolderToTemp(t, "../", "examples")
exampleDir := filepath.Join(_examplesDir, EXAMPLE_NAME_STATIC_SITE)
// The example is the root example
exampleDir := test_structure.CopyTerraformFolderToTemp(t, "../", ".")

test_structure.RunTestStage(t, "bootstrap", func() {
logger.Logf(t, "Bootstrapping variables")
Expand Down
File renamed without changes.

0 comments on commit f2c0a49

Please sign in to comment.