Skip to content

Commit 492d99f

Browse files
modular-magicianEdward Sun
andauthored
fix issue #6436 (#3550) (#2102)
Co-authored-by: Edward Sun <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Edward Sun <[email protected]>
1 parent e8bc7a2 commit 492d99f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.changelog/3550.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_spanner_database.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func resourceSpannerDatabaseCreate(d *schema.ResourceData, meta interface{}) err
125125
}
126126

127127
// Store the ID now
128-
id, err := replaceVars(d, config, "projects/{{project}}/instances/{{instance}}/databases/{{name}}")
128+
id, err := replaceVars(d, config, "{{instance}}/{{name}}")
129129
if err != nil {
130130
return fmt.Errorf("Error constructing id: %s", err)
131131
}
@@ -156,7 +156,7 @@ func resourceSpannerDatabaseCreate(d *schema.ResourceData, meta interface{}) err
156156
}
157157

158158
// This may have caused the ID to update - update it if so.
159-
id, err = replaceVars(d, config, "projects/{{project}}/instances/{{instance}}/databases/{{name}}")
159+
id, err = replaceVars(d, config, "{{instance}}/{{name}}")
160160
if err != nil {
161161
return fmt.Errorf("Error constructing id: %s", err)
162162
}
@@ -250,7 +250,7 @@ func resourceSpannerDatabaseImport(d *schema.ResourceData, meta interface{}) ([]
250250
}
251251

252252
// Replace import id for the resource id
253-
id, err := replaceVars(d, config, "projects/{{project}}/instances/{{instance}}/databases/{{name}}")
253+
id, err := replaceVars(d, config, "{{instance}}/{{name}}")
254254
if err != nil {
255255
return nil, fmt.Errorf("Error constructing id: %s", err)
256256
}

website/docs/r/spanner_database.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The following arguments are supported:
8888

8989
In addition to the arguments listed above, the following computed attributes are exported:
9090

91-
* `id` - an identifier for the resource with format `projects/{{project}}/instances/{{instance}}/databases/{{name}}`
91+
* `id` - an identifier for the resource with format `{{instance}}/{{name}}`
9292

9393
* `state` -
9494
An explanation of the status of the database.

0 commit comments

Comments
 (0)