@@ -59,18 +59,27 @@ func TestAccLoggingOrganizationSink_update(t *testing.T) {
5959 CheckDestroy : testAccCheckLoggingOrganizationSinkDestroyProducer (t ),
6060 Steps : []resource.TestStep {
6161 {
62- Config : testAccLoggingOrganizationSink_update (sinkName , bucketName , org ),
62+ Config : testAccLoggingOrganizationSink_update (sinkName , bucketName , org , "false" ),
6363 Check : resource .ComposeTestCheckFunc (
6464 testAccCheckLoggingOrganizationSinkExists (t , "google_logging_organization_sink.update" , & sinkBefore ),
6565 testAccCheckLoggingOrganizationSink (& sinkBefore , "google_logging_organization_sink.update" ),
6666 ),
67- }, {
68- Config : testAccLoggingOrganizationSink_update (sinkName , updatedBucketName , org ),
67+ },
68+ {
69+ Config : testAccLoggingOrganizationSink_update (sinkName , updatedBucketName , org , "true" ),
6970 Check : resource .ComposeTestCheckFunc (
7071 testAccCheckLoggingOrganizationSinkExists (t , "google_logging_organization_sink.update" , & sinkAfter ),
7172 testAccCheckLoggingOrganizationSink (& sinkAfter , "google_logging_organization_sink.update" ),
7273 ),
73- }, {
74+ },
75+ {
76+ Config : testAccLoggingOrganizationSink_update (sinkName , bucketName , org , "false" ),
77+ Check : resource .ComposeTestCheckFunc (
78+ testAccCheckLoggingOrganizationSinkExists (t , "google_logging_organization_sink.update" , & sinkBefore ),
79+ testAccCheckLoggingOrganizationSink (& sinkBefore , "google_logging_organization_sink.update" ),
80+ ),
81+ },
82+ {
7483 ResourceName : "google_logging_organization_sink.update" ,
7584 ImportState : true ,
7685 ImportStateVerify : true ,
@@ -327,21 +336,21 @@ resource "google_storage_bucket" "log-bucket" {
327336` , sinkName , orgId , envvar .GetTestProjectFromEnv (), bucketName )
328337}
329338
330- func testAccLoggingOrganizationSink_update (sinkName , bucketName , orgId string ) string {
339+ func testAccLoggingOrganizationSink_update (sinkName , bucketName , orgId , includeChildren string ) string {
331340 return fmt .Sprintf (`
332341resource "google_logging_organization_sink" "update" {
333342 name = "%s"
334343 org_id = "%s"
335344 destination = "storage.googleapis.com/${google_storage_bucket.log-bucket.name}"
336345 filter = "logName=\"projects/%s/logs/compute.googleapis.com%%2Factivity_log\" AND severity>=ERROR"
337- include_children = false
346+ include_children = %s
338347}
339348
340349resource "google_storage_bucket" "log-bucket" {
341350 name = "%s"
342351 location = "US"
343352}
344- ` , sinkName , orgId , envvar .GetTestProjectFromEnv (), bucketName )
353+ ` , sinkName , orgId , envvar .GetTestProjectFromEnv (), includeChildren , bucketName )
345354}
346355
347356func testAccLoggingOrganizationSink_described (sinkName , bucketName , orgId string ) string {
0 commit comments