Skip to content
Merged
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
12 changes: 6 additions & 6 deletions pkg/services/privateca/privateca_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,6 @@ should be set to 'my-ca'.`,
ForceNew: true,
Description: `The common name of the distinguished name.`,
},
"organization": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The organization of the subject.`,
},
"country_code": {
Type: schema.TypeString,
Optional: true,
Expand All @@ -188,6 +182,12 @@ should be set to 'my-ca'.`,
ForceNew: true,
Description: `The locality or city of the subject.`,
},
"organization": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: `The organization of the subject.`,
},
"organizational_unit": {
Type: schema.TypeString,
Optional: true,
Expand Down
7 changes: 3 additions & 4 deletions pkg/services/privateca/privateca_certificate_cai2hcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,10 @@ func flattenPrivatecaCertificateConfigSubjectConfigSubjectCountryCode(v interfac

func flattenPrivatecaCertificateConfigSubjectConfigSubjectOrganization(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
if v == nil {
return "unknown"
return nil
}
transformed := v.(string)
if transformed == "" {
return "unknown"
if strVal, ok := v.(string); ok && strVal == "" {
return nil
}
return v
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func TestAccPrivatecaCertificate(t *testing.T) {
{
Name: "TestAccPrivatecaCertificate_privatecaCertificateCustomSkiExample",
},
{
Name: "TestAccPrivatecaCertificate_privatecaCertificateSubjectConfigOrgOptionalExample",
},
{
Name: "TestAccPrivatecaCertificate_privatecaCertificateUpdate",
},
Expand Down