Skip to content

Commit b261372

Browse files
committed
Merge branch 'master' into emichaeli-make-policies-required-to-be-more-explicit
2 parents f966e7d + afe6fc3 commit b261372

27 files changed

+589
-158
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ jobs:
8282
SUMOLOGIC_ACCESSID: ${{ secrets.SUMOLOGIC_ACCESSID }}
8383
SUMOLOGIC_ACCESSKEY: ${{ secrets.SUMOLOGIC_ACCESSKEY }}
8484
SUMOLOGIC_ENVIRONMENT: ${{ secrets.SUMOLOGIC_ENVIRONMENT }}
85-
SUMOLOGIC_TEST_AWS_ID: ${{ secrets.SUMOLOGIC_TEST_AWS_ID }}
86-
SUMOLOGIC_TEST_AWS_KEY: ${{ secrets.SUMOLOGIC_TEST_AWS_KEY }}
8785
SUMOLOGIC_TEST_BUCKET_NAME: ${{ secrets.SUMOLOGIC_TEST_BUCKET_NAME }}
86+
SUMOLOGIC_TEST_ROLE_ARN: ${{ secrets.SUMOLOGIC_TEST_ROLE_ARN }}
8887

8988
run: |
9089
go test -v -cover ./sumologic/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
FEATURES:
44

55
* **New Resource:** sumologic_hierarchy (GH-260)
6+
* **New Resource:** sumologic_cse_network_block (GH-271)
7+
=======
8+
DEPRECATIONS:
9+
10+
* resource/sumologic_monitor: Deprecated `triggers` in favor of `trigger_conditions` (GH-267)
611

712
## 2.9.10 (August 24, 2021)
813

sumologic/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func Provider() terraform.ResourceProvider {
3838
},
3939
},
4040
ResourcesMap: map[string]*schema.Resource{
41+
"sumologic_cse_network_block": resourceSumologicCSENetworkBlock(),
4142
"sumologic_collector": resourceSumologicCollector(),
4243
"sumologic_http_source": resourceSumologicHTTPSource(),
4344
"sumologic_gcp_source": resourceSumologicGCPSource(),

sumologic/provider_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ func testAccPreCheck(t *testing.T) {
4242

4343
func testAccPreCheckWithAWS(t *testing.T) {
4444
testAccPreCheck(t)
45-
if v := os.Getenv("SUMOLOGIC_TEST_AWS_ID"); v == "" {
46-
t.Fatal("SUMOLOGIC_TEST_AWS_ID must be set for polling source acceptance tests")
47-
}
48-
if v := os.Getenv("SUMOLOGIC_TEST_AWS_KEY"); v == "" {
49-
t.Fatal("SUMOLOGIC_TEST_AWS_KEY must be set for polling source acceptance tests")
45+
if v := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN"); v == "" {
46+
t.Fatal("SUMOLOGIC_TEST_ROLE_ARN must be set for polling source acceptance tests")
5047
}
5148
if v := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME"); v == "" {
5249
t.Fatal("SUMOLOGIC_TEST_BUCKET_NAME must be set for polling source acceptance tests")

sumologic/resource_sumologic_cloudfront_source_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ func TestAccSumologicCloudFrontSource_create(t *testing.T) {
1616
cName, cDescription, cCategory := getRandomizedParams()
1717
sName, sDescription, sCategory := getRandomizedParams()
1818
cloudFrontResourceName := "sumologic_cloudfront_source.cloudfront"
19-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
20-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
19+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
2120
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
2221
resource.Test(t, resource.TestCase{
2322
PreCheck: func() { testAccPreCheckWithAWS(t) },
2423
Providers: testAccProviders,
2524
CheckDestroy: testAccCheckCloudFrontSourceDestroy,
2625
Steps: []resource.TestStep{
2726
{
28-
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
27+
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
2928
Check: resource.ComposeTestCheckFunc(
3029
testAccCheckCloudFrontSourceExists(cloudFrontResourceName, &cloudFrontSource),
3130
testAccCheckCloudFrontSourceValues(&cloudFrontSource, sName, sDescription, sCategory),
@@ -48,16 +47,15 @@ func TestAccSumologicCloudFrontSource_update(t *testing.T) {
4847
sName, sDescription, sCategory := getRandomizedParams()
4948
sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams()
5049
cloudFrontResourceName := "sumologic_cloudfront_source.cloudfront"
51-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
52-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
50+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
5351
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
5452
resource.Test(t, resource.TestCase{
5553
PreCheck: func() { testAccPreCheckWithAWS(t) },
5654
Providers: testAccProviders,
5755
CheckDestroy: testAccCheckHTTPSourceDestroy,
5856
Steps: []resource.TestStep{
5957
{
60-
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
58+
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
6159
Check: resource.ComposeTestCheckFunc(
6260
testAccCheckCloudFrontSourceExists(cloudFrontResourceName, &cloudFrontSource),
6361
testAccCheckCloudFrontSourceValues(&cloudFrontSource, sName, sDescription, sCategory),
@@ -70,7 +68,7 @@ func TestAccSumologicCloudFrontSource_update(t *testing.T) {
7068
),
7169
},
7270
{
73-
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsID, testAwsKey, testAwsBucket),
71+
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsRoleArn, testAwsBucket),
7472
Check: resource.ComposeTestCheckFunc(
7573
testAccCheckCloudFrontSourceExists(cloudFrontResourceName, &cloudFrontSource),
7674
testAccCheckCloudFrontSourceValues(&cloudFrontSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated),
@@ -152,7 +150,7 @@ func testAccCheckCloudFrontSourceValues(pollingSource *PollingSource, name, desc
152150
return nil
153151
}
154152
}
155-
func testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket string) string {
153+
func testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket string) string {
156154
return fmt.Sprintf(`
157155
resource "sumologic_collector" "test" {
158156
name = "%s"
@@ -168,9 +166,8 @@ resource "sumologic_cloudfront_source" "cloudfront" {
168166
paused = false
169167
collector_id = "${sumologic_collector.test.id}"
170168
authentication {
171-
type = "S3BucketAuthentication"
172-
access_key = "%s"
173-
secret_key = "%s"
169+
type = "AWSRoleBasedAuthentication"
170+
role_arn = "%s"
174171
}
175172
path {
176173
type = "S3BucketPathExpression"
@@ -179,5 +176,5 @@ resource "sumologic_cloudfront_source" "cloudfront" {
179176
}
180177
}
181178
182-
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket)
179+
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket)
183180
}

sumologic/resource_sumologic_cloudtrail_source_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ func TestAccSumologicCloudTrailSource_create(t *testing.T) {
1616
cName, cDescription, cCategory := getRandomizedParams()
1717
sName, sDescription, sCategory := getRandomizedParams()
1818
cloudTrailResourceName := "sumologic_cloudtrail_source.cloudtrail"
19-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
20-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
19+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
2120
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
2221
resource.Test(t, resource.TestCase{
2322
PreCheck: func() { testAccPreCheckWithAWS(t) },
2423
Providers: testAccProviders,
2524
CheckDestroy: testAccCheckCloudTrailSourceDestroy,
2625
Steps: []resource.TestStep{
2726
{
28-
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
27+
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
2928
Check: resource.ComposeTestCheckFunc(
3029
testAccCheckCloudTrailSourceExists(cloudTrailResourceName, &cloudTrailSource),
3130
testAccCheckCloudTrailSourceValues(&cloudTrailSource, sName, sDescription, sCategory),
@@ -48,16 +47,15 @@ func TestAccSumologicCloudTrailSource_update(t *testing.T) {
4847
sName, sDescription, sCategory := getRandomizedParams()
4948
sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams()
5049
cloudTrailResourceName := "sumologic_cloudtrail_source.cloudtrail"
51-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
52-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
50+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
5351
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
5452
resource.Test(t, resource.TestCase{
5553
PreCheck: func() { testAccPreCheckWithAWS(t) },
5654
Providers: testAccProviders,
5755
CheckDestroy: testAccCheckHTTPSourceDestroy,
5856
Steps: []resource.TestStep{
5957
{
60-
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
58+
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
6159
Check: resource.ComposeTestCheckFunc(
6260
testAccCheckCloudTrailSourceExists(cloudTrailResourceName, &cloudTrailSource),
6361
testAccCheckCloudTrailSourceValues(&cloudTrailSource, sName, sDescription, sCategory),
@@ -70,7 +68,7 @@ func TestAccSumologicCloudTrailSource_update(t *testing.T) {
7068
),
7169
},
7270
{
73-
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsID, testAwsKey, testAwsBucket),
71+
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsRoleArn, testAwsBucket),
7472
Check: resource.ComposeTestCheckFunc(
7573
testAccCheckCloudTrailSourceExists(cloudTrailResourceName, &cloudTrailSource),
7674
testAccCheckCloudTrailSourceValues(&cloudTrailSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated),
@@ -152,7 +150,7 @@ func testAccCheckCloudTrailSourceValues(pollingSource *PollingSource, name, desc
152150
return nil
153151
}
154152
}
155-
func testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket string) string {
153+
func testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket string) string {
156154
return fmt.Sprintf(`
157155
resource "sumologic_collector" "test" {
158156
name = "%s"
@@ -168,9 +166,8 @@ resource "sumologic_cloudtrail_source" "cloudtrail" {
168166
paused = false
169167
collector_id = "${sumologic_collector.test.id}"
170168
authentication {
171-
type = "S3BucketAuthentication"
172-
access_key = "%s"
173-
secret_key = "%s"
169+
type = "AWSRoleBasedAuthentication"
170+
role_arn = "%s"
174171
}
175172
path {
176173
type = "S3BucketPathExpression"
@@ -179,5 +176,5 @@ resource "sumologic_cloudtrail_source" "cloudtrail" {
179176
}
180177
}
181178
182-
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket)
179+
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket)
183180
}

sumologic/resource_sumologic_cloudwatch_source_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ func TestAccSumologicCloudWatchSource_create(t *testing.T) {
1616
cName, cDescription, cCategory := getRandomizedParams()
1717
sName, sDescription, sCategory := getRandomizedParams()
1818
cloudWatchResourceName := "sumologic_cloudwatch_source.cloudwatch"
19-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
20-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
19+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
2120
resource.Test(t, resource.TestCase{
2221
PreCheck: func() { testAccPreCheckWithAWS(t) },
2322
Providers: testAccProviders,
2423
CheckDestroy: testAccCheckCloudWatchSourceDestroy,
2524
Steps: []resource.TestStep{
2625
{
27-
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey),
26+
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn),
2827
Check: resource.ComposeTestCheckFunc(
2928
testAccCheckCloudWatchSourceExists(cloudWatchResourceName, &cloudWatchSource),
3029
testAccCheckCloudWatchSourceValues(&cloudWatchSource, sName, sDescription, sCategory),
@@ -47,15 +46,14 @@ func TestAccSumologicCloudWatchSource_update(t *testing.T) {
4746
sName, sDescription, sCategory := getRandomizedParams()
4847
sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams()
4948
cloudWatchResourceName := "sumologic_cloudwatch_source.cloudwatch"
50-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
51-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
49+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
5250
resource.Test(t, resource.TestCase{
5351
PreCheck: func() { testAccPreCheckWithAWS(t) },
5452
Providers: testAccProviders,
5553
CheckDestroy: testAccCheckHTTPSourceDestroy,
5654
Steps: []resource.TestStep{
5755
{
58-
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey),
56+
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn),
5957
Check: resource.ComposeTestCheckFunc(
6058
testAccCheckCloudWatchSourceExists(cloudWatchResourceName, &cloudWatchSource),
6159
testAccCheckCloudWatchSourceValues(&cloudWatchSource, sName, sDescription, sCategory),
@@ -68,7 +66,7 @@ func TestAccSumologicCloudWatchSource_update(t *testing.T) {
6866
),
6967
},
7068
{
71-
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsID, testAwsKey),
69+
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsRoleArn),
7270
Check: resource.ComposeTestCheckFunc(
7371
testAccCheckCloudWatchSourceExists(cloudWatchResourceName, &cloudWatchSource),
7472
testAccCheckCloudWatchSourceValues(&cloudWatchSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated),
@@ -150,7 +148,7 @@ func testAccCheckCloudWatchSourceValues(pollingSource *PollingSource, name, desc
150148
return nil
151149
}
152150
}
153-
func testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsId, testAwsKey string) string {
151+
func testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn string) string {
154152
return fmt.Sprintf(`
155153
resource "sumologic_collector" "test" {
156154
name = "%s"
@@ -167,9 +165,8 @@ resource "sumologic_cloudwatch_source" "cloudwatch" {
167165
paused = false
168166
collector_id = "${sumologic_collector.test.id}"
169167
authentication {
170-
type = "S3BucketAuthentication"
171-
access_key = "%s"
172-
secret_key = "%s"
168+
type = "AWSRoleBasedAuthentication"
169+
role_arn = "%s"
173170
}
174171
path {
175172
type = "CloudWatchPath"
@@ -187,5 +184,5 @@ resource "sumologic_cloudwatch_source" "cloudwatch" {
187184
}
188185
}
189186
}
190-
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsId, testAwsKey)
187+
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn)
191188
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package sumologic
2+
3+
import (
4+
"errors"
5+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
6+
"log"
7+
)
8+
9+
func resourceSumologicCSENetworkBlock() *schema.Resource {
10+
return &schema.Resource{
11+
Create: resourceSumologicCSENetworkBlockCreate,
12+
Read: resourceSumologicCSENetworkBlockRead,
13+
Delete: resourceSumologicCSENetworkBlockDelete,
14+
Update: resourceSumologicCSENetworkBlockUpdate,
15+
Importer: &schema.ResourceImporter{
16+
State: schema.ImportStatePassthrough,
17+
},
18+
19+
Schema: map[string]*schema.Schema{
20+
"address_block": {
21+
Type: schema.TypeString,
22+
Required: true,
23+
ForceNew: false,
24+
},
25+
"label": {
26+
Type: schema.TypeString,
27+
Optional: true,
28+
ForceNew: false,
29+
},
30+
"internal": {
31+
Type: schema.TypeBool,
32+
Optional: true,
33+
ForceNew: false,
34+
Default: true,
35+
},
36+
"suppresses_signals": {
37+
Type: schema.TypeBool,
38+
Optional: true,
39+
ForceNew: false,
40+
Default: false,
41+
},
42+
},
43+
}
44+
}
45+
46+
func resourceSumologicCSENetworkBlockRead(d *schema.ResourceData, meta interface{}) error {
47+
c := meta.(*Client)
48+
49+
var cseNetworkBlock *CSENetworkBlock
50+
id := d.Id()
51+
52+
cseNetworkBlock, err := c.GetCSENetworkBlock(id)
53+
if err != nil {
54+
log.Printf("[WARN] CSE Network Block not found when looking by id: %s, err: %v", id, err)
55+
56+
}
57+
58+
if cseNetworkBlock == nil {
59+
log.Printf("[WARN] CSE Network Block not found, removing from state: %v - %v", id, err)
60+
d.SetId("")
61+
return nil
62+
}
63+
64+
d.Set("address_block", cseNetworkBlock.AddressBlock)
65+
d.Set("label", cseNetworkBlock.Label)
66+
d.Set("internal", cseNetworkBlock.Internal)
67+
d.Set("suppresses_signals", cseNetworkBlock.SuppressesSignals)
68+
69+
return nil
70+
}
71+
72+
func resourceSumologicCSENetworkBlockDelete(d *schema.ResourceData, meta interface{}) error {
73+
c := meta.(*Client)
74+
75+
id := d.Id()
76+
return c.DeleteCSENetworkBlock(id)
77+
78+
}
79+
80+
func resourceSumologicCSENetworkBlockCreate(d *schema.ResourceData, meta interface{}) error {
81+
c := meta.(*Client)
82+
83+
if d.Id() == "" {
84+
id, err := c.CreateCSENetworkBlock(CSENetworkBlock{
85+
AddressBlock: d.Get("address_block").(string),
86+
Label: d.Get("label").(string),
87+
Internal: d.Get("internal").(bool),
88+
SuppressesSignals: d.Get("suppresses_signals").(bool),
89+
})
90+
91+
if err != nil {
92+
return err
93+
}
94+
log.Printf("[INFO] got id: %s", id)
95+
d.SetId(id)
96+
}
97+
98+
return resourceSumologicCSENetworkBlockUpdate(d, meta)
99+
}
100+
101+
func resourceSumologicCSENetworkBlockUpdate(d *schema.ResourceData, meta interface{}) error {
102+
cseNetworkBlock, err := resourceToCSENetworkBlock(d)
103+
if err != nil {
104+
return err
105+
}
106+
107+
c := meta.(*Client)
108+
if err = c.UpdateCSENetworkBlock(cseNetworkBlock); err != nil {
109+
return err
110+
}
111+
112+
return resourceSumologicCSENetworkBlockRead(d, meta)
113+
}
114+
115+
func resourceToCSENetworkBlock(d *schema.ResourceData) (CSENetworkBlock, error) {
116+
id := d.Id()
117+
if id == "" {
118+
return CSENetworkBlock{}, errors.New("network block id not specified")
119+
}
120+
121+
return CSENetworkBlock{
122+
ID: id,
123+
AddressBlock: d.Get("address_block").(string),
124+
Label: d.Get("label").(string),
125+
Internal: d.Get("internal").(bool),
126+
SuppressesSignals: d.Get("suppresses_signals").(bool),
127+
}, nil
128+
}

0 commit comments

Comments
 (0)