-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Resource: Stack Driver Group (#895)
Merged PR #895.
- Loading branch information
1 parent
dea946a
commit 4585729
Showing
7 changed files
with
86 additions
and
41 deletions.
There are no files selected for viewing
Submodule terraform
updated
from 8e3c39 to ca26d3
Submodule terraform-beta
updated
from 1ce966 to ecaaf4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resource "google_monitoring_group" "<%= ctx[:primary_resource_id] %>" { | ||
display_name = "<%= ctx[:vars]["display_name"] %>" | ||
|
||
filter = "resource.metadata.region=\"europe-west2\"" | ||
} |
10 changes: 10 additions & 0 deletions
10
templates/terraform/examples/monitoring_group_subgroup.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resource "google_monitoring_group" "parent" { | ||
display_name = "<%= ctx[:vars]["display_name"] %>" | ||
filter = "resource.metadata.region=\"europe-west2\"" | ||
} | ||
|
||
resource "google_monitoring_group" "<%= ctx[:primary_resource_id] %>" { | ||
display_name = "<%= ctx[:vars]["display_name"] %>" | ||
filter = "resource.metadata.region=\"europe-west2\"" | ||
parent_name = "${google_monitoring_group.parent.name}" | ||
} |
47 changes: 47 additions & 0 deletions
47
third_party/terraform/tests/resource_monitoring_group_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package google | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccMonitoringGroup_update(t *testing.T) { | ||
t.Parallel() | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testAccCheckMonitoringGroupDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccMonitoringGroup_update("europe-west1"), | ||
}, | ||
{ | ||
ResourceName: "google_monitoring_group.update", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
{ | ||
Config: testAccMonitoringGroup_update("europe-west2"), | ||
}, | ||
{ | ||
ResourceName: "google_monitoring_group.update", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccMonitoringGroup_update(zone string) string { | ||
return fmt.Sprintf(` | ||
resource "google_monitoring_group" "update" { | ||
display_name = "Integration Test Group" | ||
filter = "resource.metadata.region=\"%s\"" | ||
} | ||
`, zone, | ||
) | ||
} |