# Error while running gloud command

**URL:** <https://discuss.hashicorp.com/t/error-while-running-gloud-command/32871>\
**Category:** Google\
**Created:** [December 8, 2021, 7:33am UTC](https://discuss.hashicorp.com/t/error-while-running-gloud-command/32871 "2021-12-08T07:33:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedome007](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/syedome007/32/24278_2.png) [@syedome007](https://discuss.hashicorp.com/u/syedome007)\
**Post date:** [December 8, 2021, 7:33am UTC](https://discuss.hashicorp.com/t/error-while-running-gloud-command/32871/1 "2021-12-08T07:33:29Z")

</div>

Hi,

I am trying to run gcloud command under null resource.

I am unable to create a resource in gcp using gcloud command in terraform.  
please do the needful.

please find the code and error below  
Thanks & Regards,  
Omer.

TERRAFORM CODE: -

resource “null\_resource” “config” {  
connection {  
type = “ssh”  
host = “10.128.0.38”  
user = var.user  
#private = file("/home/omer\_mohiuddin/vm-manager/modules/id\_rsa")  
}  
provisioner “local-exec” {  
command = \<\<-EOF  
#!/bin/sh  
gcloud compute os-config os-policy-assignments create osii-policy  
–location=us-central1-a --file=/home/omer\_mohiuddin/con.yaml  
–async  
EOF  
}  
}

ERROR:-

Error: local-exec provisioner error  
│  
│ with null\_resource.config,  
│ on main.tf line 109, in resource “null\_resource” “config”:  
│ 109: provisioner “local-exec” {  
│  
│ Error running command ’ #!/bin/sh  
│ gcloud compute os-config os-policy-assignments create osii-policy  
│ --location=us-central1-a --file=/home/omer\_mohiuddin/con.yaml  
│ --async  
│ ': exit status 127. Output: ERROR:  
(gcloud.compute.os-config.os-policy-assignments.create) unrecognized arguments:  
│  
│ To search the help text of gcloud commands, run:  
│ gcloud help – SEARCH\_TERMS  
│ /bin/sh: 3: --location=us-central1-a: not found  
: not found4: --async
