Skip to content

Commit

Permalink
Merged in TER-248_enable-imports-for-ghost-apps (pull request #5)
Browse files Browse the repository at this point in the history
TER-248 enable imports for ghost apps

Approved-by: Patrick Decat <[email protected]>
Approved-by: Jordan Caussat <[email protected]>
Approved-by: Jérôme Respaut <[email protected]>
  • Loading branch information
Jordan Caussat authored and Shr3ps committed Mar 30, 2018
2 parents d7bb31a + b6c64b1 commit 80fc4a7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
29 changes: 29 additions & 0 deletions ghost/import_ghost_app_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package ghost

import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGhostAppImportBasic(t *testing.T) {
envName := fmt.Sprintf("import_ghost_app_acc_env_basic_%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGhostAppConfig(envName),
},

resource.TestStep{
ResourceName: "ghost_app.test",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
12 changes: 12 additions & 0 deletions ghost/resource_ghost_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"log"
"time"

"cloud-deploy.io/go-st"
"github.com/hashicorp/terraform/helper/schema"
Expand All @@ -17,6 +18,17 @@ func resourceGhostApp() *schema.Resource {
Update: resourceGhostAppUpdate,
Delete: resourceGhostAppDelete,

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(1 * time.Minute),
Read: schema.DefaultTimeout(1 * time.Minute),
Update: schema.DefaultTimeout(1 * time.Minute),
Delete: schema.DefaultTimeout(1 * time.Minute),
},

Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Expand Down

0 comments on commit 80fc4a7

Please sign in to comment.