@@ -2,12 +2,13 @@ package google
2
2
3
3
import (
4
4
"fmt"
5
+ "strconv"
6
+ "testing"
7
+
5
8
"github.com/hashicorp/terraform/helper/acctest"
6
9
"github.com/hashicorp/terraform/helper/resource"
7
10
"github.com/hashicorp/terraform/terraform"
8
11
"google.golang.org/api/logging/v2"
9
- "strconv"
10
- "testing"
11
12
)
12
13
13
14
func TestAccLoggingProjectSink_basic (t * testing.T ) {
@@ -24,7 +25,7 @@ func TestAccLoggingProjectSink_basic(t *testing.T) {
24
25
CheckDestroy : testAccCheckLoggingProjectSinkDestroy ,
25
26
Steps : []resource.TestStep {
26
27
{
27
- Config : testAccLoggingProjectSink_basic (sinkName , bucketName ),
28
+ Config : testAccLoggingProjectSink_basic (sinkName , getTestProjectFromEnv (), bucketName ),
28
29
Check : resource .ComposeTestCheckFunc (
29
30
testAccCheckLoggingProjectSinkExists ("google_logging_project_sink.basic" , & sink ),
30
31
testAccCheckLoggingProjectSink (& sink , "google_logging_project_sink.basic" ),
@@ -165,18 +166,19 @@ func testAccCheckLoggingProjectSink(sink *logging.LogSink, n string) resource.Te
165
166
}
166
167
}
167
168
168
- func testAccLoggingProjectSink_basic (name , bucketName string ) string {
169
+ func testAccLoggingProjectSink_basic (name , project , bucketName string ) string {
169
170
return fmt .Sprintf (`
170
171
resource "google_logging_project_sink" "basic" {
171
172
name = "%s"
173
+ project = "%s"
172
174
destination = "storage.googleapis.com/${google_storage_bucket.log-bucket.name}"
173
175
filter = "logName=\"projects/%s/logs/compute.googleapis.com%%2Factivity_log\" AND severity>=ERROR"
174
176
unique_writer_identity = false
175
177
}
176
178
177
179
resource "google_storage_bucket" "log-bucket" {
178
180
name = "%s"
179
- }` , name , getTestProjectFromEnv () , bucketName )
181
+ }` , name , project , project , bucketName )
180
182
}
181
183
182
184
func testAccLoggingProjectSink_uniqueWriter (name , bucketName string ) string {
0 commit comments