# Terraform plan hung while executing Google App Engine Resource

**URL:** <https://discuss.hashicorp.com/t/terraform-plan-hung-while-executing-google-app-engine-resource/11342>\
**Category:** Google\
**Created:** [July 11, 2020, 4:23pm UTC](https://discuss.hashicorp.com/t/terraform-plan-hung-while-executing-google-app-engine-resource/11342 "2020-07-11T16:23:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![queszama](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/queszama/32/9291_2.png) [@queszama](https://discuss.hashicorp.com/u/queszama)\
**Post date:** [July 11, 2020, 4:23pm UTC](https://discuss.hashicorp.com/t/terraform-plan-hung-while-executing-google-app-engine-resource/11342/1 "2020-07-11T16:23:04Z")

</div>

I am using `terraform` to import the state of existing `GCP App Engine Resource` so that the resource can be later managed with `terraform`

I imported using below command

```auto
  terraform import google_app_engine_standard_app_version.default <project>/default/20200711t113242

```

After that I executed `terraform show` to identify the state of existing resources and copy pasted the output of it to `main.tf` file and added the `deployment` section which was missing in the state information from `terraform state`  
Now when I executed `terraform show`, it was showing error for missing `deployment` attribute . The app engine app was deployed using the sample GCP code from `Github` repo from the below URL  
“[https://github.com/GoogleCloudPlatform/php-docs-samples.git](https://github.com/GoogleCloudPlatform/php-docs-samples.git)” .

My overall main.tf looks like this

```
    resource "google_app_engine_standard_app_version" "default" {
delete_service_on_destroy = false
inbound_services = []
instance_class = "F1"
noop_on_destroy = false
project = "<project-d>"
runtime = "php72"
service = "default"

 deployment {
files {
  name = "test"
  source_url = "https://github.com/GoogleCloudPlatform/php-docs-samples.git"
}

```

}

```
handlers {
    auth_fail_action = "AUTH_FAIL_ACTION_REDIRECT"
    login = "LOGIN_OPTIONAL"
    security_level = "SECURE_OPTIONAL"
    url_regex = ".*"

    script {
        script_path = "auto"
    }
}
timeouts {}

```

}

Now when I execute `terraform plan` , it fails with below error

```
   Refreshing Terraform state in-memory prior to plan...
   The refreshed state will be used to calculate this plan, but will not be
   persisted to local or remote state storage.`

google_app_engine_standard_app_version.default: Refreshing state...    
[id=apps/adminproject-272208/services/default/version/20200711t113242]

```

^CInterrupt received.  
`Please wait for Terraform to exit or data loss may occur. Gracefully shutting down... ^CTwo interrupts received. Exiting immediately. Note that data loss may have occurred. ^C^C^C^C^C^C^C^C^C^C^C^C^C^C Error: operation canceled Error: rpc error: code = Unavailable desc = transport is closing`

1. Please suggest how to resolve the issue ? It seems from the error the code repository is not reachable .
2. Also I would like to change the `label` attribute from the `versions` section under `App Engine` . But I don’t see any argument from the below doc to modify the `label` argument . Also suggest here please.  
[https://www.terraform.io/docs/providers/google/r/app\_engine\_standard\_app\_version.html](https://www.terraform.io/docs/providers/google/r/app_engine_standard_app_version.html)
