Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Nov 27, 2023
2 parents 7c88ed5 + a413f03 commit a5dce96
Show file tree
Hide file tree
Showing 25 changed files with 399 additions and 287 deletions.
65 changes: 1 addition & 64 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":semanticCommits",
":preserveSemverRanges",
":rebaseStalePrs"
],
"stabilityDays":7,
"ignorePaths": [],
"labels": ["dependencies"],
"vulnerabilityAlerts":{
"labels":[
"type:security"
],
"stabilityDays":0
},
"separateMajorMinor":false,
"constraints": {
"go": "1.20"
},
"packageRules": [
{
"matchPaths": ["examples/**", "test/**", ".github/**"],
"extends": [":semanticCommitTypeAll(chore)"]
},
{
"matchPaths": ["*", "modules/**"],
"extends": [":semanticCommitTypeAll(fix)"]
},
{
"matchDepTypes": ["module"],
"groupName": "TF modules"
},
{
"matchDepTypes": ["require"],
"groupName": "GO modules",
"postUpdateOptions": ["gomodTidy"]
},
{
"matchDatasources": ["golang-version"],
"rangeStrategy": "bump",
"allowedVersions": "<1.21.0",
"postUpdateOptions": ["gomodTidy"]
},
{
"matchPackageNames": ["google", "google-beta"],
"groupName": "terraform googles"
}
],
"regexManagers": [
{
"fileMatch": ["(^|/)Makefile$"],
"matchStrings": ["DOCKER_TAG_VERSION_DEVELOPER_TOOLS := (?<currentValue>.*?)\\n"],
"datasourceTemplate": "docker",
"registryUrlTemplate": "https://gcr.io/cloud-foundation-cicd",
"depNameTemplate": "cft/developer-tools"
},
{
"fileMatch": ["(^|/)build/(int|lint)\\.cloudbuild\\.yaml$"],
"matchStrings": [" _DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '(?<currentValue>.*?)'\\n"],
"datasourceTemplate": "docker",
"registryUrlTemplate": "https://gcr.io/cloud-foundation-cicd",
"depNameTemplate": "cft/developer-tools"
}
]
"extends": ["github>GoogleCloudPlatform/cloud-foundation-toolkit//infra/terraform/test-org/github/resources/renovate"]
}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: 'lint'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'
- id: variables
run: |
MAKEFILE=$(find . -name Makefile -print -quit)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:

jobs:
stale:
if: github.repository_owner == 'GoogleCloudPlatform' || github.repository_owner == 'terraform-google-modules'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ The format is based on
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.0.0](https://github.com/terraform-google-modules/terraform-google-pubsub/compare/v5.0.0...v6.0.0) (2023-10-31)


### ⚠ BREAKING CHANGES

* **TPG>=4.78:** add cloud storage subscription support ([#145](https://github.com/terraform-google-modules/terraform-google-pubsub/issues/145))
* remove iot ([#143](https://github.com/terraform-google-modules/terraform-google-pubsub/issues/143))

### Features

* **TPG>=4.78:** add cloud storage subscription support ([#145](https://github.com/terraform-google-modules/terraform-google-pubsub/issues/145)) ([95863ab](https://github.com/terraform-google-modules/terraform-google-pubsub/commit/95863ab6e5d09919adc8cbbb97f12e6e064ad892))


### Bug Fixes

* remove iot ([#143](https://github.com/terraform-google-modules/terraform-google-pubsub/issues/143)) ([dca11ae](https://github.com/terraform-google-modules/terraform-google-pubsub/commit/dca11aed04d76c44be9e7d58e5d4f6f9cee06b8f))
* upgraded versions.tf to include minor bumps from tpg v5 ([#153](https://github.com/terraform-google-modules/terraform-google-pubsub/issues/153)) ([2bdbea6](https://github.com/terraform-google-modules/terraform-google-pubsub/commit/2bdbea6aeff1315a1aa8a6b52e7f7a8e82a54ec8))

## [5.0.0](https://github.com/terraform-google-modules/terraform-google-pubsub/compare/v4.0.1...v5.0.0) (2022-12-30)


Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NOTE: This file is automatically generated from values at:
# https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/blob/master/infra/terraform/test-org/org/locals.tf

* @terraform-google-modules/cft-admins
* @terraform-google-modules/cft-admins @imrannayer
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 := 1.11
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.17
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is a simple usage of the module. Please see also a simple setup provided in
```hcl
module "pubsub" {
source = "terraform-google-modules/pubsub/google"
version = "~> 5.0"
version = "~> 6.0"
topic = "tf-topic"
project_id = "my-pubsub-project"
Expand Down Expand Up @@ -61,6 +61,18 @@ module "pubsub" {
drop_unknown_fields = false // optional
}
]
cloud_storage_subscriptions = [
{
name = "cloud-storage" // required
bucket = "example-bucket" // required
filename_prefix = "log_events_" // optional
filename_suffix = ".avro" // optional
max_duration = "60s" // optional
max_bytes = "10000000" // optional
output_format = "avro" // optional
write_metadata = false // optional
}
]
}
```

Expand All @@ -69,7 +81,8 @@ module "pubsub" {

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| bigquery\_subscriptions | The list of the bigquery push subscriptions. | `list(map(string))` | `[]` | no |
| bigquery\_subscriptions | The list of the Bigquery push subscriptions. | `list(map(string))` | `[]` | no |
| cloud\_storage\_subscriptions | The list of the Cloud Storage push subscriptions. | `list(map(string))` | `[]` | no |
| create\_subscriptions | Specify true if you want to create subscriptions. | `bool` | `true` | no |
| create\_topic | Specify true if you want to create a topic. | `bool` | `true` | no |
| grant\_token\_creator | Specify true if you want to add token creator role to the default Pub/Sub SA. | `bool` | `true` | no |
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: '1.11'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.17'
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: '1.11'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.17'
35 changes: 35 additions & 0 deletions examples/cloud_storage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Cloud Storage Example

This example illustrates how to use the `pubsub` module.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| project\_id | The project ID to manage the Pub/Sub resources | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| bucket\_name | The name of the Cloud Storage bucket created |
| project\_id | The project ID |
| topic\_name | The name of the Pub/Sub topic created |

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

## Requirements

The following sections describe the requirements which must be met in
order to invoke this example. The requirements of the
[root module][root-module-requirements] must be met.

## Usage

To provision this example, populate `terraform.tfvars` with the [required variables](#inputs) and run the following commands within
this directory:
- `terraform init` to get the plugins
- `terraform plan` to see the infrastructure plan
- `terraform apply` to apply the infrastructure build
- `terraform destroy` to destroy the built infrastructure
48 changes: 48 additions & 0 deletions examples/cloud_storage/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Copyright 2018-2023 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.
*/

resource "random_id" "bucket_suffix" {
byte_length = 4
}

provider "google" {
region = "europe-west1"
}

module "pubsub" {
source = "../../"
project_id = var.project_id
topic = "cft-tf-pubsub-topic-cloud-storage"

topic_labels = {
foo_label = "foo_value"
}

cloud_storage_subscriptions = [
{
name = "example_bucket_subscription"
bucket = google_storage_bucket.test.name

ack_deadline_seconds = 300
},
]
}

resource "google_storage_bucket" "test" {
project = var.project_id
name = join("-", ["test_bucket", random_id.bucket_suffix.hex])
location = "europe-west1"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2018-2023 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 @@ -14,12 +14,17 @@
* limitations under the License.
*/

terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.23"
}
}
required_version = ">= 0.13"
output "project_id" {
value = var.project_id
description = "The project ID"
}

output "bucket_name" {
value = google_storage_bucket.test.name
description = "The name of the Cloud Storage bucket created"
}

output "topic_name" {
value = module.pubsub.topic
description = "The name of the Pub/Sub topic created"
}
13 changes: 4 additions & 9 deletions examples/kms/versions.tf → examples/cloud_storage/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2018 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 @@ -14,12 +14,7 @@
* limitations under the License.
*/

terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.1"
}
}
required_version = ">= 0.13"
variable "project_id" {
type = string
description = "The project ID to manage the Pub/Sub resources"
}
25 changes: 0 additions & 25 deletions examples/simple/versions.tf

This file was deleted.

25 changes: 0 additions & 25 deletions examples/subscriptions_only/versions.tf

This file was deleted.

Loading

0 comments on commit a5dce96

Please sign in to comment.