mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
feat: move from terraform to opentofu. hashicorp sucks
This commit is contained in:
parent
9a499d2f80
commit
c3f8606e6f
10 changed files with 47 additions and 41 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -10,3 +10,5 @@ data/
|
|||
.terraform.lock.hcl
|
||||
.idea/
|
||||
__pycache__/
|
||||
tf/terraform.tfvars
|
||||
tf/terraform.tfstate.backup
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ with pkgs; let
|
|||
git-hooks = systemless-git-hooks pkgs.system;
|
||||
repoShell = mkShell {
|
||||
nativeBuildInputs = [
|
||||
opentofu
|
||||
nf-build-system
|
||||
nf-update
|
||||
pkgs.lix
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
sops -d ./tf.tfvars.sops > tf.tfvars
|
||||
export TF_CLI_ARGS="--var-file=tf.tfvars"
|
||||
sops -d ./terraform.tfvars.sops > terraform.tfvars
|
||||
use flake
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ locals {
|
|||
micro : "VM.Standard.E2.1.Micro",
|
||||
}
|
||||
|
||||
availability_domain_micro = one(
|
||||
/*availability_domain_micro = one(
|
||||
[
|
||||
for m in data.oci_core_shapes.this :
|
||||
m.availability_domain
|
||||
if contains(m.shapes[*].name, local.shapes.micro)
|
||||
]
|
||||
)
|
||||
)*/
|
||||
}
|
||||
|
||||
variable "tenancy_ocid" {
|
||||
|
|
@ -29,6 +29,7 @@ variable "subnet_id" {
|
|||
type = any
|
||||
}
|
||||
|
||||
/*
|
||||
data "oci_identity_availability_domains" "this" {
|
||||
compartment_id = var.tenancy_ocid
|
||||
}
|
||||
|
|
@ -40,3 +41,4 @@ data "oci_core_shapes" "this" {
|
|||
|
||||
availability_domain = each.key
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ locals {
|
|||
}
|
||||
|
||||
resource "oci_core_instance" "that" {
|
||||
availability_domain = data.oci_identity_availability_domains.this.availability_domains.0.name
|
||||
availability_domain = "dBWL:CA-TORONTO-1-AD-1" #data.oci_identity_availability_domains.this.availability_domains.0.name
|
||||
compartment_id = var.tenancy_ocid
|
||||
shape = local.shapes.flex
|
||||
|
||||
|
|
@ -65,7 +65,10 @@ resource "oci_core_instance" "that" {
|
|||
}
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [source_details.0.source_id]
|
||||
ignore_changes = [
|
||||
metadata,
|
||||
source_details.0.source_id
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ variable "micro_display_names" {
|
|||
resource "oci_core_instance" "this" {
|
||||
count = 2
|
||||
|
||||
availability_domain = local.availability_domain_micro
|
||||
availability_domain = "dBWL:CA-TORONTO-1-AD-1"
|
||||
compartment_id = var.tenancy_ocid
|
||||
shape = local.shapes.micro
|
||||
|
||||
|
|
@ -64,7 +64,10 @@ resource "oci_core_instance" "this" {
|
|||
}
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [source_details.0.source_id]
|
||||
ignore_changes = [
|
||||
metadata,
|
||||
source_details.0.source_id
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
variable "passphrase" {
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
# Vendor: Hashicorp
|
||||
|
|
@ -23,28 +27,23 @@ terraform {
|
|||
version = "4.4.0"
|
||||
}
|
||||
}
|
||||
encryption {
|
||||
method "unencrypted" "migrate" {}
|
||||
|
||||
/*
|
||||
# Settings for local applies
|
||||
backend "remote" {
|
||||
hostname = "app.terraform.io"
|
||||
organization = "kittywitch"
|
||||
workspaces {
|
||||
name = "nixfiles"
|
||||
key_provider "pbkdf2" "kw" {
|
||||
passphrase = var.passphrase
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#/*
|
||||
# Settings for remote applies
|
||||
cloud {
|
||||
organization = "kittywitch"
|
||||
## Required for Terraform Enterprise; Defaults to app.terraform.io for Terraform Cloud
|
||||
hostname = "app.terraform.io"
|
||||
method "aes_gcm" "kw" {
|
||||
keys = key_provider.pbkdf2.kw
|
||||
}
|
||||
|
||||
workspaces {
|
||||
name = "nixfiles"
|
||||
state {
|
||||
method = method.aes_gcm.kw
|
||||
|
||||
fallback {
|
||||
method = method.unencrypted.migrate
|
||||
}
|
||||
}
|
||||
}
|
||||
#*/
|
||||
}
|
||||
|
|
|
|||
1
tf/terraform.tfstate
Normal file
1
tf/terraform.tfstate
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue