Skip to content

Commit

Permalink
Merged in TER-272-tf-provider-handle-description-param (pull request …
Browse files Browse the repository at this point in the history
…#15)

TER-272: Add description parameter

Approved-by: Jérôme Respaut <[email protected]>
Approved-by: Jordan Caussat <[email protected]>
Approved-by: Laurent Piroelle <[email protected]>
Approved-by: Patrick Decat <[email protected]>
Approved-by: Burak Karamahmut <[email protected]>
  • Loading branch information
Jordan Caussat authored and Shr3ps committed May 14, 2018
2 parents fb153e0 + d8c5adf commit 7337826
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
6 changes: 6 additions & 0 deletions ghost/resource_ghost_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func resourceGhostApp() *schema.Resource {
ForceNew: true,
ValidateFunc: MatchesRegexp(`^[a-z0-9\-\_]*$`),
},
"description": {
Type: schema.TypeString,
Optional: true,
},
"region": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -547,6 +551,7 @@ func expandGhostApp(d *schema.ResourceData) ghost.App {
Name: d.Get("name").(string),
Env: d.Get("env").(string),
Role: d.Get("role").(string),
Description: d.Get("description").(string),
Region: d.Get("region").(string),
InstanceType: d.Get("instance_type").(string),
VpcID: d.Get("vpc_id").(string),
Expand All @@ -570,6 +575,7 @@ func flattenGhostApp(d *schema.ResourceData, app ghost.App) error {
d.Set("name", app.Name)
d.Set("env", app.Env)
d.Set("role", app.Role)
d.Set("description", app.Description)
d.Set("region", app.Region)
d.Set("instance_type", app.InstanceType)
d.Set("vpc_id", app.VpcID)
Expand Down
20 changes: 11 additions & 9 deletions ghost/resource_ghost_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ func testAccCheckGhostAppDestroy(s *terraform.State) error {
func testAccGhostAppConfig(name string) string {
return fmt.Sprintf(`
resource "ghost_app" "test" {
name = "%s"
env = "dev"
role = "webfront"
name = "%s"
env = "dev"
role = "webfront"
description = "This is a test"
region = "eu-west-1"
instance_type = "t2.micro"
Expand Down Expand Up @@ -181,10 +182,10 @@ func testAccGhostAppConfig(name string) string {
name = "php5"
},
{
version = ""
name = "package"
version = ""
name = "package"
provisioner = "ansible"
parameters = <<JSON
parameters = <<JSON
{
"package_name" : [
"test",
Expand Down Expand Up @@ -274,10 +275,10 @@ func testAccGhostAppConfigUpdated(name string) string {
name = "php5"
},
{
version = ""
name = "package"
version = ""
name = "package"
provisioner = "ansible"
parameters = <<JSON
parameters = <<JSON
{
"package_name" : [
"test2",
Expand Down Expand Up @@ -366,6 +367,7 @@ var (
Name: "app_name",
Env: "test",
Role: "web",
Description: "My app",
Region: "us-west-1",
InstanceType: "t2.micro",
VpcID: "vpc-123456",
Expand Down
7 changes: 4 additions & 3 deletions vendor/cloud-deploy.io/go-st/spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"ignore": "test",
"package": [
{
"checksumSHA1": "1+7geaq6oHievNI7XMK7SNE5rbo=",
"checksumSHA1": "B7yGeS9brb/atzVIEx3v02G0PX0=",
"path": "cloud-deploy.io/go-st",
"revision": "94578fa223acca309d2d2ff98637dff1ff5391a5",
"revisionTime": "2018-04-10T08:10:15Z"
"revision": "031c26acdfeb5d31ce030f7992fa6aac3b84404f",
"revisionTime": "2018-05-07T07:48:28Z"
},
{
"checksumSHA1": "jQh1fnoKPKMURvKkpdRjN695nAQ=",
Expand Down

0 comments on commit 7337826

Please sign in to comment.