Skip to content

Commit

Permalink
feat!: add Terraform 0.13 constraint and module attribution (#134)
Browse files Browse the repository at this point in the history
* feat!: add Terraform 0.13 constraint and module attribution

* fix authoritative tests

Co-authored-by: bharathkkb <bharathkrishnakb@gmail.com>
  • Loading branch information
cloud-foundation-bot and bharathkkb committed Mar 22, 2021
1 parent 1e5d793 commit 1bd58cf
Show file tree
Hide file tree
Showing 53 changed files with 658 additions and 177 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Make will use bash instead of sh
SHELL := /usr/bin/env bash

DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.12.0
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.13
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ This is a collection of submodules that make it easier to non-destructively mana
* [Subnets IAM](modules/subnets_iam)

## Compatibility

This module is meant for use with Terraform 0.12. If you haven't
[upgraded][terraform-0.12-upgrade] and need a Terraform 0.11.x-compatible
version of this module, the last released version intended for Terraform 0.11.x
is [1.1.1][v1.1.1].
This module is meant for use with Terraform 0.13. If you haven't
[upgraded](https://www.terraform.io/upgrade-guides/0-13.html) and need a Terraform
0.12.x-compatible version of this module, the last released version
intended for Terraform 0.12.x is [v6.4.1](https://registry.terraform.io/modules/terraform-google-modules/-iam/google/v6.4.1).

## Upgrading

Expand Down Expand Up @@ -124,7 +123,7 @@ Set the specified variable on the module call to choose the resources to affect.

### Terraform plugins

- [Terraform](https://www.terraform.io/downloads.html) 0.12
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.0
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) 2.5
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) 2.5

Expand Down
2 changes: 1 addition & 1 deletion build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,4 @@ tags:
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.12.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.13'
2 changes: 1 addition & 1 deletion build/lint.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tags:
- 'lint'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.12.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.13'
6 changes: 3 additions & 3 deletions examples/billing_account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This example illustrates how to use the `billing_accounts_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| billing\_account\_id | Billing Account ID to apply IAM bindings | string | n/a | yes |
| project\_id | Project ID for the module | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| billing\_account\_id | Billing Account ID to apply IAM bindings | `string` | n/a | yes |
| project\_id | Project ID for the module | `string` | n/a | yes |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions examples/custom_role_org/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This example illustrates how to use the `custom_role_iam` submodule to create a
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| org\_id | Variable for Organization ID. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| org\_id | Variable for Organization ID. | `string` | n/a | yes |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions examples/custom_role_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This example illustrates how to use the `custom_role_iam` submodule to create a
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| project\_id | Variable for Project ID. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| project\_id | Variable for Project ID. | `string` | n/a | yes |

## Outputs

Expand Down
16 changes: 10 additions & 6 deletions examples/folder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ This example illustrates how to use the `folders_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| folder\_one | The first folder ID to apply IAM bindings | string | n/a | yes |
| folder\_two | The second folder ID to apply IAM bindings | string | n/a | yes |
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| folder\_one | The first folder ID to apply IAM bindings | `string` | n/a | yes |
| folder\_two | The second folder ID to apply IAM bindings | `string` | n/a | yes |
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

16 changes: 10 additions & 6 deletions examples/kms_crypto_key/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ This example illustrates how to use the `kms_crypto_keys_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| kms\_crypto\_key\_one | First kms_cripto_key to add the IAM policies/bindings | string | n/a | yes |
| kms\_crypto\_key\_two | Second kms_cripto_key to add the IAM policies/bindings | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| kms\_crypto\_key\_one | First kms\_cripto\_key to add the IAM policies/bindings | `string` | n/a | yes |
| kms\_crypto\_key\_two | Second kms\_cripto\_key to add the IAM policies/bindings | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
16 changes: 10 additions & 6 deletions examples/kms_key_ring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ This example illustrates how to use the `kms_key_rings_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| kms\_key\_ring\_one | First kms_ring to add the IAM policies/bindings | string | n/a | yes |
| kms\_key\_ring\_two | First kms_ring to add the IAM policies/bindings | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| kms\_key\_ring\_one | First kms\_ring to add the IAM policies/bindings | `string` | n/a | yes |
| kms\_key\_ring\_two | First kms\_ring to add the IAM policies/bindings | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4 changes: 2 additions & 2 deletions examples/member_iam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This example illustrates how to use the `member_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| project\_id | Project id | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| project\_id | Project id | `string` | n/a | yes |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions examples/member_iam/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
Provider configuration
*****************************************/
provider "google" {
version = "~> 2.19"
version = "~> 3.53"
}

provider "google-beta" {
version = "~> 2.19"
version = "~> 3.53"
}

resource "google_service_account" "member_iam_test" {
Expand Down
2 changes: 1 addition & 1 deletion examples/member_iam/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
*/

terraform {
required_version = "~> 0.12.6"
required_version = ">= 0.12"
}
16 changes: 10 additions & 6 deletions examples/organization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ This example illustrates how to use the `organizations_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| organization\_one | First organization to add the IAM policies/bindings | string | n/a | yes |
| organization\_two | Second organization to add the IAM policies/bindings | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| organization\_one | First organization to add the IAM policies/bindings | `string` | n/a | yes |
| organization\_two | Second organization to add the IAM policies/bindings | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
16 changes: 10 additions & 6 deletions examples/project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ This example illustrates how to use the `projects_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| project\_one | First project id to add the IAM policies/bindings | string | n/a | yes |
| project\_two | Second project id to add the IAM policies/bindings | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| project\_one | First project id to add the IAM policies/bindings | `string` | n/a | yes |
| project\_two | Second project id to add the IAM policies/bindings | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
16 changes: 10 additions & 6 deletions examples/project_conditions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ This example illustrates how to use the `projects_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| project\_one | First project id to add the IAM policies/bindings | string | n/a | yes |
| project\_two | Second project id to add the IAM policies/bindings | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| project\_one | First project id to add the IAM policies/bindings | `string` | n/a | yes |
| project\_two | Second project id to add the IAM policies/bindings | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
18 changes: 11 additions & 7 deletions examples/pubsub_subscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ This example illustrates how to use the `pubsub_subscriptions_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| pubsub\_subscription\_one | First pubsub subscription name to add the IAM policies/bindings | string | n/a | yes |
| pubsub\_subscription\_project | Project id of the pub/sub subscription | string | n/a | yes |
| pubsub\_subscription\_two | Second pubsub subscription name to add the IAM policies/bindings | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| pubsub\_subscription\_one | First pubsub subscription name to add the IAM policies/bindings | `string` | n/a | yes |
| pubsub\_subscription\_project | Project id of the pub/sub subscription | `string` | n/a | yes |
| pubsub\_subscription\_two | Second pubsub subscription name to add the IAM policies/bindings | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4 changes: 2 additions & 2 deletions examples/pubsub_subscription/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
Provider configuration
*****************************************/
provider "google" {
version = "~> 2.7"
version = "~> 3.53"
}

provider "google-beta" {
version = "~> 2.7"
version = "~> 3.53"
}

/******************************************
Expand Down
18 changes: 11 additions & 7 deletions examples/pubsub_topic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ This example illustrates how to use the `pubsub_topics_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| pubsub\_topic\_one | First pubsub topic to add the IAM policies/bindings | string | n/a | yes |
| pubsub\_topic\_project | Project id of the pub/sub topic | string | n/a | yes |
| pubsub\_topic\_two | Second pubsub topic to add the IAM policies/bindings | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| pubsub\_topic\_one | First pubsub topic to add the IAM policies/bindings | `string` | n/a | yes |
| pubsub\_topic\_project | Project id of the pub/sub topic | `string` | n/a | yes |
| pubsub\_topic\_two | Second pubsub topic to add the IAM policies/bindings | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4 changes: 2 additions & 2 deletions examples/pubsub_topic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
Provider configuration
*****************************************/
provider "google" {
version = "~> 2.7"
version = "~> 3.53"
}

provider "google-beta" {
version = "~> 2.7"
version = "~> 3.53"
}

/******************************************
Expand Down
20 changes: 12 additions & 8 deletions examples/service_account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ This example illustrates how to use the `service_accounts_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| credentials\_file\_path | Path to the service account | string | n/a | yes |
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| service\_account\_one | First service Account to add the IAM policies/bindings | string | n/a | yes |
| service\_account\_project | Project id of the service account | string | n/a | yes |
| service\_account\_two | First service Account to add the IAM policies/bindings | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| credentials\_file\_path | Path to the service account | `any` | n/a | yes |
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| service\_account\_one | First service Account to add the IAM policies/bindings | `string` | n/a | yes |
| service\_account\_project | Project id of the service account | `string` | n/a | yes |
| service\_account\_two | First service Account to add the IAM policies/bindings | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

10 changes: 7 additions & 3 deletions examples/stackdriver_agent_roles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ Applies the roles necessary to write metrics and logs to Stackdriver to a given
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| project | GCP project in which you wish to grant roles to the service account | string | n/a | yes |
| service\_account\_email | The service account email to enable Stackdriver agent roles on | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| project | GCP project in which you wish to grant roles to the service account | `string` | n/a | yes |
| service\_account\_email | The service account email to enable Stackdriver agent roles on | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
16 changes: 10 additions & 6 deletions examples/storage_bucket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ This example illustrates how to use the `storage_buckets_iam` submodule
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| group\_email | Email for group to receive roles (ex. group@example.com) | string | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | string | n/a | yes |
| storage\_bucket\_one | First name of a GCS bucket to add the IAM policies/bindings | string | n/a | yes |
| storage\_bucket\_two | Second name of a GCS bucket to add the IAM policies/bindings | string | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| group\_email | Email for group to receive roles (ex. group@example.com) | `string` | n/a | yes |
| sa\_email | Email for Service Account to receive roles (Ex. default-sa@example-project-id.iam.gserviceaccount.com) | `string` | n/a | yes |
| storage\_bucket\_one | First name of a GCS bucket to add the IAM policies/bindings | `string` | n/a | yes |
| storage\_bucket\_two | Second name of a GCS bucket to add the IAM policies/bindings | `string` | n/a | yes |
| user\_email | Email for group to receive roles (Ex. user@example.com) | `string` | n/a | yes |

## Outputs

No output.

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

0 comments on commit 1bd58cf

Please sign in to comment.