mirror of
https://github.com/optim-enterprises-bv/terraform-talos.git
synced 2025-11-02 11:18:35 +00:00
split upload os image
This commit is contained in:
12
oracle/images/auth.tf
Normal file
12
oracle/images/auth.tf
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
# openssl genrsa -out ~/.oci/oci_api_key.pem 2048
|
||||
# chmod go-rwx ~/.oci/oci_api_key.pem
|
||||
# openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
|
||||
|
||||
provider "oci" {
|
||||
tenancy_ocid = var.tenancy_ocid
|
||||
user_ocid = var.user_ocid
|
||||
fingerprint = var.fingerprint
|
||||
private_key_path = var.key_file
|
||||
region = var.region
|
||||
}
|
||||
@@ -6,7 +6,7 @@ resource "random_id" "backet" {
|
||||
resource "oci_objectstorage_bucket" "images" {
|
||||
compartment_id = var.compartment_ocid
|
||||
namespace = data.oci_objectstorage_namespace.ns.namespace
|
||||
name = "${var.project}-images-${random_id.backet.hex}"
|
||||
name = "talos-images-${random_id.backet.hex}"
|
||||
access_type = "NoPublicAccess"
|
||||
auto_tiering = "Disabled"
|
||||
}
|
||||
4
oracle/images/common.tf
Normal file
4
oracle/images/common.tf
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
data "oci_objectstorage_namespace" "ns" {
|
||||
compartment_id = var.compartment_ocid
|
||||
}
|
||||
14
oracle/images/variables.tf
Normal file
14
oracle/images/variables.tf
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
variable "compartment_ocid" {}
|
||||
variable "tenancy_ocid" {}
|
||||
variable "user_ocid" {}
|
||||
variable "fingerprint" {}
|
||||
variable "key_file" {
|
||||
default = "~/.oci/oci_public.pem"
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
description = "the OCI region where resources will be created"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
9
oracle/images/versions.tf
Normal file
9
oracle/images/versions.tf
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
oci = {
|
||||
source = "hashicorp/oci"
|
||||
version = "4.56.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,6 @@ data "oci_identity_availability_domains" "main" {
|
||||
compartment_id = var.compartment_ocid
|
||||
}
|
||||
|
||||
data "oci_objectstorage_namespace" "ns" {
|
||||
compartment_id = var.compartment_ocid
|
||||
}
|
||||
|
||||
locals {
|
||||
zones = [for ad in data.oci_identity_availability_domains.main.availability_domains : ad.name]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user