Skip to content

Commit

Permalink
Merge pull request #37 from nick4fake/fix/31
Browse files Browse the repository at this point in the history
#31: Remove unnecessary element code, double check TF 0.12 migr…
  • Loading branch information
morgante authored Oct 30, 2019
2 parents ae0dd08 + f0631dc commit 32febc3
Show file tree
Hide file tree
Showing 46 changed files with 122 additions and 52 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.1.0
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.4.6
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module "log_export" {
log_sink_name = "storage_example_logsink"
parent_resource_id = "sample-project"
parent_resource_type = "project"
unique_writer_identity = "true"
unique_writer_identity = true
}
module "destination" {
Expand All @@ -49,11 +49,11 @@ so that all dependencies are met.
|------|-------------|:----:|:-----:|:-----:|
| destination\_uri | The self_link URI of the destination resource (This is available as an output coming from one of the destination submodules) | string | n/a | yes |
| filter | The filter to apply when exporting logs. Only log entries that match the filter are exported. Default is '' which exports all logs. | string | `""` | no |
| include\_children | Only valid if 'organization' or 'folder' is chosen as var.parent_resource.type. Determines whether or not to include children organizations/folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization/folder are included. | string | `"false"` | no |
| include\_children | Only valid if 'organization' or 'folder' is chosen as var.parent_resource.type. Determines whether or not to include children organizations/folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization/folder are included. | bool | `"false"` | no |
| log\_sink\_name | The name of the log sink to be created. | string | n/a | yes |
| parent\_resource\_id | The ID of the GCP resource in which you create the log sink. If var.parent_resource_type is set to 'project', then this is the Project ID (and etc). | 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 |
| unique\_writer\_identity | Whether or not to create a unique identity associated with this sink. If false (the default), then the writer_identity used is serviceAccount:cloud-logs@system.gserviceaccount.com. If true, then a unique service account is created and used for the logging sink. | string | `"false"` | no |
| unique\_writer\_identity | Whether or not to create a unique identity associated with this sink. If false (the default), then the writer_identity used is serviceAccount:cloud-logs@system.gserviceaccount.com. If true, then a unique service account is created and used for the logging sink. | bool | `"false"` | no |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion examples/bigquery/billing_account/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module "log_export" {
log_sink_name = "bigquery_example_logsink"
parent_resource_id = var.parent_resource_id
parent_resource_type = "billing_account"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
Expand Down
2 changes: 2 additions & 0 deletions examples/bigquery/billing_account/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which BigQuery dataset destination will be created."
type = string
}
6 changes: 3 additions & 3 deletions examples/bigquery/folder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,7 +31,7 @@ module "log_export" {
log_sink_name = "bigquery_folder_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "folder"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
Expand Down
2 changes: 2 additions & 0 deletions examples/bigquery/folder/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which BigQuery dataset destination will be created."
type = string
}
6 changes: 3 additions & 3 deletions examples/bigquery/organization/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,7 +31,7 @@ module "log_export" {
log_sink_name = "bigquery_org_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "organization"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
Expand Down
2 changes: 2 additions & 0 deletions examples/bigquery/organization/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which BigQuery dataset destination will be created."
type = string
}

6 changes: 3 additions & 3 deletions examples/bigquery/project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,7 +31,7 @@ module "log_export" {
log_sink_name = "bigquery_project_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "project"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
Expand Down
2 changes: 2 additions & 0 deletions examples/bigquery/project/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which BigQuery dataset destination will be created."
type = string
}

4 changes: 2 additions & 2 deletions examples/pubsub/billing_account/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ module "log_export" {
log_sink_name = "pubsub_example_logsink"
parent_resource_id = var.parent_resource_id
parent_resource_type = "billing_account"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
source = "../../..//modules/pubsub"
project_id = var.project_id
topic_name = "pubsub-example"
log_sink_writer_identity = module.log_export.writer_identity
create_subscriber = "true"
create_subscriber = true
}

2 changes: 2 additions & 0 deletions examples/pubsub/billing_account/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which pubsub topic destination will be created."
type = string
}

8 changes: 4 additions & 4 deletions examples/pubsub/folder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,14 +31,14 @@ module "log_export" {
log_sink_name = "pubsub_folder_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "folder"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
source = "../../..//modules/pubsub"
project_id = var.project_id
topic_name = "pubsub-folder-${random_string.suffix.result}"
log_sink_writer_identity = module.log_export.writer_identity
create_subscriber = "true"
create_subscriber = true
}

2 changes: 2 additions & 0 deletions examples/pubsub/folder/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which pubsub topic destination will be created."
type = string
}

8 changes: 4 additions & 4 deletions examples/pubsub/organization/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,14 +31,14 @@ module "log_export" {
log_sink_name = "pubsub_org_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "organization"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
source = "../../..//modules/pubsub"
project_id = var.project_id
topic_name = "pubsub-org-${random_string.suffix.result}"
log_sink_writer_identity = module.log_export.writer_identity
create_subscriber = "true"
create_subscriber = true
}

2 changes: 2 additions & 0 deletions examples/pubsub/organization/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which pubsub topic destination will be created."
type = string
}

8 changes: 4 additions & 4 deletions examples/pubsub/project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,14 +31,14 @@ module "log_export" {
log_sink_name = "pubsub_project_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "project"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
source = "../../..//modules/pubsub"
project_id = var.project_id
topic_name = "pubsub-project-${random_string.suffix.result}"
log_sink_writer_identity = module.log_export.writer_identity
create_subscriber = "true"
create_subscriber = true
}

2 changes: 2 additions & 0 deletions examples/pubsub/project/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which pubsub topic destination will be created."
type = string
}

2 changes: 1 addition & 1 deletion examples/splunk-sink/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ module "destination" {
project_id = var.project_id
topic_name = "splunk-sink"
log_sink_writer_identity = module.log_export.writer_identity
create_subscriber = "true"
create_subscriber = true
}

2 changes: 2 additions & 0 deletions examples/splunk-sink/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which pubsub topic destination will be created."
type = string
}

2 changes: 1 addition & 1 deletion examples/storage/billing_account/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module "log_export" {
log_sink_name = "storage_example_logsink"
parent_resource_id = var.parent_resource_id
parent_resource_type = "billing_account"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
Expand Down
2 changes: 2 additions & 0 deletions examples/storage/billing_account/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which storage bucket destination will be created."
type = string
}

6 changes: 3 additions & 3 deletions examples/storage/folder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,7 +31,7 @@ module "log_export" {
log_sink_name = "storage_folder_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "folder"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
Expand Down
2 changes: 2 additions & 0 deletions examples/storage/folder/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

variable "project_id" {
description = "The ID of the project in which the log export will be created."
type = string
}

variable "parent_resource_id" {
description = "The ID of the project in which storage bucket destination will be created."
type = string
}

6 changes: 3 additions & 3 deletions examples/storage/organization/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provider "google" {

resource "random_string" "suffix" {
length = 4
upper = "false"
special = "false"
upper = false
special = false
}

module "log_export" {
Expand All @@ -31,7 +31,7 @@ module "log_export" {
log_sink_name = "storage_org_${random_string.suffix.result}"
parent_resource_id = var.parent_resource_id
parent_resource_type = "organization"
unique_writer_identity = "true"
unique_writer_identity = true
}

module "destination" {
Expand Down
Loading

0 comments on commit 32febc3

Please sign in to comment.