Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TTL field #2318

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions vault/resource_gcp_secret_impersonated_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ func gcpSecretImpersonatedAccountResource() *schema.Resource {
Computed: true,
Description: "Project of the GCP Service Account managed by this impersonated account",
},
consts.FieldTTL: {
Gaardsholt marked this conversation as resolved.
Show resolved Hide resolved
Type: schema.TypeString,
Optional: true,
ForceNew: false,
Gaardsholt marked this conversation as resolved.
Show resolved Hide resolved
Description: "Time to live.",
},
},
}
}
Expand Down Expand Up @@ -200,6 +206,10 @@ func gcpSecretImpersonatedAccountUpdateFields(d *schema.ResourceData, data map[s
if v, ok := d.GetOk(consts.FieldTokenScopes); ok {
data[consts.FieldTokenScopes] = v.(*schema.Set).List()
}

if v, ok := d.GetOk(consts.FieldTTL); ok {
Gaardsholt marked this conversation as resolved.
Show resolved Hide resolved
data[consts.FieldTTL] = v.(string)
}
}

func gcpSecretImpersonatedAccountPath(backend, impersonatedAccount string) string {
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/gcp_secret_impersonated_account.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ The following arguments are supported:

* `token_scopes` - (Required) List of OAuth scopes to assign to access tokens generated under this impersonated account.

* `ttl` - (Optional) Specifies the default TTL for service principals generated using this role.
Accepts time suffixed strings ("1h") or an integer number of seconds. Defaults to the system/engine default TTL time.

## Attributes Reference

In addition to the fields above, the following attributes are also exposed:
Expand Down
Loading