Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 41 additions & 23 deletions scaleway/resource_object_bucket_acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,30 @@ func TestAccScalewayObjectBucketACL_Grantee(t *testing.T) {
resource "scaleway_object_bucket_acl" "main" {
bucket = scaleway_object_bucket.main.name
access_control_policy {
grant {
grantee {
id = "%[2]s"
type = "CanonicalUser"
}
permission = "FULL_CONTROL"
}
grant {
grantee {
id = "%[2]s"
type = "CanonicalUser"
}
permission = "FULL_CONTROL"
}

grant {
grantee {
id = "%[2]s"
type = "CanonicalUser"
}
permission = "WRITE"
}
grant {
grantee {
id = "%[2]s"
type = "CanonicalUser"
}
permission = "WRITE"
}

owner {
id = "%[2]s"
}
owner {
id = "%[2]s"
}
}
}
`, testBucketName, ownerID),
Check: resource.ComposeTestCheckFunc(
testAccCheckScalewayObjectBucketExists(tt, "scaleway_object_bucket.main"),
resource.TestCheckResourceAttr("scaleway_object_bucket_acl.main", "bucket", testBucketName),
),
},
Expand All @@ -114,21 +115,38 @@ func TestAccScalewayObjectBucketACL_Grantee(t *testing.T) {
resource "scaleway_object_bucket_acl" "main" {
bucket = scaleway_object_bucket.main.name
access_control_policy {
grant {
grantee {
id = "%[2]s"
type = "CanonicalUser"
}
permission = "FULL_CONTROL"
}

grant {
grantee {
id = "%[2]s"
type = "CanonicalUser"
}
permission = "WRITE"
}

grant {
grantee {
id = "%[3]s"
type = "CanonicalUser"
id = "%[3]s"
type = "CanonicalUser"
}
permission = "FULL_CONTROL"
}

owner {
owner {
id = "%[2]s"
}
}
}
}
}
`, testBucketName, ownerID, ownerIDChild),
`, testBucketName, ownerID, ownerIDChild),
Check: resource.ComposeTestCheckFunc(
testAccCheckScalewayObjectBucketExists(tt, "scaleway_object_bucket.main"),
resource.TestCheckResourceAttr("scaleway_object_bucket_acl.main", "bucket", testBucketName),
),
},
Expand Down
Loading