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 examples/resources/ukc_service/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "ukc_service" "example" {
services {
port = 443
destination_port = 8080
handlers = ["tls", "http"]
}
}
39 changes: 39 additions & 0 deletions internal/provider/model/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,42 @@ var VolumeMountModelType = types.ObjectType{
"read_only": types.BoolType,
},
}

// ServiceGroupDomainModel describes the data model for a service group's domain.
type ServiceGroupDomainModel struct {
FQDN types.String `tfsdk:"fqdn"`
Certificate *ServiceGroupDomainCertificateModel `tfsdk:"certificate"`
}

// ServiceGroupDomainCertificateModel describes the data model for a domain's certificate.
type ServiceGroupDomainCertificateModel struct {
UUID types.String `tfsdk:"uuid"`
Name types.String `tfsdk:"name"`
}

var ServiceGroupDomainCertificateModelType = types.ObjectType{
AttrTypes: map[string]attr.Type{
"uuid": types.StringType,
"name": types.StringType,
},
}

var ServiceGroupDomainModelType = types.ObjectType{
AttrTypes: map[string]attr.Type{
"fqdn": types.StringType,
"certificate": ServiceGroupDomainCertificateModelType,
},
}

// ServiceGroupInstanceModel describes the data model for an instance attached to a service group.
type ServiceGroupInstanceModel struct {
UUID types.String `tfsdk:"uuid"`
Name types.String `tfsdk:"name"`
}

var ServiceGroupInstanceModelType = types.ObjectType{
AttrTypes: map[string]attr.Type{
"uuid": types.StringType,
"name": types.StringType,
},
}
1 change: 1 addition & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func (p *UnikraftCloudProvider) Resources(ctx context.Context) []func() resource
iresource.NewInstanceResource,
iresource.NewCertificateResource,
iresource.NewVolumeResource,
iresource.NewServiceResource,
}
}

Expand Down
Loading