Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update email domain #1609

Merged
merged 1 commit into from
Jun 26, 2023
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/hashicorp/terraform-plugin-docs v0.14.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/okta/okta-sdk-golang/v3 v3.0.6
github.com/okta/okta-sdk-golang/v3 v3.0.7
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/stretchr/testify v1.8.3
gopkg.in/square/go-jose.v2 v2.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3P
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/okta/okta-sdk-golang/v3 v3.0.6 h1:Ee7i3fqs2L3dvQ9bIQTqWcfTYae1VVe3Qg8JPVFPpmk=
github.com/okta/okta-sdk-golang/v3 v3.0.6/go.mod h1:7fDqgCvPaxgjhYHaxRwvc6RMioVcQ+XHN5a5hUe4nnw=
github.com/okta/okta-sdk-golang/v3 v3.0.7 h1:KhCJ4PXpESNMpJ+G7w2D3bRrlKUTQKyy0YZf9Jy9qyE=
github.com/okta/okta-sdk-golang/v3 v3.0.7/go.mod h1:7fDqgCvPaxgjhYHaxRwvc6RMioVcQ+XHN5a5hUe4nnw=
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
Expand Down
11 changes: 4 additions & 7 deletions okta/resource_okta_email_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ func resourceEmailDomain() *schema.Resource {
Computed: true,
Description: "Record type can be TXT or cname",
},
"values": {
Type: schema.TypeList,
"value": {
Type: schema.TypeString,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Description: "DNS record values",
Description: "DNS record value",
},
"expiration": {
Type: schema.TypeString,
Expand Down Expand Up @@ -106,9 +105,7 @@ func resourceEmailDomainRead(ctx context.Context, d *schema.ResourceData, m inte
"fqdn": dnsValidation[i].GetFqdn(),
"record_type": dnsValidation[i].GetRecordType(),
"expiration": dnsValidation[i].GetExpiration(),
}
if len(dnsValidation[i].GetValues()) > 0 {
arr[i]["value"] = dnsValidation[i].GetValues()
"value": dnsValidation[i].GetVerificationValue(),
}
}
err = setNonPrimitives(d, map[string]interface{}{"dns_validation_records": arr})
Expand Down
3 changes: 3 additions & 0 deletions okta/resource_okta_email_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ func TestAccOktaEmailDomain(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "domain", "example.com"),
resource.TestCheckResourceAttr(resourceName, "display_name", "test"),
resource.TestCheckResourceAttr(resourceName, "user_name", "fff"),
resource.TestCheckResourceAttrSet(resourceName, "dns_validation_records.0.record_type"),
resource.TestCheckResourceAttrSet(resourceName, "dns_validation_records.0.value"),
resource.TestCheckResourceAttrSet(resourceName, "dns_validation_records.0.fqdn"),
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/email_domain.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The following arguments are supported:
- `dns_validation_records` - TXT and CNAME records to be registered for the domain.
- `fqdn` - DNS record name.
- `record_type` - Record type can be TXT or cname.
- `values` - DNS record values
- `value` - DNS record value
- `expiration ` - DNS TXT record expiration

## Import
Expand Down