Skip to content

Commit

Permalink
Register CaaS (#22)
Browse files Browse the repository at this point in the history
* CaaS Registration

* Updates

* Addressing review comments
  • Loading branch information
kjrach authored Jun 16, 2022
1 parent 719b6f7 commit 5885db6
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 22 deletions.
33 changes: 33 additions & 0 deletions examples/resources/hpegl_caas_cluster/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2020-2022 Hewlett Packard Enterprise Development LP

terraform {
required_providers {
hpegl = {
source = "HPE/hpegl"
version = ">= 0.1.0"
}
}
}

provider hpegl {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}

data "hpegl_caas_site" "blr" {
name = "BLR"
space_id = ""
}

data "hpegl_caas_cluster_blueprint" "bp" {
name = "demo"
site_id = data.hpegl_caas_site.blr.id
}

resource hpegl_caas_cluster test {
name = "tf-test"
blueprint_id = data.hpegl_caas_cluster_blueprint.bp.id
site_id = data.hpegl_caas_site.blr.id
space_id = ""
}
58 changes: 58 additions & 0 deletions examples/resources/hpegl_caas_cluster_blueprint/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2022 Hewlett Packard Enterprise Development LP

terraform {
required_providers {
hpegl = {
source = "HPE/hpegl"
version = ">= 0.1.0"
}
}
}

provider hpegl {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}

data "hpegl_caas_site" "blr" {
name = "BLR"
space_id = ""
}

data "hpegl_caas_machine_blueprint" "mbcontrolplane" {
name = "standard-master"
site_id = data.hpegl_caas_site.blr.id
}

data "hpegl_caas_machine_blueprint" "mbworker" {
name = "standard-worker"
site_id = data.hpegl_caas_site.blr.id
}

data "hpegl_caas_cluster_provider" "clusterprovider" {
name = "ecp"
site_id = data.hpegl_caas_site.blr.id
}

resource hpegl_caas_cluster_blueprint testbp {
name = "tf-cluster-bp"
k8s_version = data.hpegl_caas_cluster_provider.clusterprovider.k8s_versions[0]
default_storage_class = ""
site_id = data.hpegl_caas_site.blr.id
cluster_provider = ""
control_plane_nodes = {
machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbcontrolplane.id
count = ""
}
worker_nodes {
name = ""
machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
count = ""
}
worker_nodes {
name = ""
machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
count = ""
}
}
31 changes: 31 additions & 0 deletions examples/resources/hpegl_caas_cluster_provider/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2022 Hewlett Packard Enterprise Development LP

terraform {
required_providers {
hpegl = {
source = "HPE/hpegl"
version = ">= 0.1.0"
}
}
}

provider hpegl {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}

data "hpegl_caas_site" "blr" {
name = "BLR"
space_id = ""
}

data "hpegl_caas_cluster_provider" "clusterprovider" {
name = "ecp"
site_id = data.hpegl_caas_site.blr.id
}

output "cluster_provider" {
description = "The cluster provider response"
value = data.hpegl_caas_cluster_provider.clusterprovider.*
}
33 changes: 33 additions & 0 deletions examples/resources/hpegl_caas_machine_blueprint/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2020-2022 Hewlett Packard Enterprise Development LP

terraform {
required_providers {
hpegl = {
source = "HPE/hpegl"
version = ">= 0.1.0"
}
}
}

provider hpegl {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}

data "hpegl_caas_site" "blr" {
name = "BLR"
space_id = ""
}

resource hpegl_caas_machine_blueprint test {
name = ""
site_id = data.hpegl_caas_site.blr.id
machine_roles = ["controlplane"]
machine_provider = "vmaas"
os_image = "sles-custom"
os_version = ""
compute_type = ""
size = ""
storage_type = ""
}
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module github.com/HPE/terraform-provider-hpegl
go 1.14

require (
github.com/HewlettPackard/hpegl-containers-terraform-resources v0.0.2
github.com/HewlettPackard/hpegl-vmaas-terraform-resources v0.1.10
github.com/golangci/golangci-lint v1.46.1
github.com/hashicorp/terraform-plugin-docs v0.8.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0
github.com/hashicorp/terraform-plugin-docs v0.10.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0
github.com/hewlettpackard/hpegl-metal-terraform-resources v1.3.19
github.com/hewlettpackard/hpegl-provider-lib v0.0.12
)
61 changes: 41 additions & 20 deletions go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions internal/services/clients/combined.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ package clients
import (
"github.com/hewlettpackard/hpegl-provider-lib/pkg/client"

clicaas "github.com/HewlettPackard/hpegl-containers-terraform-resources/pkg/client"
clivmaas "github.com/HewlettPackard/hpegl-vmaas-terraform-resources/pkg/client"
)

func InitialiseClients() []client.Initialisation {
return []client.Initialisation{
clivmaas.InitialiseClient{},
clicaas.InitialiseClient{},
}
}
2 changes: 2 additions & 0 deletions internal/services/resources/combined.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package resources
import (
"github.com/hewlettpackard/hpegl-provider-lib/pkg/registration"

rescaas "github.com/HewlettPackard/hpegl-containers-terraform-resources/pkg/resources"
resvmaas "github.com/HewlettPackard/hpegl-vmaas-terraform-resources/pkg/resources"
resmetal "github.com/hewlettpackard/hpegl-metal-terraform-resources/pkg/registration"
)
Expand All @@ -13,5 +14,6 @@ func SupportedServices() []registration.ServiceRegistration {
return []registration.ServiceRegistration{
resmetal.Registration{},
resvmaas.Registration{},
rescaas.Registration{},
}
}

0 comments on commit 5885db6

Please sign in to comment.