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

While adding additional components(Ranger and Solr) to the main.tf, Its throwing an error "Unsupported block type" #7912

Closed
makkena-snps opened this issue Dec 1, 2020 · 5 comments
Assignees
Labels
bug forward/review In review; remove label to forward service/dataproc

Comments

@makkena-snps
Copy link

makkena-snps commented Dec 1, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

terraform_0.12.24

Affected Resource(s)

_resource "google_dataproc_cluster" "kb-iscan-env-ranger" {
provider = google-beta
name = "kb-iscan-env-ranger"
region = "us-central1"

 software_config {
  optional_components = [ "RANGER", "SOLR" ]_

Terraform Configuration Files

# Copy-paste your Terraform configurations here.


provider "google" {
  project = var.project_id
  region  = var.region
}

provider "google-beta" {
  project = var.project_id
  region  = var.region
}

terraform {
 backend "gcs" {
   bucket  = "dev_tf_state"
   prefix  = "kb-iscan-env-ranger"
 }
}

resource "random_id" "random" {
  byte_length = 2
}


resource "google_dataproc_cluster" "kb-iscan-env-ranger" {
    name       = "kb-iscan-env-ranger"
    region     = "us-central1"

     software_config {
      optional_components = ["RANGER", "SOLR"]
   }

}
////////////////////////////////////////////////////////////////////////////////
//  GCS Bucket(s)
////////////////////////////////////////////////////////////////////////////////

module "kb-iscan-gcs-hive-meta" {
  source = "../../../modules/gcs/hive-meta"

  // GCS Settings
  project       = var.project_id
  key           = "env-ranger"
  storage_class = "REGIONAL"
  location      = "US-CENTRAL1"
}

module "kb-iscan-gcs-general" {

  source = "../../../modules/gcs/general"

  // GCS Settings
  project          = var.project_id
  key              = "env-ranger"
  storage_class    = "REGIONAL"
  location         = "US-CENTRAL1"
}


////////////////////////////////////////////////////////////////////////////////
//  Dataproc Cluster(s)
////////////////////////////////////////////////////////////////////////////////

module "dataproc_kb_iscan" {
source = "../../../modules/dataproc/iscan-shared"

  // Global Settings
  project    = var.project_id
  stage      = var.stage
  region     = var.region
  zone       = var.zone
  vpc        = var.vpc
  subnetwork = var.subnetwork

  // Cluster Settings
  key = "env-ranger"
  general_key = "01"
  general_bucket = "XXXXXXXXX"


  // KMS Settings
  kms_key_ring = "iscan-key-ring"
  kms_key = "iscan-crypto-key"



 }

Debug Output

Error: Argument or block definition required

on main.tf line 31:
31: }

An argument or block definition is required here.

makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 plan

Error: Unsupported block type

on main.tf line 27, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":
27: software_config {

Blocks of type "software_config" are not expected here.

makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 plan

Error: Argument or block definition required

on main.tf line 92, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":

An argument or block definition is required here.

makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 plan

Error: Unsupported block type

on main.tf line 27, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":
27: software_config {

Blocks of type "software_config" are not expected here.

makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 plan

Error: Unsupported block type

on main.tf line 27, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":
27: software_config {

Blocks of type "software_config" are not expected here.

makkena@makkena-mac iscan-env-ranger % vi main.tf
makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 validate

Error: Argument or block definition required

on main.tf line 91, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":

 software_config {
  optional_components = [ "RANGER", "SOLR" ]

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@ghost ghost added the bug label Dec 1, 2020
@venkykuberan venkykuberan self-assigned this Dec 1, 2020
@venkykuberan
Copy link
Contributor

Placing software_config under cluster_config block should work as expected.

doc

The cluster_config block supports:

    cluster_config {
        gce_cluster_config        { ... }
        master_config             { ... }
        worker_config             { ... }
        preemptible_worker_config { ... }
        software_config           { ... }

        # You can define multiple initialization_action blocks
        initialization_action     { ... }
        encryption_config         { ... }
        endpoint_config           { ... }
    }

@makkena-snps
Copy link
Author

makkena-snps commented Dec 1, 2020 via email

@ghost ghost removed waiting-response labels Dec 1, 2020
@makkena-snps
Copy link
Author

Hi Venky, Thanks for your quick reply..!

As you recommended, I've applied the changes and ran the Terraform init, validate and plan. Below are the outputs,

Changes I've made:

resource "google_dataproc_cluster" "kb-iscan-env-ranger" {
provider = google-beta
name = "kb-iscan-env-ranger"
region = "us-central1"

cluster_config {
software_config {
optional_components = ["RANGER", "SOLR"]

}
}


**makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 init
There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.

Error: Argument or block definition required

on main.tf line 91, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":

An argument or block definition is required here.**


makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 validate

Error: Argument or block definition required

on main.tf line 91, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":

An argument or block definition is required here.


makkena@makkena-mac iscan-env-ranger % terraform_0.12.24 plan

Error: Argument or block definition required

on main.tf line 91, in resource "google_dataproc_cluster" "kb-iscan-env-ranger":

An argument or block definition is required here.

@venkykuberan
Copy link
Contributor

venkykuberan commented Dec 3, 2020

Curly brackets aren't matching, add } at the end of the config. Also looks like RANGER property values requires you to pre-set other attributes. Yoo need to refer API doc for more info

    - Component RANGER requires that property 'dataproc:ranger.admin.password.uri' is set
    - Component RANGER requires that property 'dataproc:ranger.kms.key.uri' is set

@ghost
Copy link

ghost commented Jan 3, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Jan 3, 2021
@github-actions github-actions bot added service/dataproc forward/review In review; remove label to forward labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug forward/review In review; remove label to forward service/dataproc
Projects
None yet
Development

No branches or pull requests

2 participants