Skip to content

Commit

Permalink
Merge pull request #4 from drandell/dev
Browse files Browse the repository at this point in the history
update deps
  • Loading branch information
drandell authored Mar 13, 2023
2 parents cadd2c6 + dd38581 commit a698705
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 60 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5] - 2023-03-13
### Changed
- Updated the minimum google provider version to 4.56 as taxonomy and policy tags are now GA
- Updated the minimum terraform version to 1.3.0 as optional attributes are now GA

## [0.4] - 2022-04-14
### Added
- Entry module
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This module allows the creation of Google Cloud Platform Data Catalog Tag Templa

## Compatibility

This module is meant for use with Terraform 1.0.0.
This module is meant for use with Terraform 1.3.0 and above.

## Usage

Expand All @@ -20,8 +20,8 @@ These sections describe requirements for using this module.

The following dependencies must be available:

- [Terraform](https://www.terraform.io/downloads.html) >= 1.0.0, < 2.0.0
- [Terraform Provider for GCP](https://registry.terraform.io/providers/hashicorp/google/latest) >= v4.0.0, < 5.0.0
- [Terraform](https://www.terraform.io/downloads.html) >= 1.3.0, < 2.0.0
- [Terraform Provider for GCP](https://registry.terraform.io/providers/hashicorp/google/latest) >= v4.56.0, < 5.0.0

### Service Account

Expand All @@ -44,7 +44,7 @@ resources of this module:
## Install

### Terraform
Be sure you have the correct Terraform version (1.0.0 or greater but less than 2.0), you can choose the binary here:
Be sure you have the correct Terraform version (1.3.0 or greater but less than 2.0), you can choose the binary here:
- https://releases.hashicorp.com/terraform/

## File structure
Expand Down
10 changes: 1 addition & 9 deletions modules/entries/versions.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.3.0, < 2.0.0"

required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0, < 5.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0, < 5.0.0"
}
}

experiments = [
module_variable_optional_attrs
]
}
10 changes: 1 addition & 9 deletions modules/entry-group/versions.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.3.0, < 2.0.0"

required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0, < 5.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0, < 5.0.0"
}
}

experiments = [
module_variable_optional_attrs
]
}
2 changes: 1 addition & 1 deletion modules/tag-template/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.3.0, < 2.0.0"

required_providers {
google = {
Expand Down
1 change: 1 addition & 0 deletions modules/tag/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ locals {

resource "google_data_catalog_tag" "tag" {
for_each = local.tags

template = coalesce(var.tag_templates[each.value.tag_template_id]["name"])
parent = coalesce(var.entry_groups[each.value.parent]["name"])
column = each.value.column
Expand Down
10 changes: 1 addition & 9 deletions modules/tag/versions.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.3.0, < 2.0.0"

required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0, < 5.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0, < 5.0.0"
}
}

experiments = [
module_variable_optional_attrs
]
}
17 changes: 5 additions & 12 deletions modules/taxonomy-policy-tags/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ locals {
}

resource "google_data_catalog_taxonomy" "collection" {
provider = google-beta

for_each = { for taxonomy in var.taxonomy_policy_tags : taxonomy["id"] => taxonomy }
project = var.project
region = var.region
Expand All @@ -82,18 +80,16 @@ resource "google_data_catalog_taxonomy" "collection" {
// Bit of a hack, but currently policy tags can only be 4 layers deep
// So lets just hard-code that into our configuration
resource "google_data_catalog_policy_tag" "top_level" {
provider = google-beta

for_each = { for tag in local.top_level_policy_tags : tag["id"] => tag if tag["id"] != null }

taxonomy = google_data_catalog_taxonomy.collection[each.value["taxonomy_id"]].id
display_name = each.value["display_name"]
description = each.value["description"]
}

resource "google_data_catalog_policy_tag" "lvl_one" {
provider = google-beta

for_each = { for tag in local.lvl_one_policy_tags : tag["id"] => tag if tag["id"] != null }

taxonomy = google_data_catalog_taxonomy.collection[each.value["taxonomy_id"]].id
display_name = each.value["display_name"]
description = each.value["description"]
Expand All @@ -105,9 +101,8 @@ resource "google_data_catalog_policy_tag" "lvl_one" {
}

resource "google_data_catalog_policy_tag" "lvl_two" {
provider = google-beta

for_each = { for tag in local.lvl_two_policy_tags : tag["id"] => tag if tag["id"] != null }

taxonomy = google_data_catalog_taxonomy.collection[each.value["taxonomy_id"]].id
display_name = each.value["display_name"]
description = each.value["description"]
Expand All @@ -120,9 +115,8 @@ resource "google_data_catalog_policy_tag" "lvl_two" {
}

resource "google_data_catalog_policy_tag" "lvl_three" {
provider = google-beta

for_each = { for tag in local.lvl_three_policy_tags : tag["id"] => tag if tag["id"] != null }

taxonomy = google_data_catalog_taxonomy.collection[each.value["taxonomy_id"]].id
display_name = each.value["display_name"]
description = each.value["description"]
Expand All @@ -136,9 +130,8 @@ resource "google_data_catalog_policy_tag" "lvl_three" {
}

resource "google_data_catalog_policy_tag" "lvl_four" {
provider = google-beta

for_each = { for tag in local.lvl_four_policy_tags : tag["id"] => tag if tag["id"] != null }

taxonomy = google_data_catalog_taxonomy.collection[each.value["taxonomy_id"]].id
display_name = each.value["display_name"]
description = each.value["description"]
Expand Down
12 changes: 2 additions & 10 deletions modules/taxonomy-policy-tags/versions.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.3.0, < 2.0.0"

required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0, < 5.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0, < 5.0.0"
version = ">= 4.56.0, < 5.0.0"
}
}

experiments = [
module_variable_optional_attrs
]
}
8 changes: 2 additions & 6 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
terraform {
required_version = ">= 1.0.0, < 2.0.0"
required_version = ">= 1.3.0, < 2.0.0"

required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0, < 5.0.0"
version = ">= 4.56.0, < 5.0.0"
}
}

experiments = [
module_variable_optional_attrs
]
}

0 comments on commit a698705

Please sign in to comment.