Skip to content

Commit 8fb793b

Browse files
authored
Merge pull request #152 from SumoLogic/ssain-add-scheduled-views-import
2 parents f60db52 + db92df2 commit 8fb793b

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## 2.7.1 (Unreleased)
22

3+
FEATURES:
4+
5+
* Import Scheduled Vies (GH-152)
6+
37
## 2.7.0 (Febuary 5, 2021)
48

59
BUG FIXES:

sumologic/resource_sumologic_scheduled_view.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package sumologic
22

33
import (
4-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5-
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
64
"log"
75
"time"
6+
7+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
89
)
910

1011
func resourceSumologicScheduledView() *schema.Resource {
@@ -13,6 +14,9 @@ func resourceSumologicScheduledView() *schema.Resource {
1314
Read: resourceSumologicScheduledViewRead,
1415
Delete: resourceSumologicScheduledViewDelete,
1516
Update: resourceSumologicScheduledViewUpdate,
17+
Importer: &schema.ResourceImporter{
18+
State: schema.ImportStatePassthrough,
19+
},
1620

1721
Schema: map[string]*schema.Schema{
1822
"query": {

website/docs/r/scheduled_view.html.markdown

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QUERY
2929
The following arguments are supported:
3030

3131
- `index_name` - (Required) Name of the index (scheduled view).
32-
- `query` - (Required) Log query defining the scheduled view.
32+
- `query` - (Required) Log query defining the scheduled view. This value cannot be updated.
3333
- `start_time` - (Required) Starting date/time for log indexing.
3434
- `retention_period` - (Optional) Number of days to keep the scheduled view data for.
3535
- `data_forwarding_id` - (Optional) ID of a data forwarding configuration to be used by the scheduled view.
@@ -38,4 +38,12 @@ The following attributes are exported:
3838

3939
- `id` - The internal ID of the scheduled view.
4040

41+
## Import
42+
Scheduled Views can can be imported using the id. The list of scheduled views and their ids can be obtained using the Sumologic [scheduled views api][2].
43+
44+
```hcl
45+
terraform import sumologic_scheduled_view.failed_connections 1234567890
46+
```
47+
4148
[1]: https://help.sumologic.com/Manage/Scheduled-Views
49+
[2]: https://api.sumologic.com/docs/#operation/listScheduledViews

0 commit comments

Comments
 (0)