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
7 changes: 7 additions & 0 deletions internal/service/dns/ip_allocation_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ func (r *IPAllocationResource) ValidateConfig(ctx context.Context, req resource.
"must not end with a dot",
)
}
if !strings.Contains(name, ".") {
resp.Diagnostics.AddAttributeError(
path.Root("name"),
"Invalid FQDN",
"Parent not found - ensure the zone or network exists before creating the record.",
)
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion internal/service/dns/model_ip_allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ var IPAllocationResourceSchemaAttributes = map[string]schema.Attribute{
MarkdownDescription: "The Microsoft Active Directory user related information.",
},
"name": schema.StringAttribute{
Required: true,
Required: true,
Validators: []validator.String{
customvalidator.IsValidDomainName(),
},
MarkdownDescription: "The host name in FQDN format This value can be in unicode format. Regular expression search is not supported for unicode values.",
},
"network_view": schema.StringAttribute{
Expand Down