Skip to content

Commit

Permalink
correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien GLON committed Oct 24, 2017
1 parent 0a7181f commit ff08fe3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions google/resource_google_service_account_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,10 @@ func resourceGoogleServiceAccountKeyCreate(d *schema.ResourceData, meta interfac
serviceAccount := d.Get("service_account_id").(string)

r := &iam.CreateServiceAccountKeyRequest{
KeyAlgorithm: d.Get("key_algorithm").(string),
KeyAlgorithm: d.Get("key_algorithm").(string),
PrivateKeyType: d.Get("private_key_type").(string),
}

var err error

r.PrivateKeyType = d.Get("private_key_type").(string)

sak, err := config.clientIAM.Projects.ServiceAccounts.Keys.Create(serviceAccount, r).Do()
if err != nil {
return fmt.Errorf("Error creating service account key: %s", err)
Expand Down
4 changes: 3 additions & 1 deletion google/resource_google_service_account_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

// Test that a service account key can be created and destroyed
func TestAccGoogleServiceAccountKey_basic(t *testing.T) {
t.Parallel()
resourceName := "google_service_account_key.acceptance"
accountID := "a" + acctest.RandString(10)
displayName := "Terraform Test"
Expand All @@ -33,6 +34,7 @@ func TestAccGoogleServiceAccountKey_basic(t *testing.T) {
}

func TestAccGoogleServiceAccountKey_pgp(t *testing.T) {
t.Parallel()
resourceName := "google_service_account_key.acceptance"
accountID := "a" + acctest.RandString(10)
displayName := "Terraform Test"
Expand Down Expand Up @@ -101,7 +103,7 @@ resource "google_service_account_key" "acceptance" {
public_key_type = "TYPE_X509_PEM_FILE"
pgp_key = <<EOF
%s
EOF
EOF
}
`, account, name, key)
}
Expand Down

0 comments on commit ff08fe3

Please sign in to comment.