Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Optional:
- `region_id` (Number) Region ID, Attribute conditional on `type` being equal to `regionId`
- Range: `0`-`63`
- `region_list_id` (String) Region list ID, Attribute conditional on `type` being equal to `regionList`
- `role` (String) Role, Attribute conditional on `type` being equal to `regionId`
- `role` (String) Role, Attribute conditional on `type` being equal to `role`
- Choices: `border-router`, `edge-router`
- `site_id` (Number) Site ID, Attribute conditional on `type` being equal to `siteId`
- Range: `0`-`4294967295`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ attributes:
tf_name: role
conditional_attribute:
name: type
value: regionId
value: role
type: String
description: Role
enum_values: [border-router, edge-router]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (data CustomControlTopologyPolicyDefinition) toBody(ctx context.Context) st
if !childItem.RegionId.IsNull() && childItem.Type.ValueString() == "regionId" {
itemChildBody, _ = sjson.Set(itemChildBody, "value", fmt.Sprint(childItem.RegionId.ValueInt64()))
}
if !childItem.Role.IsNull() && childItem.Type.ValueString() == "regionId" {
if !childItem.Role.IsNull() && childItem.Type.ValueString() == "role" {
itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.Role.ValueString())
}
if !childItem.RegionListId.IsNull() && childItem.Type.ValueString() == "regionList" {
Expand Down Expand Up @@ -477,7 +477,7 @@ func (data *CustomControlTopologyPolicyDefinition) fromBody(ctx context.Context,
} else {
cItem.RegionId = types.Int64Null()
}
if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "regionId" {
if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "role" {
cItem.Role = types.StringValue(ccValue.String())
} else {
cItem.Role = types.StringNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func (r *CustomControlTopologyPolicyDefinitionResource) Schema(ctx context.Conte
},
},
"role": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Role, Attribute conditional on `type` being equal to `regionId`").AddStringEnumDescription("border-router", "edge-router").String,
MarkdownDescription: helpers.NewAttributeDescription("Role, Attribute conditional on `type` being equal to `role`").AddStringEnumDescription("border-router", "edge-router").String,
Optional: true,
Validators: []validator.String{
stringvalidator.OneOf("border-router", "edge-router"),
Expand Down