Skip to content

Commit

Permalink
Add importer to honeycombio_board (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenraad Verheyden committed Oct 16, 2020
1 parent 0fc337d commit a046b57
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/resources/board.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,13 @@ Each board configuration may have zero or more `query` blocks, which accepts the
In addition to all arguments above, the following attributes are exported:

* `id` - ID of the trigger.

## Import

Boards can be imported using their ID, e.g.

```
$ terraform import honeycombio_board.my_board AobW9oAZX71
```

You can find the ID in the URL bar when visiting the board from the UI.
3 changes: 3 additions & 0 deletions honeycombio/resource_board.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func newBoard() *schema.Resource {
ReadContext: resourceBoardRead,
UpdateContext: resourceBoardUpdate,
DeleteContext: resourceBoardDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
5 changes: 5 additions & 0 deletions honeycombio/resource_board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ func TestAccHoneycombioBoard_basic(t *testing.T) {
testAccCheckBoardExists(t, "honeycombio_board.test"),
),
},
{
ResourceName: "honeycombio_board.test",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down

0 comments on commit a046b57

Please sign in to comment.