Skip to content

Commit 3df010a

Browse files
committed
Addressing pull request feedback.
* Remove the explicit *schema.Schema calls. * Move the SetId out from between the error checking.
1 parent 19206c9 commit 3df010a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

vault/resource_gcp_auth_backend_role.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,37 @@ func gcpAuthBackendRoleResource() *schema.Resource {
2020
Delete: gcpAuthResourceDelete,
2121

2222
Schema: map[string]*schema.Schema{
23-
"role": &schema.Schema{
23+
"role": {
2424
Type: schema.TypeString,
2525
Required: true,
2626
ForceNew: true,
2727
},
28-
"type": &schema.Schema{
28+
"type": {
2929
Type: schema.TypeString,
3030
Required: true,
3131
ForceNew: true,
3232
},
33-
"project_id": &schema.Schema{
33+
"project_id": {
3434
Type: schema.TypeString,
3535
Required: true,
3636
ForceNew: true,
3737
},
38-
"ttl": &schema.Schema{
38+
"ttl": {
3939
Type: schema.TypeString,
4040
Optional: true,
4141
Computed: true,
4242
},
43-
"max_ttl": &schema.Schema{
43+
"max_ttl": {
4444
Type: schema.TypeString,
4545
Optional: true,
4646
Computed: true,
4747
},
48-
"period": &schema.Schema{
48+
"period": {
4949
Type: schema.TypeString,
5050
Optional: true,
5151
Computed: true,
5252
},
53-
"policies": &schema.Schema{
53+
"policies": {
5454
Type: schema.TypeSet,
5555
Elem: &schema.Schema{
5656
Type: schema.TypeString,
@@ -122,8 +122,8 @@ func gcpAuthResourceWrite(d *schema.ResourceData, meta interface{}) error {
122122
}
123123

124124
log.Printf("[DEBUG] Writing role %q to GCP auth backend", path)
125-
_, err := client.Logical().Write(path, data)
126125
d.SetId(path)
126+
_, err := client.Logical().Write(path, data)
127127
if err != nil {
128128
d.SetId("")
129129
return fmt.Errorf("Error writing GCP auth role %q: %s", path, err)

0 commit comments

Comments
 (0)