An argument named versioning is not expected here Did you mean to define a block of type versioning

0 votes

Hi Guys,

I am trying to create a GCS bucket using Terraform. But it is showing me the below error.

An argument named "versioning" is not expected here. Did you mean to define a block of type "versioning"?
Dec 1, 2020 in Terraform by akhtar
• 38,210 points
840 views

1 answer to this question.

0 votes

Hi@akhtar,

The error is telling that you need to enable versioning in the bucket. You can see the below example.

resource "google_storage_bucket" "foo" {
    ...
    versioning {
      enabled = true
    }
}
answered Dec 1, 2020 by MD
• 95,320 points

Related Questions In Terraform

0 votes
1 answer

'terraform' is not recognized as an internal or external command, operable program or batch file.

Hi@akhtar, You have to set an environment variable ...READ MORE

answered Jun 10, 2020 in Terraform by MD
• 95,320 points
6,907 views
0 votes
1 answer
0 votes
1 answer

Error:No credentials loaded. To use your gcloud credentials, run 'gcloud auth application-default login'.

Hi@akhtar, You are trying to connect the GCP ...READ MORE

answered Sep 12, 2020 in Terraform by MD
• 95,320 points
2,196 views
0 votes
1 answer

How to use GCP provider in Terraform?

Hi@akhtar, Terraform supports many providers to deploy the ...READ MORE

answered Sep 12, 2020 in Terraform by MD
• 95,320 points
225 views
0 votes
1 answer

How to launch an instance in GCP using Terraform?

Hi@akhtar, You can use the google_compute_instance resource in ...READ MORE

answered Sep 12, 2020 in Terraform by MD
• 95,320 points
200 views
0 votes
1 answer