From 744c29b060efec7142ff7261a494febb619fcc21 Mon Sep 17 00:00:00 2001 From: andrzejmikolajczakds Date: Wed, 5 Mar 2025 15:23:06 +0100 Subject: [PATCH 1/2] DXP-1611 create accelerator on ovh using terraform. --- terraform/ovh/network/main.tf | 4 ++ terraform/ovh/network/outputs.tf | 15 ++++++ terraform/ovh/network/providers.tf | 4 ++ terraform/ovh/network/variables.tf | 4 ++ terraform/ovh/network/versions.tf | 13 +++++ .../platform/config/pulsar-kaap/values.yaml | 46 ++++++++++++++++++ terraform/ovh/platform/main.tf | 40 ++++++++++++++++ terraform/ovh/platform/outputs.tf | 15 ++++++ terraform/ovh/platform/providers.tf | 28 +++++++++++ terraform/ovh/platform/variables.tf | 48 +++++++++++++++++++ terraform/ovh/platform/versions.tf | 13 +++++ terraform/ovh/state-backend/main.tf | 11 +++++ terraform/ovh/state-backend/outputs.tf | 15 ++++++ terraform/ovh/state-backend/providers.tf | 3 ++ terraform/ovh/state-backend/variables.tf | 22 +++++++++ terraform/ovh/state-backend/versions.tf | 13 +++++ 16 files changed, 294 insertions(+) create mode 100644 terraform/ovh/network/main.tf create mode 100644 terraform/ovh/network/outputs.tf create mode 100644 terraform/ovh/network/providers.tf create mode 100644 terraform/ovh/network/variables.tf create mode 100644 terraform/ovh/network/versions.tf create mode 100644 terraform/ovh/platform/config/pulsar-kaap/values.yaml create mode 100644 terraform/ovh/platform/main.tf create mode 100644 terraform/ovh/platform/outputs.tf create mode 100644 terraform/ovh/platform/providers.tf create mode 100644 terraform/ovh/platform/variables.tf create mode 100644 terraform/ovh/platform/versions.tf create mode 100644 terraform/ovh/state-backend/main.tf create mode 100644 terraform/ovh/state-backend/outputs.tf create mode 100644 terraform/ovh/state-backend/providers.tf create mode 100644 terraform/ovh/state-backend/variables.tf create mode 100644 terraform/ovh/state-backend/versions.tf diff --git a/terraform/ovh/network/main.tf b/terraform/ovh/network/main.tf new file mode 100644 index 00000000..840060ac --- /dev/null +++ b/terraform/ovh/network/main.tf @@ -0,0 +1,4 @@ +module "tf_network" { + source ="/Users/andrzej/repo/terraform-ovh-platform/modules/network" + service_name = var.service_name +} diff --git a/terraform/ovh/network/outputs.tf b/terraform/ovh/network/outputs.tf new file mode 100644 index 00000000..1d3c1d80 --- /dev/null +++ b/terraform/ovh/network/outputs.tf @@ -0,0 +1,15 @@ +output "floatingip" { + description = "Allocated floating IP for future usage" + value = module.tf_network.floatingip +} + +output "nodes_subnet_id" { + description = "Nodes subnet ID" + value = module.tf_network.nodes_subnet_id +} + +output "network_id" { + description = "Network id to attach cluster" + value = module.tf_network.network_id +} + diff --git a/terraform/ovh/network/providers.tf b/terraform/ovh/network/providers.tf new file mode 100644 index 00000000..3c22dd37 --- /dev/null +++ b/terraform/ovh/network/providers.tf @@ -0,0 +1,4 @@ +provider "ovh" { + +# TODO ADD you OVH credentials +} diff --git a/terraform/ovh/network/variables.tf b/terraform/ovh/network/variables.tf new file mode 100644 index 00000000..9b1a5723 --- /dev/null +++ b/terraform/ovh/network/variables.tf @@ -0,0 +1,4 @@ +variable "service_name" { + description = "The id of the public OVH cloud project" + type = string +} \ No newline at end of file diff --git a/terraform/ovh/network/versions.tf b/terraform/ovh/network/versions.tf new file mode 100644 index 00000000..a9964b6b --- /dev/null +++ b/terraform/ovh/network/versions.tf @@ -0,0 +1,13 @@ +terraform { + required_version = ">= 1.0.0" + required_providers { + kubectl = { + source = "gavinbunney/kubectl" + version = "~> 1.14.0" + } + ovh = { + source = "ovh/ovh" + version = "~> 1.4.0" + } + } +} \ No newline at end of file diff --git a/terraform/ovh/platform/config/pulsar-kaap/values.yaml b/terraform/ovh/platform/config/pulsar-kaap/values.yaml new file mode 100644 index 00000000..8451b859 --- /dev/null +++ b/terraform/ovh/platform/config/pulsar-kaap/values.yaml @@ -0,0 +1,46 @@ +cluster: + create: true + spec: + global: + name: pulsar + image: apachepulsar/pulsar:4.0.0 + restartOnConfigMapChange: true + zookeeper: + replicas: 1 + dataVolume: + name: data + size: 100M + resources: + requests: + cpu: "0.1" + memory: "256Mi" + bookkeeper: + replicas: 1 + volumes: + journal: + size: 5Gi + ledgers: + size: 20Gi + resources: + requests: + cpu: "0.4" + memory: "2Gi" + broker: + replicas: 1 + config: + managedLedgerDefaultEnsembleSize: "1" + managedLedgerDefaultWriteQuorum: "1" + managedLedgerDefaultAckQuorum: "1" + compactionServiceFactoryClassName: "org.apache.pulsar.compaction.EventTimeCompactionServiceFactory" + resources: + requests: + cpu: "0.4" + memory: "1Gi" + proxy: + replicas: 0 + autorecovery: + replicas: 0 + bastion: + replicas: 0 + functionsWorker: + replicas: 0 diff --git a/terraform/ovh/platform/main.tf b/terraform/ovh/platform/main.tf new file mode 100644 index 00000000..b169ab25 --- /dev/null +++ b/terraform/ovh/platform/main.tf @@ -0,0 +1,40 @@ +module "cluster" { + source = "/Users/andrzej/repo/terraform-ovh-platform/modules/cluster" + service_name = var.service_name + kubeconfig_path = "${path.module}/.env/kubeconfig" + network_id = var.public_ip_address == null || var.public_ip_address == "" ? null: var.network_id + nodes_subnet_id = var.public_ip_address == null || var.public_ip_address == "" ? null: var.nodes_subnet_id + region = var.region +} + +locals { + ingress_controller_nginx_settings_without_static_ip = { + "controller.replicaCount" : 1 + "controller.service.annotations.loadbalancer\\.ovhcloud\\.com/class" : "octavia" + } + ingress_controller_nginx_settings_with_static_ip = { + "controller.service.loadBalancerIP" : var.public_ip_address + "controller.replicaCount" : 1 + "controller.service.annotations.loadbalancer\\.ovhcloud\\.com/class" : "octavia" + } +} + +module "streamx" { + source = "streamx-dev/charts/helm" + version = "0.0.1" + + cert_manager_lets_encrypt_issuer_acme_email = var.cert_manager_lets_encrypt_issuer_acme_email + ingress_controller_nginx_settings = var.public_ip_address == null || var.public_ip_address == "" ? local.ingress_controller_nginx_settings_without_static_ip : local.ingress_controller_nginx_settings_with_static_ip + pulsar_kaap_values = [ + file("${path.module}/config/pulsar-kaap/values.yaml") + ] + streamx_operator_image_pull_secret_registry_email = var.streamx_operator_image_pull_secret_registry_email + streamx_operator_image_pull_secret_registry_password = var.streamx_operator_image_pull_secret_registry_password + streamx_operator_chart_repository_username = "_json_key_base64" + streamx_operator_chart_repository_password = var.streamx_operator_image_pull_secret_registry_password + ingress_controller_nginx_timeout = 300 + cert_manager_timeout = 300 + pulsar_kaap_timeout = 300 + streamx_operator_timeout = 300 + depends_on = [module.cluster] +} \ No newline at end of file diff --git a/terraform/ovh/platform/outputs.tf b/terraform/ovh/platform/outputs.tf new file mode 100644 index 00000000..886b56ef --- /dev/null +++ b/terraform/ovh/platform/outputs.tf @@ -0,0 +1,15 @@ +output "kubeconfig_path" { + description = "K8s cluster kubeconfig file path" + value = module.cluster.kubeconfig_path +} + +output "kubeconfig" { + description = "K8s cluster kubeconfig" + value = module.cluster.kubeconfig + sensitive = true +} + +output "loadbalancer_ip" { + description = "K8s cluster Load Balancer IP" + value = module.streamx.loadbalancer_ip +} \ No newline at end of file diff --git a/terraform/ovh/platform/providers.tf b/terraform/ovh/platform/providers.tf new file mode 100644 index 00000000..302dc5c6 --- /dev/null +++ b/terraform/ovh/platform/providers.tf @@ -0,0 +1,28 @@ +provider "ovh" { + # TODO ADD you OVH credentials +} + + +provider "kubernetes" { + host = module.cluster.host + client_certificate = module.cluster.client_certificate + client_key = module.cluster.client_key + cluster_ca_certificate = module.cluster.cluster_ca_certificate +} + +provider "helm" { + kubernetes { + host = module.cluster.host + client_certificate = module.cluster.client_certificate + client_key = module.cluster.client_key + cluster_ca_certificate = module.cluster.cluster_ca_certificate + } +} + +provider "kubectl" { + load_config_file = false + host = module.cluster.host + client_certificate = module.cluster.client_certificate + client_key = module.cluster.client_key + cluster_ca_certificate = module.cluster.cluster_ca_certificate +} diff --git a/terraform/ovh/platform/variables.tf b/terraform/ovh/platform/variables.tf new file mode 100644 index 00000000..00a59278 --- /dev/null +++ b/terraform/ovh/platform/variables.tf @@ -0,0 +1,48 @@ +variable "service_name" { + description = "The id of the public OVH cloud project" + type = string +} + +variable "cluster_name" { + default = "streamx" + description = "The name of the kubernetes cluster." + type = string +} + +variable "region" { + default = "waw1" + description = "Region of cloud deployment" + type = string +} + +variable "network_id" { + description = "Network id to attach cluster" + type = string +} + +variable "nodes_subnet_id" { + description = "Nodes subnet ID" + type = string +} + +variable "cert_manager_lets_encrypt_issuer_acme_email" { + description = "Email passed to acme server." + type = string +} + +variable "streamx_operator_image_pull_secret_registry_email" { + description = "StreamX Operator container image registry user email." + type = string +} + +variable "streamx_operator_image_pull_secret_registry_password" { + description = "StreamX Operator container image registry user password." + type = string + sensitive = true +} + +variable "public_ip_address" { + default = null + description = "Public IP address" + type = string +} diff --git a/terraform/ovh/platform/versions.tf b/terraform/ovh/platform/versions.tf new file mode 100644 index 00000000..a9964b6b --- /dev/null +++ b/terraform/ovh/platform/versions.tf @@ -0,0 +1,13 @@ +terraform { + required_version = ">= 1.0.0" + required_providers { + kubectl = { + source = "gavinbunney/kubectl" + version = "~> 1.14.0" + } + ovh = { + source = "ovh/ovh" + version = "~> 1.4.0" + } + } +} \ No newline at end of file diff --git a/terraform/ovh/state-backend/main.tf b/terraform/ovh/state-backend/main.tf new file mode 100644 index 00000000..caf7f7f3 --- /dev/null +++ b/terraform/ovh/state-backend/main.tf @@ -0,0 +1,11 @@ +module "tf_state_backend" { + source ="/Users/andrzej/repo/terraform-ovh-platform/modules/state-backend" + ovh_public_cloud_project_id = var.service_name + region = var.region + bucket_name=var.bucket_name + s3_endpoint=var.s3_endpoint + tf_backends = { + "platform.tfstate" : "${path.module}/../platform/backend.tf" + "network.tfstate" : "${path.module}/../network/backend.tf" + } +} diff --git a/terraform/ovh/state-backend/outputs.tf b/terraform/ovh/state-backend/outputs.tf new file mode 100644 index 00000000..7ef463a8 --- /dev/null +++ b/terraform/ovh/state-backend/outputs.tf @@ -0,0 +1,15 @@ +output "access_key" { + description = "The access key created by the terraform script. To be used as `AWS_ACCESS_KEY_ID` ENV variable for Terraform S3 backend configuration." + value = module.tf_state_backend.access_key +} + +output "secret_key" { + description = "The secret key created by the terraform script. To be used as `AWS_SECRET_ACCESS_KEY` ENV variable for Terraform S3 backend configuration." + value = module.tf_state_backend.secret_key + sensitive = true +} + +output "tf_state_backend_config" { + description = "The Terraform state backend configuration that is set up to utilize a bucket created by this module." + value = module.tf_state_backend.tf_state_backend_config +} \ No newline at end of file diff --git a/terraform/ovh/state-backend/providers.tf b/terraform/ovh/state-backend/providers.tf new file mode 100644 index 00000000..9d815fba --- /dev/null +++ b/terraform/ovh/state-backend/providers.tf @@ -0,0 +1,3 @@ +provider "ovh" { + # TODO ADD you OVH credentials +} diff --git a/terraform/ovh/state-backend/variables.tf b/terraform/ovh/state-backend/variables.tf new file mode 100644 index 00000000..82de927a --- /dev/null +++ b/terraform/ovh/state-backend/variables.tf @@ -0,0 +1,22 @@ +variable "service_name" { + description = "The id of the public OVH cloud project" + type = string +} + +variable "region" { + default = "waw" + description = "S3 bucket location from [list](https://help.ovhcloud.com/csm/en-ie-public-cloud-storage-s3-location?id=kb_article_view&sysparm_article=KB0047393)" + type = string +} + +variable "s3_endpoint" { + default = "https://s3.waw.io.cloud.ovh.net/" + description = "OVH S3 endpoint from from [list](https://help.ovhcloud.com/csm/en-ie-public-cloud-storage-s3-location?id=kb_article_view&sysparm_article=KB0047393)" + type = string +} + +variable "bucket_name" { + default = "streamx-commerce-accelerator-bucket" + description = "S3 bucket name" + type = string +} diff --git a/terraform/ovh/state-backend/versions.tf b/terraform/ovh/state-backend/versions.tf new file mode 100644 index 00000000..a9964b6b --- /dev/null +++ b/terraform/ovh/state-backend/versions.tf @@ -0,0 +1,13 @@ +terraform { + required_version = ">= 1.0.0" + required_providers { + kubectl = { + source = "gavinbunney/kubectl" + version = "~> 1.14.0" + } + ovh = { + source = "ovh/ovh" + version = "~> 1.4.0" + } + } +} \ No newline at end of file From 897e1c6da66073d398602063fb587501c1378ec6 Mon Sep 17 00:00:00 2001 From: andrzejmikolajczakds Date: Tue, 18 Mar 2025 11:30:39 +0100 Subject: [PATCH 2/2] DXP-1611 WIP add copyright PR uses hardcoded local disk paths to terraform-ovh-platform --- terraform/ovh/network/main.tf | 15 ++++++++++++++ terraform/ovh/network/outputs.tf | 16 +++++++++++++++ terraform/ovh/network/providers.tf | 16 +++++++++++++++ terraform/ovh/network/variables.tf | 16 +++++++++++++++ terraform/ovh/network/versions.tf | 26 +++++++++++++++++++----- terraform/ovh/platform/main.tf | 18 +++++++++++++++- terraform/ovh/platform/outputs.tf | 16 +++++++++++++++ terraform/ovh/platform/providers.tf | 16 +++++++++++++++ terraform/ovh/platform/variables.tf | 16 +++++++++++++++ terraform/ovh/platform/versions.tf | 18 +++++++++++++++- terraform/ovh/state-backend/main.tf | 16 +++++++++++++++ terraform/ovh/state-backend/outputs.tf | 15 ++++++++++++++ terraform/ovh/state-backend/providers.tf | 16 +++++++++++++++ terraform/ovh/state-backend/variables.tf | 16 +++++++++++++++ terraform/ovh/state-backend/versions.tf | 25 ++++++++++++++++++----- 15 files changed, 249 insertions(+), 12 deletions(-) diff --git a/terraform/ovh/network/main.tf b/terraform/ovh/network/main.tf index 840060ac..4dcf11ae 100644 --- a/terraform/ovh/network/main.tf +++ b/terraform/ovh/network/main.tf @@ -1,3 +1,18 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + module "tf_network" { source ="/Users/andrzej/repo/terraform-ovh-platform/modules/network" service_name = var.service_name diff --git a/terraform/ovh/network/outputs.tf b/terraform/ovh/network/outputs.tf index 1d3c1d80..003ebfb4 100644 --- a/terraform/ovh/network/outputs.tf +++ b/terraform/ovh/network/outputs.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + output "floatingip" { description = "Allocated floating IP for future usage" value = module.tf_network.floatingip diff --git a/terraform/ovh/network/providers.tf b/terraform/ovh/network/providers.tf index 3c22dd37..1ea4f5aa 100644 --- a/terraform/ovh/network/providers.tf +++ b/terraform/ovh/network/providers.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + provider "ovh" { # TODO ADD you OVH credentials diff --git a/terraform/ovh/network/variables.tf b/terraform/ovh/network/variables.tf index 9b1a5723..353c08ce 100644 --- a/terraform/ovh/network/variables.tf +++ b/terraform/ovh/network/variables.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + variable "service_name" { description = "The id of the public OVH cloud project" type = string diff --git a/terraform/ovh/network/versions.tf b/terraform/ovh/network/versions.tf index a9964b6b..8c813cc7 100644 --- a/terraform/ovh/network/versions.tf +++ b/terraform/ovh/network/versions.tf @@ -1,13 +1,29 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + terraform { required_version = ">= 1.0.0" required_providers { - kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.14.0" - } ovh = { source = "ovh/ovh" - version = "~> 1.4.0" + version = "~> 2.0.0" + } + openstack = { + source = "terraform-provider-openstack/openstack" + version = "~> 1.43.0" } } } \ No newline at end of file diff --git a/terraform/ovh/platform/main.tf b/terraform/ovh/platform/main.tf index b169ab25..0f32691a 100644 --- a/terraform/ovh/platform/main.tf +++ b/terraform/ovh/platform/main.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + module "cluster" { source = "/Users/andrzej/repo/terraform-ovh-platform/modules/cluster" service_name = var.service_name @@ -21,7 +37,7 @@ locals { module "streamx" { source = "streamx-dev/charts/helm" - version = "0.0.1" + version = "0.0.4" cert_manager_lets_encrypt_issuer_acme_email = var.cert_manager_lets_encrypt_issuer_acme_email ingress_controller_nginx_settings = var.public_ip_address == null || var.public_ip_address == "" ? local.ingress_controller_nginx_settings_without_static_ip : local.ingress_controller_nginx_settings_with_static_ip diff --git a/terraform/ovh/platform/outputs.tf b/terraform/ovh/platform/outputs.tf index 886b56ef..9f81c437 100644 --- a/terraform/ovh/platform/outputs.tf +++ b/terraform/ovh/platform/outputs.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + output "kubeconfig_path" { description = "K8s cluster kubeconfig file path" value = module.cluster.kubeconfig_path diff --git a/terraform/ovh/platform/providers.tf b/terraform/ovh/platform/providers.tf index 302dc5c6..56138c3a 100644 --- a/terraform/ovh/platform/providers.tf +++ b/terraform/ovh/platform/providers.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + provider "ovh" { # TODO ADD you OVH credentials } diff --git a/terraform/ovh/platform/variables.tf b/terraform/ovh/platform/variables.tf index 00a59278..50bae097 100644 --- a/terraform/ovh/platform/variables.tf +++ b/terraform/ovh/platform/variables.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + variable "service_name" { description = "The id of the public OVH cloud project" type = string diff --git a/terraform/ovh/platform/versions.tf b/terraform/ovh/platform/versions.tf index a9964b6b..e97b7e29 100644 --- a/terraform/ovh/platform/versions.tf +++ b/terraform/ovh/platform/versions.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + terraform { required_version = ">= 1.0.0" required_providers { @@ -7,7 +23,7 @@ terraform { } ovh = { source = "ovh/ovh" - version = "~> 1.4.0" + version = "~> 2.0.0" } } } \ No newline at end of file diff --git a/terraform/ovh/state-backend/main.tf b/terraform/ovh/state-backend/main.tf index caf7f7f3..e265c0dc 100644 --- a/terraform/ovh/state-backend/main.tf +++ b/terraform/ovh/state-backend/main.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + module "tf_state_backend" { source ="/Users/andrzej/repo/terraform-ovh-platform/modules/state-backend" ovh_public_cloud_project_id = var.service_name diff --git a/terraform/ovh/state-backend/outputs.tf b/terraform/ovh/state-backend/outputs.tf index 7ef463a8..d9f8a1b1 100644 --- a/terraform/ovh/state-backend/outputs.tf +++ b/terraform/ovh/state-backend/outputs.tf @@ -1,3 +1,18 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + output "access_key" { description = "The access key created by the terraform script. To be used as `AWS_ACCESS_KEY_ID` ENV variable for Terraform S3 backend configuration." value = module.tf_state_backend.access_key diff --git a/terraform/ovh/state-backend/providers.tf b/terraform/ovh/state-backend/providers.tf index 9d815fba..f2d984aa 100644 --- a/terraform/ovh/state-backend/providers.tf +++ b/terraform/ovh/state-backend/providers.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + provider "ovh" { # TODO ADD you OVH credentials } diff --git a/terraform/ovh/state-backend/variables.tf b/terraform/ovh/state-backend/variables.tf index 82de927a..d0379d23 100644 --- a/terraform/ovh/state-backend/variables.tf +++ b/terraform/ovh/state-backend/variables.tf @@ -1,3 +1,19 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + variable "service_name" { description = "The id of the public OVH cloud project" type = string diff --git a/terraform/ovh/state-backend/versions.tf b/terraform/ovh/state-backend/versions.tf index a9964b6b..4f419ec9 100644 --- a/terraform/ovh/state-backend/versions.tf +++ b/terraform/ovh/state-backend/versions.tf @@ -1,13 +1,28 @@ +# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + terraform { - required_version = ">= 1.0.0" + required_version = ">= 1.8.1" required_providers { - kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.14.0" + aws = { + source = "hashicorp/aws" + version = "~> 5.89.0" } ovh = { source = "ovh/ovh" - version = "~> 1.4.0" + version = "~> 2.0.0" } } } \ No newline at end of file