Skip to content

Commit

Permalink
add composer test fixes, backend bucket signed url key (#2631)
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick authored Nov 8, 2019
1 parent 06ae8e4 commit a14f2b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func resourceComposerEnvironmentCreate(d *schema.ResourceData, meta interface{})
}

// Store the ID now
id, err := replaceVars(d, config, "{{project}}/{{region}}/{{name}}")
id, err := replaceVars(d, config, "projects/{{project}}/locations/{{region}}/environments/{{name}}")
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ func testAccComposerEnvironmentDestroy(s *terraform.State) error {
}

idTokens := strings.Split(rs.Primary.ID, "/")
if len(idTokens) != 3 {
return fmt.Errorf("Invalid ID %q, expected format {project}/{region}/{environment}", rs.Primary.ID)
if len(idTokens) != 6 {
return fmt.Errorf("Invalid ID %q, expected format projects/{project}/regions/{region}/environments/{environment}", rs.Primary.ID)
}
envName := &composerEnvironmentName{
Project: idTokens[0],
Region: idTokens[1],
Environment: idTokens[2],
Project: idTokens[1],
Region: idTokens[3],
Environment: idTokens[5],
}

_, err := config.clientComposer.Projects.Locations.Environments.Get(envName.resourceName()).Do()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func checkComputeBackendBucketSignedUrlKeyExists(s *terraform.State) (bool, erro
}

config := testAccProvider.Meta().(*Config)
keyName := rs.Primary.ID
keyName := rs.Primary.Attributes["name"]

url, err := replaceVarsForTest(config, rs, "{{ComputeBasePath}}projects/{{project}}/global/backendBuckets/{{backend_bucket}}")
if err != nil {
Expand Down

0 comments on commit a14f2b6

Please sign in to comment.