Skip to content

Commit 14a1980

Browse files
authored
fix: [REL-8490] remove ConflictsWith for unbounded and rules, included, excluded (#324)
remove the ConflictsWith for unbounded
1 parent e9b35e9 commit 14a1980

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

launchdarkly/resource_launchdarkly_segment_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ resource "launchdarkly_segment" "test" {
9999
tags = ["segmentTag1", "segmentTag2"]
100100
included = ["user1", "user2"]
101101
excluded = ["user3", "user4"]
102+
unbounded = false
102103
rules {
103104
clauses {
104105
attribute = "test_att"
@@ -432,6 +433,7 @@ func TestAccSegment_WithRules(t *testing.T) {
432433
resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"),
433434
resource.TestCheckResourceAttr(resourceName, NAME, "segment name"),
434435
resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "segment description"),
436+
resource.TestCheckResourceAttr(resourceName, UNBOUNDED, "false"),
435437
resource.TestCheckResourceAttr(resourceName, "rules.#", "2"),
436438
resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.#", "1"),
437439
resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.attribute", "test_att"),
@@ -475,6 +477,7 @@ func TestAccSegment_WithRules(t *testing.T) {
475477
resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"),
476478
resource.TestCheckResourceAttr(resourceName, NAME, "segment name"),
477479
resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "segment description"),
480+
resource.TestCheckResourceAttr(resourceName, UNBOUNDED, "false"),
478481
resource.TestCheckResourceAttr(resourceName, "tags.#", "2"),
479482
resource.TestCheckResourceAttr(resourceName, "tags.0", "segmentTag1"),
480483
resource.TestCheckResourceAttr(resourceName, "tags.1", "segmentTag2"),

launchdarkly/segments_helper.go

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,32 @@ func baseSegmentSchema(options segmentSchemaOptions) map[string]*schema.Schema {
2525
},
2626
TAGS: tagsSchema(tagsSchemaOptions(options)),
2727
INCLUDED: {
28-
Type: schema.TypeList,
29-
Elem: &schema.Schema{Type: schema.TypeString},
30-
Optional: !options.isDataSource,
31-
Computed: options.isDataSource,
32-
Description: "List of user keys included in the segment. To target on other context kinds, use the included_contexts block attribute. This attribute is not valid when `unbounded` is set to `true`.",
33-
ConflictsWith: []string{UNBOUNDED},
28+
Type: schema.TypeList,
29+
Elem: &schema.Schema{Type: schema.TypeString},
30+
Optional: !options.isDataSource,
31+
Computed: options.isDataSource,
32+
Description: "List of user keys included in the segment. To target on other context kinds, use the included_contexts block attribute. This attribute is not valid when `unbounded` is set to `true`.",
3433
},
3534
EXCLUDED: {
36-
Type: schema.TypeList,
37-
Elem: &schema.Schema{Type: schema.TypeString},
38-
Optional: !options.isDataSource,
39-
Computed: options.isDataSource,
40-
Description: "List of user keys excluded from the segment. To target on other context kinds, use the excluded_contexts block attribute. This attribute is not valid when `unbounded` is set to `true`.",
41-
ConflictsWith: []string{UNBOUNDED},
35+
Type: schema.TypeList,
36+
Elem: &schema.Schema{Type: schema.TypeString},
37+
Optional: !options.isDataSource,
38+
Computed: options.isDataSource,
39+
Description: "List of user keys excluded from the segment. To target on other context kinds, use the excluded_contexts block attribute. This attribute is not valid when `unbounded` is set to `true`.",
4240
},
4341
INCLUDED_CONTEXTS: {
44-
Type: schema.TypeList,
45-
Elem: &schema.Resource{Schema: segmentTargetsSchema()},
46-
Optional: !options.isDataSource,
47-
Computed: options.isDataSource,
48-
Description: "List of non-user target objects included in the segment. This attribute is not valid when `unbounded` is set to `true`.",
49-
ConflictsWith: []string{UNBOUNDED},
42+
Type: schema.TypeList,
43+
Elem: &schema.Resource{Schema: segmentTargetsSchema()},
44+
Optional: !options.isDataSource,
45+
Computed: options.isDataSource,
46+
Description: "List of non-user target objects included in the segment. This attribute is not valid when `unbounded` is set to `true`.",
5047
},
5148
EXCLUDED_CONTEXTS: {
52-
Type: schema.TypeList,
53-
Elem: &schema.Resource{Schema: segmentTargetsSchema()},
54-
Optional: !options.isDataSource,
55-
Computed: options.isDataSource,
56-
Description: "List of non-user target objects excluded from the segment. This attribute is not valid when `unbounded` is set to `true`.",
57-
ConflictsWith: []string{UNBOUNDED},
49+
Type: schema.TypeList,
50+
Elem: &schema.Resource{Schema: segmentTargetsSchema()},
51+
Optional: !options.isDataSource,
52+
Computed: options.isDataSource,
53+
Description: "List of non-user target objects excluded from the segment. This attribute is not valid when `unbounded` is set to `true`.",
5854
},
5955
CREATION_DATE: {
6056
Type: schema.TypeInt,
@@ -63,14 +59,13 @@ func baseSegmentSchema(options segmentSchemaOptions) map[string]*schema.Schema {
6359
},
6460
RULES: segmentRulesSchema(segmentRulesSchemaOptions(options)),
6561
UNBOUNDED: {
66-
Type: schema.TypeBool,
67-
Required: false,
68-
Optional: !options.isDataSource,
69-
Computed: options.isDataSource,
70-
Default: false,
71-
Description: addForceNewDescription("Whether to create a standard segment (`false`) or a Big Segment (`true`). Standard segments include rule-based and smaller list-based segments. Big Segments include larger list-based segments and synced segments. Only use a Big Segment if you need to add more than 15,000 individual targets. It is not possible to manage the list of targeted contexts for Big Segments with Terraform.", !options.isDataSource),
72-
ForceNew: !options.isDataSource,
73-
ConflictsWith: []string{INCLUDED, EXCLUDED, INCLUDED_CONTEXTS, EXCLUDED_CONTEXTS, RULES},
62+
Type: schema.TypeBool,
63+
Required: false,
64+
Optional: !options.isDataSource,
65+
Computed: options.isDataSource,
66+
Default: false,
67+
Description: addForceNewDescription("Whether to create a standard segment (`false`) or a Big Segment (`true`). Standard segments include rule-based and smaller list-based segments. Big Segments include larger list-based segments and synced segments. Only use a Big Segment if you need to add more than 15,000 individual targets. It is not possible to manage the list of targeted contexts for Big Segments with Terraform.", !options.isDataSource),
68+
ForceNew: !options.isDataSource,
7469
},
7570
UNBOUNDED_CONTEXT_KIND: {
7671
Type: schema.TypeString,

0 commit comments

Comments
 (0)