Skip to content

Commit

Permalink
feat!: add Terraform 0.13 constraint and module attribution (#70)
Browse files Browse the repository at this point in the history
Co-authored-by: Morgante Pell <[email protected]>
  • Loading branch information
cloud-foundation-bot and morgante authored Sep 29, 2021
1 parent 5d4d6ad commit f3559b4
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 55 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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ configures a function sourced from a Cloud Source Repositories
repository.

## Compatibility

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

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 [v1.5.0](https://registry.terraform.io/modules/terraform-google-modules/-event-function/google/v1.5.0).

## Usage

Expand Down Expand Up @@ -96,7 +96,7 @@ order to invoke this module.
The following software dependencies must be installed on the system
from which this module will be invoked:

- [Terraform][terraform-site] v0.12
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.0
- [Terraform Provider for Archive][terraform-provider-archive-site]
v1.2
- [Terraform Provider for Google Cloud Platform][terraform-provider-gcp-site] v2.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 @@ -38,4 +38,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'
8 changes: 4 additions & 4 deletions examples/automatic-labelling-folder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ this directory:
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| folder\_id | The ID of the folder to look for changes. | string | n/a | yes |
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
| region | The region in which resources will be applied. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| folder\_id | The ID of the folder to look for changes. | `string` | n/a | yes |
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
| region | The region in which resources will be applied. | `string` | n/a | yes |

## Outputs

Expand Down
10 changes: 5 additions & 5 deletions examples/automatic-labelling-from-localhost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ this directory:
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
| region | The region in which resources will be applied. | string | n/a | yes |
| subnetwork | The name or self_link of the subnetwork to create compute instance in. | string | `"default"` | no |
| zone | The zone in which resources will be applied. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
| region | The region in which resources will be applied. | `string` | n/a | yes |
| subnetwork | The name or self\_link of the subnetwork to create compute instance in. | `string` | `"default"` | no |
| zone | The zone in which resources will be applied. | `string` | n/a | yes |

## Outputs

Expand Down
10 changes: 5 additions & 5 deletions examples/automatic-labelling-from-repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ this directory:
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
| region | The region in which resources will be applied. | string | n/a | yes |
| subnetwork | The name or self_link of the subnetwork to create compute instance in. | string | `"default"` | no |
| zone | The zone in which resources will be applied. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
| region | The region in which resources will be applied. | `string` | n/a | yes |
| subnetwork | The name or self\_link of the subnetwork to create compute instance in. | `string` | `"default"` | no |
| zone | The zone in which resources will be applied. | `string` | n/a | yes |

## Outputs

Expand Down
10 changes: 7 additions & 3 deletions examples/delete-vms-without-cmek/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ this directory:
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
| region | The region in which resources will be applied. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
| region | The region in which resources will be applied. | `string` | n/a | yes |

## Outputs

No output.

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

Expand Down
6 changes: 3 additions & 3 deletions examples/dynamic-files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ this directory:
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
| region | The region in which resources will be applied. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
| region | The region in which resources will be applied. | `string` | n/a | yes |

## Outputs

Expand Down
14 changes: 7 additions & 7 deletions modules/event-folder-log-entry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ The
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| filter | The filter to apply when exporting logs. | string | n/a | yes |
| folder\_id | The ID of the folder to look for changes. | string | n/a | yes |
| include\_children | Determines whether or not to include folder's children in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included. | bool | `"false"` | no |
| labels | A set of key/value label pairs to assign to any labelable resources. | map(string) | `<map>` | no |
| name | The name to apply to any nameable resources. | string | n/a | yes |
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| filter | The filter to apply when exporting logs. | `string` | n/a | yes |
| folder\_id | The ID of the folder to look for changes. | `string` | n/a | yes |
| include\_children | Determines whether or not to include folder's children in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included. | `bool` | `false` | no |
| labels | A set of key/value label pairs to assign to any labelable resources. | `map(string)` | `{}` | no |
| name | The name to apply to any nameable resources. | `string` | n/a | yes |
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |

## Outputs

Expand Down
16 changes: 14 additions & 2 deletions modules/event-folder-log-entry/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,5 +15,17 @@
*/

terraform {
required_version = ">= 0.12"
required_version = ">= 0.13"
required_providers {

google = {
source = "hashicorp/google"
version = "~> 3.53"
}
}

provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-event-function:event-folder-log-entry/v1.0.0"
}

}
12 changes: 6 additions & 6 deletions modules/event-project-log-entry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ The
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| filter | The filter to apply when exporting logs. | string | n/a | yes |
| labels | A set of key/value label pairs to assign to any labelable resources. | map(string) | `<map>` | no |
| name | The name to apply to any nameable resources. | string | n/a | yes |
| parent\_resource\_type | The GCP resource in which you create the log sink. The value must not be computed, and must be one of the following: 'project', 'folder', 'billing_account', or 'organization'. | string | `"project"` | no |
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
|------|-------------|------|---------|:--------:|
| filter | The filter to apply when exporting logs. | `string` | n/a | yes |
| labels | A set of key/value label pairs to assign to any labelable resources. | `map(string)` | `{}` | no |
| name | The name to apply to any nameable resources. | `string` | n/a | yes |
| parent\_resource\_type | The GCP resource in which you create the log sink. The value must not be computed, and must be one of the following: 'project', 'folder', 'billing\_account', or 'organization'. | `string` | `"project"` | no |
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |

## Outputs

Expand Down
16 changes: 14 additions & 2 deletions modules/event-project-log-entry/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,5 +15,17 @@
*/

terraform {
required_version = ">= 0.12"
required_version = ">= 0.13"
required_providers {

google = {
source = "hashicorp/google"
version = "~> 3.53"
}
}

provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-event-function:event-project-log-entry/v1.0.0"
}

}
16 changes: 14 additions & 2 deletions modules/repository-function/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,5 +15,17 @@
*/

terraform {
required_version = ">= 0.12"
required_version = ">= 0.13"
required_providers {

google = {
source = "hashicorp/google"
version = "~> 3.53"
}
}

provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-event-function:repository-function/v1.0.0"
}

}
4 changes: 2 additions & 2 deletions test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "google_folder" "ci_event_func_subfolder" {

module "project" {
source = "terraform-google-modules/project-factory/google"
version = "~> 9.0"
version = "~> 10.0"

name = local.project_name
random_project_id = true
Expand All @@ -52,7 +52,7 @@ module "project" {

module "network" {
source = "terraform-google-modules/network/google"
version = "~> 2.5"
version = "~> 3.0"

project_id = module.project.project_id
network_name = "test-network"
Expand Down
4 changes: 2 additions & 2 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ terraform {
}

provider "google" {
version = "~> 3.39.0"
version = "~> 3.53.0"
}

provider "google-beta" {
version = "~> 3.39.0"
version = "~> 3.53.0"
}
16 changes: 12 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,9 +15,17 @@
*/

terraform {
required_version = ">= 0.12"

required_version = ">= 0.13"
required_providers {
google = ">= 3.38.0"

google = {
source = "hashicorp/google"
version = "~> 3.53"
}
}

provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-event-function/v1.0.0"
}

}

0 comments on commit f3559b4

Please sign in to comment.