Skip to content

Commit

Permalink
Fix: support importing monitor_v2 and monitor_v2_action resources (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
obs-gh-abhinavpappu authored Aug 22, 2024
1 parent 3499412 commit 13f2656
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/resources/monitor_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,4 +480,8 @@ Required:
Optional:

- `path` (String) The path of the path, if the name refers to a column with a JSON object.

## Import
Import is supported using the following syntax:
```shell
terraform import observe_monitor_v2.example 1414010
```
6 changes: 5 additions & 1 deletion docs/resources/monitor_v2_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ Required:

- `header` (String)
- `value` (String)

## Import
Import is supported using the following syntax:
```shell
terraform import observe_monitor_v2_action.example 1414010
```
1 change: 1 addition & 0 deletions examples/resources/observe_monitor_v2/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import observe_monitor_v2.example 1414010
1 change: 1 addition & 0 deletions examples/resources/observe_monitor_v2_action/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import observe_monitor_v2_action.example 1414010
3 changes: 3 additions & 0 deletions observe/resource_monitor_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func resourceMonitorV2() *schema.Resource {
ReadContext: resourceMonitorV2Read,
UpdateContext: resourceMonitorV2Update,
DeleteContext: resourceMonitorV2Delete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Schema: map[string]*schema.Schema{
// needed as input to MonitorV2Create, also part of MonitorV2 struct
"workspace": { // ObjectId!
Expand Down
3 changes: 3 additions & 0 deletions observe/resource_monitor_v2_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceMonitorV2Action() *schema.Resource {
ReadContext: resourceMonitorV2ActionRead,
UpdateContext: resourceMonitorV2ActionUpdate,
DeleteContext: resourceMonitorV2ActionDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Schema: map[string]*schema.Schema{
// needed as input to CreateMonitorV2Action
"workspace": { // ObjectId!
Expand Down

0 comments on commit 13f2656

Please sign in to comment.