Skip to content

Project not set for some resources #8

Open
@zchadwickM2

Description

@zchadwickM2

Describe the bug

There are a few resources that don't have the project argument set. They are:

  • google_pubsub_topic.feed_output
  • google_service_account.service_account
  • google_project_iam_custom_role.enrichment_project_role

If you are not setting a provider block, ie

provider "google" {
  project = "example-project-id"
}

Then the module will fail. All other resources make use of the var.project_id.

Reproducing the Bug
Steps to reproduce the behavior:

  1. Do not set a Google provider block with a project defined
  2. Try to apply the code

Expected Behavior
Resources created even without a provider block with a project defined.

Screenshots

Output from a run before adding a provider block with a project:

Error: Failed to retrieve project, pid: , err: project: required field is not set
  with module.enrichment.google_pubsub_topic.feed_output,
  on .terraform/modules/enrichment/terraform-gcp-enrichment/pubsub.tf line 18, in resource "google_pubsub_topic" "feed_output":
  18: resource "google_pubsub_topic" "feed_output" {
Error: Failed to retrieve project, pid: , err: project: required field is not set
  with module.enrichment.google_service_account.service_account,
  on .terraform/modules/enrichment/terraform-gcp-enrichment/service_account.tf line 1, in resource "google_service_account" "service_account":
   1: resource "google_service_account" "service_account" {
Error: Failed to retrieve project, pid: , err: project: required field is not set
  with module.enrichment.google_project_iam_custom_role.enrichment_project_role,
  on .terraform/modules/enrichment/terraform-gcp-enrichment/service_account.tf line 18, in resource "google_project_iam_custom_role" "enrichment_project_role":
  18: resource "google_project_iam_custom_role" "enrichment_project_role" {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions