From 9843017fa51bbc478ef39acf2705de8c39bfe72a Mon Sep 17 00:00:00 2001 From: Brian Fitzwater - IDI-C Date: Fri, 27 Sep 2019 10:51:27 -0400 Subject: [PATCH 1/2] Update module source --- README.md | 30 ------------------------------ examples/example-master.tf | 2 +- examples/example-mgmt-all.tf | 2 +- examples/example-self.tf | 2 +- 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index bb7fb2a..2ca1d33 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ account the Lambda function is installed in. - [Example Usage](#example-usage) - [Terraform Module Inputs](#terraform-module-inputs) - [Terraform Module Outputs](#terraform-module-outputs) -- [Non-Module Installation](#non-module-installation) - [Environment Variables](#environment-variables) - [CircleCI Environment Variables](#circleci-environment-variables) - [Lambda Function Environment Variables](#lambda-function-environment-variables) @@ -191,35 +190,6 @@ See the [examples](terraform/examples) directory for more examples. [top](#top) -## Non-Module Installation - -It is also possible to build and apply locally without using as a Terraform -module. - -1. Install system dependencies. - 1. [Go](https://golang.org/) - 1. [Dep](https://golang.github.io/dep/docs/installation.html) - 1. [GolangCI-Lint](https://github.com/golangci/golangci-lint) - 1. [gosec](https://github.com/securego/gosec) - 1. [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/installing.html) - 1. [Terraform](https://www.terraform.io/) -1. [Configure AWS](https://www.terraform.io/docs/providers/aws/#authentication) with credentials for your AWS account locally. -1. Set the the environment variables specified in the CircleCI section below. -1. Copy the `terrafrom/terraform.tfvars.example` file to `terraform/terraform.tfvars` and set the values as necessary for your environment. -1. Validate and test the code - - ```bash - make test - ``` - -1. Build and deploy - - ```bash - make deploy - ``` - -[top](#top) - ## Environment Variables ### CircleCI Environment Variables diff --git a/examples/example-master.tf b/examples/example-master.tf index 67f11c2..88b8f71 100644 --- a/examples/example-master.tf +++ b/examples/example-master.tf @@ -2,7 +2,7 @@ // list all accounts and inventory each one using the OrganizationAccessRole // if accounts_info = "" module "example_master" { - source = "github.com/GSA/grace-inventory/terraform" + source = "github.com/GSA/grace-inventory?ref=v0.1.1" accounts_info = "" source_file = "../../release/grace-inventory-lambda.zip" appenv = "development" diff --git a/examples/example-mgmt-all.tf b/examples/example-mgmt-all.tf index 49620db..3a6d0de 100644 --- a/examples/example-mgmt-all.tf +++ b/examples/example-mgmt-all.tf @@ -3,7 +3,7 @@ // if accounts_info = "" and master_account_id and master_role_name are set // and the roles are assumable by the Lambda function's IAM role module "example_mgmt_all" { - source = "github.com/GSA/grace-inventory/terraform" + source = "github.com/GSA/grace-inventory?ref=v0.1.1" accounts_info = "" master_account_id = "111111111111" master_role_name = "AssumableRole" diff --git a/examples/example-self.tf b/examples/example-self.tf index ae411c5..4e58bfc 100644 --- a/examples/example-self.tf +++ b/examples/example-self.tf @@ -1,7 +1,7 @@ // The default behavior is to inventory only the account the lambda function // is installed in (i.e. accounts_info = "self" module "example_self" { - source = "github.com/GSA/grace-inventory/terraform" + source = "github.com/GSA/grace-inventory?ref=v0.1.1" source_file = "../../release/grace-inventory-lambda.zip" appenv = "development" project_name = "grace" From e2102da0668a35325c14fe5ce564979983c989d6 Mon Sep 17 00:00:00 2001 From: Brian Fitzwater - IDI-C Date: Fri, 27 Sep 2019 10:59:37 -0400 Subject: [PATCH 2/2] enable terraform_module_pinned_source rule in tflint --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ee08a24..257da89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ jobs: command: curl -L -o /tmp/tflint.zip https://github.com/wata727/tflint/releases/download/v0.9.2/tflint_linux_amd64.zip && unzip /tmp/tflint.zip -d /usr/local/bin - run: name: Check Terraform configurations with tflint - command: find . -name ".terraform" -prune -o -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (cd "$m" && tflint --ignore-rule=terraform_module_pinned_source && echo "√ $m") || exit 1 ; done + command: find . -name ".terraform" -prune -o -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (cd "$m" && tflint && echo "√ $m") || exit 1 ; done lint_handler: environment: AWS_DEFAULT_REGION: us-east-1