Skip to content

Commit 7cbf81f

Browse files
committed
feat(bare-metal): Fix schema
1 parent f5c43f1 commit 7cbf81f

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

ibm/service/vpc/resource_ibm_is_bare_metal_server.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ func ResourceIBMIsBareMetalServer() *schema.Resource {
11111111
isBareMetalServerDefaultTrustedProfile: {
11121112
Type: schema.TypeList,
11131113
Optional: true,
1114-
Computed: true,
1114+
MaxItems: 1,
11151115
Elem: &schema.Resource{
11161116
Schema: map[string]*schema.Schema{
11171117
"auto_link": {
@@ -1122,18 +1122,21 @@ func ResourceIBMIsBareMetalServer() *schema.Resource {
11221122
"target": {
11231123
Type: schema.TypeList,
11241124
Optional: true,
1125+
MaxItems: 1,
11251126
Description: "The default IAM trusted profile to use for this bare metal server",
11261127
Elem: &schema.Resource{
11271128
Schema: map[string]*schema.Schema{
11281129
"id": {
1129-
Type: schema.TypeString,
1130-
Optional: true,
1131-
Description: "The unique identifier for this trusted profile",
1130+
Type: schema.TypeString,
1131+
Optional: true,
1132+
Description: "The unique identifier for this trusted profile",
1133+
ConflictsWith: []string{"default_trusted_profile.0.target.0.crn"},
11321134
},
11331135
"crn": {
1134-
Type: schema.TypeString,
1135-
Optional: true,
1136-
Description: "The CRN for this trusted profile",
1136+
Type: schema.TypeString,
1137+
Optional: true,
1138+
Description: "The CRN for this trusted profile",
1139+
ConflictsWith: []string{"default_trusted_profile.0.target.0.id"},
11371140
},
11381141
},
11391142
},

ibm/service/vpc/resource_ibm_is_bare_metal_server_initialization.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func ResourceIBMIsBareMetalServerInitialization() *schema.Resource {
4141
Type: schema.TypeList,
4242
Optional: true,
4343
Computed: true,
44+
MaxItems: 1,
4445
Elem: &schema.Resource{
4546
Schema: map[string]*schema.Schema{
4647
"auto_link": {
@@ -53,20 +54,23 @@ func ResourceIBMIsBareMetalServerInitialization() *schema.Resource {
5354
Type: schema.TypeList,
5455
Optional: true,
5556
Computed: true,
57+
MaxItems: 1,
5658
Description: "The default IAM trusted profile to use for this bare metal server",
5759
Elem: &schema.Resource{
5860
Schema: map[string]*schema.Schema{
5961
"id": {
60-
Type: schema.TypeString,
61-
Optional: true,
62-
Computed: true,
63-
Description: "The unique identifier for this trusted profile",
62+
Type: schema.TypeString,
63+
Optional: true,
64+
Computed: true,
65+
Description: "The unique identifier for this trusted profile",
66+
ConflictsWith: []string{"default_trusted_profile.0.target.0.crn"},
6467
},
6568
"crn": {
66-
Type: schema.TypeString,
67-
Optional: true,
68-
Computed: true,
69-
Description: "The CRN for this trusted profile",
69+
Type: schema.TypeString,
70+
Optional: true,
71+
Computed: true,
72+
Description: "The CRN for this trusted profile",
73+
ConflictsWith: []string{"default_trusted_profile.0.target.0.id"},
7074
},
7175
},
7276
},

0 commit comments

Comments
 (0)