Skip to content

Commit 03948db

Browse files
authored
Merge pull request #4 from terraform-providers/ssain-add-import-to-docs
Ssain add import to docs
2 parents cd38f3b + 535df56 commit 03948db

File tree

8 files changed

+196
-14
lines changed

8 files changed

+196
-14
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ require (
99
github.com/go-errors/errors v1.0.1
1010
github.com/go-test/deep v1.0.5 // indirect
1111
github.com/golang/mock v1.4.0 // indirect
12-
github.com/hashicorp/go-getter v1.4.1 // indirect
1312
github.com/hashicorp/go-hclog v0.12.0 // indirect
1413
github.com/hashicorp/go-uuid v1.0.2 // indirect
1514
github.com/hashicorp/hcl v1.0.0 // indirect
16-
github.com/hashicorp/hcl/v2 v2.3.0 // indirect
15+
github.com/hashicorp/terraform v0.12.24
1716
github.com/hashicorp/terraform-config-inspect v0.0.0-20200210163047-f7d8399e1194 // indirect
1817
github.com/hashicorp/terraform-plugin-sdk v1.7.0
1918
github.com/hashicorp/terraform-svchost v0.0.0-20191119180714-d2e4933b9136 // indirect

go.sum

Lines changed: 166 additions & 2 deletions
Large diffs are not rendered by default.

sumologic/resource_sumologic_role_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ import (
1919

2020
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
2121
"github.com/hashicorp/terraform-plugin-sdk/terraform"
22+
"github.com/hashicorp/terraform/helper/acctest"
2223
)
2324

2425
func TestAccSumologicRole_basic(t *testing.T) {
2526
var role Role
26-
testName := FieldsMap["Role"]["name"]
27+
testName := acctest.RandomWithPrefix("tf-acc-test")
2728
testDescription := FieldsMap["Role"]["description"]
2829
testFilterPredicate := FieldsMap["Role"]["filterPredicate"]
2930
testCapabilities := []string{"\"" + FieldsMap["Role"]["capabilities"] + "\""}
@@ -47,7 +48,7 @@ func TestAccSumologicRole_basic(t *testing.T) {
4748

4849
func TestAccRole_create(t *testing.T) {
4950
var role Role
50-
testName := FieldsMap["Role"]["name"]
51+
testName := acctest.RandomWithPrefix("tf-acc-test")
5152
testDescription := FieldsMap["Role"]["description"]
5253
testFilterPredicate := FieldsMap["Role"]["filterPredicate"]
5354
testCapabilities := []string{"\"" + FieldsMap["Role"]["capabilities"] + "\""}
@@ -114,12 +115,12 @@ func testAccCheckRoleExists(name string, role *Role, t *testing.T) resource.Test
114115

115116
func TestAccRole_update(t *testing.T) {
116117
var role Role
117-
testName := FieldsMap["Role"]["name"]
118+
testName := acctest.RandomWithPrefix("tf-acc-test")
118119
testDescription := FieldsMap["Role"]["description"]
119120
testFilterPredicate := FieldsMap["Role"]["filterPredicate"]
120121
testCapabilities := []string{"\"" + FieldsMap["Role"]["capabilities"] + "\""}
121122

122-
testUpdatedName := FieldsMap["Role"]["updatedName"]
123+
testUpdatedName := acctest.RandomWithPrefix("tf-acc-test")
123124
testUpdatedDescription := FieldsMap["Role"]["updatedDescription"]
124125
testUpdatedFilterPredicate := FieldsMap["Role"]["updatedFilterPredicate"]
125126
testUpdatedCapabilities := []string{"\"" + FieldsMap["Role"]["updatedCapabilities"] + "\""}

website/docs/d/caller_identity.html.markdown

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ data "sumologic_caller_identity" "current" {}
2020
The following attributes are exported:
2121

2222
- `access_id` - Sumo Logic access ID.
23-
- `access_key` - Sumo Logic access key.
2423
- `environment` - API endpoint environment.
2524

2625

website/docs/r/extraction_rule.html.markdown

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Provides a [Sumologic Field Extraction Rule][1].
1010

1111
## Example Usage
1212
```hcl
13-
resource "sumologic_field_extraction_rule" "exampleFER" {
13+
resource "sumologic_field_extraction_rule" "fieldExtractionRule" {
1414
name = "exampleFieldExtractionRule"
1515
scope = "_sourceHost=127.0.0.1"
1616
parse_expression = "csv _raw extract 1 as f1"
@@ -33,5 +33,11 @@ The following attributes are exported:
3333

3434
- `id` - Unique identifier for the field extraction rule.
3535

36+
## Import
37+
Extraction Rules can be imported using the extraction rule id, e.g.:
38+
39+
```hcl
40+
terraform import sumologic_field_extraction_rule.fieldExtractionRule id
41+
```
3642

3743
[1]: https://help.sumologic.com/Manage/Field-Extractions

website/docs/r/ingest_budget.html.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ The following attributes are exported:
4545

4646
## Import
4747
Ingest budgets can be imported using the name, e.g.:
48-
```bash
49-
terraform import sumologic_collector.test budgetName
48+
49+
```hcl
50+
terraform import sumologic_ingest_budget.budget budgetName
5051
```
5152

5253
[1]: https://help.sumologic.com/Manage/Ingestion-and-Volume/Ingest_Budgets

website/docs/r/role.html.markdown

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ The following arguments are supported:
3434
- `filter_predicate` - (Optional) A search filter to restrict access to specific logs.
3535
- `users` - (Optional) List of user identifiers to assign the role to.
3636
- `capabilities` - (Optional) List of capabilities associated with this role.
37-
- `lookup_by_name` - (Optional) Configures an existent role using the same 'name' or creates a new one if non existent. Defaults to false.
38-
- `destroy` - (Optional) Whether or not to delete the role in Sumo when it is removed from Terraform. Defaults to true.
3937

4038
The following attributes are exported:
4139

4240
- `id` - The internal ID of the role.
4341

42+
## Import
43+
Roles can be imported using the collector id, e.g.:
44+
45+
```hcl
46+
terraform import sumologic_role.role id
47+
```
48+
4449
[1]: https://help.sumologic.com/Manage/Users-and-Roles/Manage-Roles

website/docs/r/user.html.markdown

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,11 @@ The following attributes are exported:
5252

5353
- `id` - The internal ID of the user.
5454

55+
## Import
56+
Roles can be imported using the collector id, e.g.:
57+
58+
```hcl
59+
terraform import sumologic_user.user id
60+
```
61+
5562
[1]: https://help.sumologic.com/Manage/Users-and-Roles/Manage-Users

0 commit comments

Comments
 (0)