Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAD Lab Module to create GCP Projects with Billing budgets #58

Merged
merged 3 commits into from
May 17, 2022

Conversation

guptamukul-google
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

Terraform Plan FAILED for: modules/billing_budget !

@guptamukul-google
Copy link
Collaborator Author

I can confirm that the terraform plan is Successful. The terraform plan GitHub action is failing because there were 2 commits to this PR and the 2nd commit didn't had any .tf files specific to the module.

Thus we can ignore github-action failed comment.

% terraform plan     

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create
 <= read (data resources)

Terraform will perform the following actions:

  # google_project_iam_member.user_role_assignment["user:myuser@mydomain.com"] will be created
  + resource "google_project_iam_member" "user_role_assignment" {
      + etag    = (known after apply)
      + id      = (known after apply)
      + member  = "user:myuser@mydomain.com"
      + project = (known after apply)
      + role    = "roles/editor"
    }

  # google_project_service.enabled_services["bigquery.googleapis.com"] will be created
  + resource "google_project_service" "enabled_services" {
      + disable_dependent_services = true
      + disable_on_destroy         = true
      + id                         = (known after apply)
      + project                    = (known after apply)
      + service                    = "bigquery.googleapis.com"
    }

  # google_project_service.enabled_services["bigquerystorage.googleapis.com"] will be created
  + resource "google_project_service" "enabled_services" {
      + disable_dependent_services = true
      + disable_on_destroy         = true
      + id                         = (known after apply)
      + project                    = (known after apply)
      + service                    = "bigquerystorage.googleapis.com"
    }

  # google_project_service.enabled_services["compute.googleapis.com"] will be created
  + resource "google_project_service" "enabled_services" {
      + disable_dependent_services = true
      + disable_on_destroy         = true
      + id                         = (known after apply)
      + project                    = (known after apply)
      + service                    = "compute.googleapis.com"
    }

  # random_id.default will be created
  + resource "random_id" "default" {
      + b64_std     = (known after apply)
      + b64_url     = (known after apply)
      + byte_length = 2
      + dec         = (known after apply)
      + hex         = (known after apply)
      + id          = (known after apply)
    }

  # time_sleep.wait_120_seconds[0] will be created
  + resource "time_sleep" "wait_120_seconds" {
      + create_duration = "120s"
      + id              = (known after apply)
    }

  # module.billing_budget.data.google_project.project[0] will be read during apply
  # (config refers to values not yet known)
 <= data "google_project" "project"  {
      + auto_create_network = (known after apply)
      + billing_account     = (known after apply)
      + folder_id           = (known after apply)
      + id                  = (known after apply)
      + labels              = (known after apply)
      + name                = (known after apply)
      + number              = (known after apply)
      + org_id              = (known after apply)
      + project_id          = (known after apply)
      + skip_delete         = (known after apply)
    }

  # module.billing_budget.google_billing_budget.budget[0] will be created
  + resource "google_billing_budget" "budget" {
      + billing_account = "<REDACTED>"
      + display_name    = (known after apply)
      + id              = (known after apply)
      + name            = (known after apply)

      + amount {
          + specified_amount {
              + currency_code = (known after apply)
              + units         = "1000"
            }
        }

      + budget_filter {
          + credit_types           = (known after apply)
          + credit_types_treatment = "INCLUDE_ALL_CREDITS"
          + labels                 = (known after apply)
          + projects               = (known after apply)
          + services               = (known after apply)
          + subaccounts            = (known after apply)
        }

      + threshold_rules {
          + spend_basis       = "CURRENT_SPEND"
          + threshold_percent = 0.5
        }
      + threshold_rules {
          + spend_basis       = "CURRENT_SPEND"
          + threshold_percent = 0.7
        }
      + threshold_rules {
          + spend_basis       = "CURRENT_SPEND"
          + threshold_percent = 1
        }
    }

  # module.project_radlab_billing_budget[0].module.budget.data.google_project.project[0] will be read during apply
  # (config refers to values not yet known)
 <= data "google_project" "project"  {
      + auto_create_network = (known after apply)
      + billing_account     = (known after apply)
      + folder_id           = (known after apply)
      + id                  = (known after apply)
      + labels              = (known after apply)
      + name                = (known after apply)
      + number              = (known after apply)
      + org_id              = (known after apply)
      + project_id          = (known after apply)
      + skip_delete         = (known after apply)
    }

  # module.project_radlab_billing_budget[0].module.project-factory.google_project.main will be created
  + resource "google_project" "main" {
      + auto_create_network = false
      + billing_account     = "<REDACTED>"
      + id                  = (known after apply)
      + name                = (known after apply)
      + number              = (known after apply)
      + org_id              = "<REDACTED>"
      + project_id          = (known after apply)
      + skip_delete         = (known after apply)
    }

  # module.project_radlab_billing_budget[0].module.project-factory.google_project_default_service_accounts.default_service_accounts[0] will be created
  + resource "google_project_default_service_accounts" "default_service_accounts" {
      + action           = "DISABLE"
      + id               = (known after apply)
      + project          = (known after apply)
      + restore_policy   = "REVERT_AND_IGNORE_FAILURE"
      + service_accounts = (known after apply)
    }

  # module.project_radlab_billing_budget[0].module.project-factory.google_service_account.default_service_account[0] will be created
  + resource "google_service_account" "default_service_account" {
      + account_id   = "project-service-account"
      + disabled     = false
      + display_name = (known after apply)
      + email        = (known after apply)
      + id           = (known after apply)
      + name         = (known after apply)
      + project      = (known after apply)
      + unique_id    = (known after apply)
    }

  # module.project_radlab_billing_budget[0].module.project-factory.random_id.random_project_id_suffix will be created
  + resource "random_id" "random_project_id_suffix" {
      + b64_std     = (known after apply)
      + b64_url     = (known after apply)
      + byte_length = 2
      + dec         = (known after apply)
      + hex         = (known after apply)
      + id          = (known after apply)
    }

Plan: 11 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + billing_budget_budgetId          = (known after apply)
  + deployment_id                    = (known after apply)
  + project-radlab-billing-budget-id = (known after apply)

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
% 

@github-actions
Copy link
Contributor

Thank you for raising the request! RAD Lab admins have been notified.

@github-actions
Copy link
Contributor

Apache 2.0 License check successful!

default = null
}

variable "sa" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to something more meaningful? resource_creator_identity or something?

@debakkerb debakkerb merged commit 1fa93ee into main May 17, 2022
@debakkerb debakkerb deleted the billing-budget-alert branch May 17, 2022 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants