Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue Argument list too long #32

Merged
merged 2 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ corresponding pull request appended.

## [Unreleased]

### Fixed

- Argument list too long [#32]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix issue with long argument lists.

Suggested change
- Argument list too long [#32]
- Argument list too long [#32]


## [2.0.0] - 2019-07-16

### Changed
Expand Down Expand Up @@ -68,3 +72,4 @@ management.
[#19]: https://github.com/terraform-google-modules/terraform-google-iam/pull/19
[#24]: https://github.com/terraform-google-modules/terraform-google-iam/pull/24
[#29]: https://github.com/terraform-google-modules/terraform-google-iam/pull/29
[#32]: https://github.com/terraform-google-modules/terraform-google-iam/pull/32
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SHELL := /usr/bin/env bash
# Docker build config variables
CREDENTIALS_PATH ?= /cft/workdir/credentials.json
DOCKER_ORG := gcr.io/cloud-foundation-cicd
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 2.0.0
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 2.3.0
DOCKER_REPO_BASE_KITCHEN_TERRAFORM := ${DOCKER_ORG}/cft/kitchen-terraform:${DOCKER_TAG_BASE_KITCHEN_TERRAFORM}

# All is the first target in the file so it will get picked up when you just run 'make' on its own
Expand All @@ -30,7 +30,7 @@ all: check generate_docs

# Run all available linters
.PHONY: check
check: check_shell check_python check_golang check_terraform check_docker check_base_files test_check_headers check_headers check_trailing_whitespace
check: check_shell check_python check_golang check_terraform check_base_files test_check_headers check_headers check_trailing_whitespace

# The .PHONY directive tells make that this isn't a real target and so
# the presence of a file named 'check_shell' won't cause this target to stop
Expand Down Expand Up @@ -95,7 +95,7 @@ docker_run:
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
-v $(CURDIR):/cft/workdir \
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
/bin/bash -c "source test/ci_integration.sh && setup_environment && exec /bin/bash"
/bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && exec /bin/bash"
ingwarr marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: docker_create
docker_create:
Expand All @@ -105,7 +105,7 @@ docker_create:
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
-v $(CURDIR):/cft/workdir \
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen create"
/bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen create"

.PHONY: docker_converge
docker_converge:
Expand All @@ -115,7 +115,7 @@ docker_converge:
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
-v $(CURDIR):/cft/workdir \
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen converge"
/bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen converge"

.PHONY: docker_verify
docker_verify:
Expand All @@ -125,7 +125,7 @@ docker_verify:
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
-v $(CURDIR):/cft/workdir \
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen verify"
/bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen verify"

.PHONY: docker_destroy
docker_destroy:
Expand All @@ -135,7 +135,7 @@ docker_destroy:
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
-v $(CURDIR):/cft/workdir \
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen destroy"
/bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen destroy"

.PHONY: test_integration_docker
test_integration_docker:
Expand All @@ -145,5 +145,5 @@ test_integration_docker:
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
-v $(CURDIR):/cft/workdir \
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
make test_integration
/bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && make test_integration"

1 change: 0 additions & 1 deletion examples/folder/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/kms_crypto_key/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/kms_key_ring/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/organization/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/project/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/pubsub_subscription/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/pubsub_topic/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
14 changes: 8 additions & 6 deletions examples/service_account/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
Provider configuration
*****************************************/
provider "google" {
project = "${var.service_account_project}"
version = "~> 2.7"
credentials = file(var.credentials_file_path)
aaron-lane marked this conversation as resolved.
Show resolved Hide resolved
project = var.service_account_project
version = "~> 2.7"
}

provider "google-beta" {
project = "${var.service_account_project}"
version = "~> 2.7"
credentials = file(var.credentials_file_path)
project = var.service_account_project
version = "~> 2.7"
}

/******************************************
Expand All @@ -33,7 +35,7 @@ provider "google-beta" {
module "service_account_iam_binding" {
source = "../../"

service_accounts = ["${var.service_account_one}", "${var.service_account_two}"]
service_accounts = [var.service_account_one, var.service_account_two]

mode = "additive"

Expand All @@ -43,11 +45,11 @@ module "service_account_iam_binding" {
"group:${var.group_email}",
"user:${var.user_email}",
]

"roles/iam.serviceAccountTokenCreator" = [
"serviceAccount:${var.sa_email}",
"group:${var.group_email}",
"user:${var.user_email}",
]
}
}

4 changes: 4 additions & 0 deletions examples/service_account/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ variable "service_account_one" {
variable "service_account_two" {
description = "First service Account to add the IAM policies/bindings"
}

variable "credentials_file_path" {
description = "Path to the service account"
}
19 changes: 19 additions & 0 deletions examples/service_account/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/stackdriver_agent_roles/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/storage_bucket/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion examples/subnet/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
3 changes: 1 addition & 2 deletions scripts/create_additive_authoritative_structures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ function main {
then
build_authoritative
fi

jq -n --arg output "$OUTPUT" '{data:$output}'
echo "$OUTPUT"| sed -e 's/.*/{\n "data": "&/; s/$/"\n}/'
aaron-lane marked this conversation as resolved.
Show resolved Hide resolved
}

main
1 change: 0 additions & 1 deletion test/fixtures/full/base/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
1 change: 0 additions & 1 deletion test/fixtures/full/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}
38 changes: 7 additions & 31 deletions test/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,39 +67,14 @@ function basefiles() {
done
}

# This function runs the hadolint linter on
# every file named 'Dockerfile'
function docker() {
echo "Running hadolint on Dockerfiles"
find_files . -name "Dockerfile" -print0 \
| compat_xargs -0 hadolint
}

# This function runs 'terraform validate' against all
# directory paths which contain *.tf files.
# This function runs 'terraform validate' and 'terraform fmt'
# against all directory paths which contain *.tf files.
function check_terraform() {
set -e
# fmt is before validate for faster feedback, validate requires terraform
# init which takes time.
echo "Running terraform fmt"
find_files . -name "*.tf" -print0 \
| compat_xargs -0 -n1 dirname \
| sort -u \
| compat_xargs -t -n1 terraform fmt -diff -check=true -write=false
rval="$?"
if [[ "${rval}" -gt 0 ]]; then
echo "Error: terraform fmt failed with exit code ${rval}" >&2
echo "Check the output for diffs and correct using terraform fmt <dir>" >&2
return "${rval}"
fi
echo "Running terraform validate"
# Change to a temporary directory to avoid re-initializing terraform init
# over and over in the root of the repository.
find_files . -name "*.tf" -print \
| grep -v 'test/fixtures/shared' \
| compat_xargs -n1 dirname \
| sort -u \
| compat_xargs -t -n1 test/terraform_validate
#shellcheck disable=SC2156
find . -name "*.tf" -not -path "./test/fixtures/shared/*" -not -path "./test/fixtures/all_examples/*" -exec bash -c 'cd $(dirname "{}") && terraform init && terraform validate ' \;
echo "Running terraform fmt"
find_files . -name "*.tf" -exec terraform fmt -check=true -write=false {} \;
}

# This function runs 'go fmt' and 'go vet' on every file
Expand Down Expand Up @@ -148,6 +123,7 @@ function generate_docs() {
# script seem to be designed to work into current directory
cd "${path}" && echo "Working in ${path} ..."
terraform_docs.sh . && echo Success! || echo "Warning! Exit code: ${?}"
# shellcheck disable=SC2164
cd - >/dev/null
else
echo "Skipping ${path} because README.md does not exist."
Expand Down
1 change: 0 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


terraform {
required_version = ">= 0.12"
}