Add Contabo IAC configuration and workflows for OpenTofu integration
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "a13labs.infra.eu"
|
||||
key = "contabo.core.infra.tfstate"
|
||||
region = "eu-west-1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
resource "contabo_instance" "vps_1" {
|
||||
}
|
||||
|
||||
import {
|
||||
id = "201912751"
|
||||
to = contabo_instance.vps_1
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
output "instances" {
|
||||
value = [
|
||||
{
|
||||
cpu_cores = contabo_instance.vps_1.cpu_cores
|
||||
disk_mb = contabo_instance.vps_1.disk_mb
|
||||
id = contabo_instance.vps_1.id
|
||||
image_id = contabo_instance.vps_1.image_id
|
||||
ip_config = contabo_instance.vps_1.ip_config
|
||||
mac_address = contabo_instance.vps_1.mac_address
|
||||
name = contabo_instance.vps_1.name
|
||||
os_type = contabo_instance.vps_1.os_type
|
||||
ram_mb = contabo_instance.vps_1.ram_mb
|
||||
v_host_id = contabo_instance.vps_1.v_host_id
|
||||
},
|
||||
]
|
||||
description = "VPS instances details"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
terraform {
|
||||
required_version = "~>1.8"
|
||||
required_providers {
|
||||
contabo = {
|
||||
source = "contabo/contabo"
|
||||
version = ">= 0.1.31"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "contabo" {
|
||||
oauth2_client_id = var.contabo_client_id
|
||||
oauth2_client_secret = var.contabo_client_secret
|
||||
oauth2_user = var.contabo_api_user
|
||||
oauth2_pass = var.contabo_api_password
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY
|
||||
AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY
|
||||
TF_VAR_contabo_client_id=$CONTABO_CLIENT_ID
|
||||
TF_VAR_contabo_client_secret=$CONTABO_CLIENT_SECRET
|
||||
TF_VAR_contabo_api_password=$CONTABO_API_PASSWORD
|
||||
TF_VAR_contabo_api_user=$CONTABO_USER_NAME
|
||||
@@ -0,0 +1,23 @@
|
||||
variable "contabo_client_id" {
|
||||
description = "Contabo Client ID"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "contabo_client_secret" {
|
||||
description = "Contabo Client Secret"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "contabo_api_password" {
|
||||
description = "Contabo API Password"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "contabo_api_user" {
|
||||
description = "Contabo API User"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
Reference in New Issue
Block a user