Skip to content

Commit

Permalink
add description field to service_account for Terraform (#1646)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Shinichi TAMURA <shnch.tmr@gmail.com>
  • Loading branch information
2 people authored and Ty Larrabee committed Jan 14, 2020
1 parent 34f20b2 commit fd171d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions google-beta/resource_google_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"google.golang.org/api/iam/v1"
)

Expand Down Expand Up @@ -42,8 +43,9 @@ func resourceGoogleServiceAccount() *schema.Resource {
Optional: true,
},
"description": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringLenBetween(0, 256),
},
"project": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion google-beta/resource_google_service_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAccServiceAccount_basic(t *testing.T) {
displayName := "Terraform Test"
displayName2 := "Terraform Test Update"
desc := "test description"
desc2 := "test description update"
desc2 := ""
project := getTestProjectFromEnv()
expectedEmail := fmt.Sprintf("%s@%s.iam.gserviceaccount.com", accountId, project)
resource.Test(t, resource.TestCase{
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/google_service_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The following arguments are supported:
Can be updated without creating a new resource.

* `description` - (Optional) A text description of the service account.
Must be less than or equal to 256 UTF-8 bytes.

* `project` - (Optional) The ID of the project that the service account will be created in.
Defaults to the provider project configuration.
Expand Down

0 comments on commit fd171d2

Please sign in to comment.