├── .github ├── FUNDING.yml └── workflows │ └── diagram.yml ├── terraform-provider-civo ├── k8s │ ├── k3s │ │ └── README.md │ └── talos │ │ ├── .gitignore │ │ ├── civo_object_store-template.tf │ │ ├── kubernetes_secret_object_store.tf │ │ ├── network.tf │ │ ├── civo_firewall-cluster.tf │ │ ├── civo_firewall-ingress.tf │ │ ├── node_pools.tf │ │ ├── helm_ingress_traefik.tf │ │ ├── kubernetes_deployment-nginx.tf │ │ ├── data_source.tf │ │ ├── terraform.tfvars.example │ │ ├── cluster-tools.tf │ │ ├── output.tf │ │ ├── cluster.tf │ │ └── prometheus.tf └── launch-instance │ └── RAEDME.md ├── terraform-provider-gcp ├── create-vpc │ ├── test.txt │ ├── variables.tf │ └── outputs.tf ├── launch-instance │ ├── test.txt │ ├── cloud-init │ │ ├── ubto_userdata.txt │ │ ├── sles_userdata.txt │ │ ├── centos_userdata.txt │ │ ├── olinux_userdata.txt │ │ ├── rhel_userdata.txt │ │ ├── el_userdata.txt │ │ ├── Win_userdata.txt │ │ ├── Win_userdata.ps │ │ └── Win_userdata.ps1 │ └── outputs.tf ├── README.md └── terraexpressions.sh ├── terraform-provider-oci ├── oke-quickstartz │ ├── VERSION │ ├── modules │ │ ├── cluster-tools │ │ │ ├── jaeger.tf │ │ │ ├── keycloak.tf │ │ │ ├── redis.tf │ │ │ ├── postgresql.tf │ │ │ ├── modules │ │ │ │ ├── cert-manager │ │ │ │ │ ├── issuers │ │ │ │ │ │ ├── templates │ │ │ │ │ │ │ ├── NOTES.txt │ │ │ │ │ │ │ ├── _helpers.tpl │ │ │ │ │ │ │ └── clusterissuers.yaml │ │ │ │ │ │ ├── values.yaml │ │ │ │ │ │ └── Chart.yaml │ │ │ │ │ ├── variables.tf │ │ │ │ │ ├── providers.tf │ │ │ │ │ ├── versions.tf │ │ │ │ │ └── test.yaml │ │ │ │ └── verrazzano │ │ │ │ │ ├── main.tf │ │ │ │ │ ├── variables.tf │ │ │ │ │ └── providers.tf │ │ │ ├── cert-manager.tf │ │ │ ├── providers.tf │ │ │ ├── metrics-server.tf │ │ │ ├── prometheus.tf │ │ │ └── cluster-tools.tf │ │ ├── oci-networking │ │ │ ├── vcn │ │ │ │ ├── datasources.tf │ │ │ │ ├── providers.tf │ │ │ │ ├── main.tf │ │ │ │ ├── outputs.tf │ │ │ │ └── variables.tf │ │ │ ├── route_table │ │ │ │ ├── outputs.tf │ │ │ │ ├── providers.tf │ │ │ │ ├── main.tf │ │ │ │ └── variables.tf │ │ │ ├── gateway │ │ │ │ ├── datasources.tf │ │ │ │ ├── providers.tf │ │ │ │ ├── outputs.tf │ │ │ │ └── main.tf │ │ │ ├── subnet │ │ │ │ ├── outputs.tf │ │ │ │ ├── providers.tf │ │ │ │ └── main.tf │ │ │ ├── security_list │ │ │ │ ├── outputs.tf │ │ │ │ └── providers.tf │ │ │ └── README.md │ │ ├── oke-cluster-autoscaler │ │ │ ├── datasources.tf │ │ │ └── versions.tf │ │ ├── oci-vault-kms │ │ │ ├── outputs.tf │ │ │ ├── providers.tf │ │ │ └── main.tf │ │ ├── oci-policies │ │ │ ├── outputs.tf │ │ │ ├── versions.tf │ │ │ └── main.tf │ │ ├── oke │ │ │ ├── versions.tf │ │ │ ├── datasources.tf │ │ │ ├── oke-orm-private-endpoint.tf │ │ │ ├── outputs.tf │ │ │ └── LICENSE │ │ ├── oke-node-pool │ │ │ ├── versions.tf │ │ │ ├── outputs.tf │ │ │ └── datasources.tf │ │ └── bastion │ │ │ ├── variables.tf │ │ │ └── bastion.tf │ ├── gitignore │ ├── original_FAQs.md │ ├── datasources.tf │ ├── env-vars │ ├── terraform.tfvars │ ├── versions.tf │ └── outputs.tf ├── compartments │ ├── modules │ │ ├── iam-compartment │ │ │ ├── versions.tf │ │ │ ├── main.tf │ │ │ ├── variables.tf │ │ │ └── output.tf │ │ └── modules.json │ ├── terraform.tfvars.template │ ├── .gitignore │ ├── variables.tf │ └── output.tf ├── publicIPs │ ├── .gitignore │ ├── terraform.tfvars.template │ ├── output.tf │ ├── publicip.tf │ └── variables.tf ├── create-vcn │ ├── terraform.tfvars.template │ ├── env-vars │ ├── variables.tf │ └── outputs.tf ├── database-system │ ├── storage.tf.old │ ├── terraform.tfvars │ ├── bastion.tf │ ├── database.tf │ └── datasources.tf ├── launch-instance │ ├── terraform.tfvars.template │ ├── env-vars │ ├── outputs.tf │ └── cloud-init │ │ └── vm.cloud-config └── README.md ├── .vscode └── settings.json ├── terraform-provider-azure ├── image │ └── naming_conv.png ├── create-vnet │ ├── variables.tf │ └── outputs.tf ├── README.md ├── launch-instance │ ├── cloud-init │ │ ├── ubto_userdata.txt │ │ ├── sles_userdata.txt │ │ ├── centos_userdata.txt │ │ ├── olinux_userdata.txt │ │ ├── rhel_userdata.txt │ │ ├── el_userdata.txt │ │ ├── Win_userdata.txt │ │ ├── Win_userdata.ps │ │ └── Win_userdata.ps1 │ └── outputs.tf └── terraexpressions.sh ├── terraform-provider-alicloud ├── create-vpc │ ├── terraform.tfvars │ └── variables.tf ├── launch-instance │ ├── terraform.tfvars │ └── cloud-init │ │ ├── ubto_userdata.txt │ │ ├── sles_userdata.txt │ │ ├── vm.cloud-config │ │ ├── centos_userdata.txt │ │ ├── el_userdata.txt │ │ ├── olinux_userdata.txt │ │ ├── rhel_userdata.txt │ │ ├── Win_userdata.txt │ │ ├── Win_userdata.ps │ │ └── Win_userdata.ps1 └── README.md ├── terraform-provider-libvirt ├── cloud_init.cfg └── kvm-compute.tf ├── azure-pipelines.yml ├── oci_devops ├── command_spec.yaml └── deploy_spec.yaml ├── terraform-provider-aws ├── create-vpc │ └── variables.tf ├── README.md ├── launch-instance │ └── cloud-init │ │ ├── ubto_userdata.txt │ │ ├── amzl_userdata.txt │ │ ├── sles_userdata.txt │ │ ├── el_userdata.txt │ │ ├── vm.cloud-config │ │ └── Win_userdata.txt ├── create-vpc-dynamic │ ├── README.md │ └── variables.tf └── terraexpressions.sh └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: kosseila_hd 2 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/k3s/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /terraform-provider-gcp/create-vpc/test.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/test.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/VERSION: -------------------------------------------------------------------------------- 1 | 0.9.3 -------------------------------------------------------------------------------- /terraform-provider-civo/launch-instance/RAEDME.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/jaeger.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/keycloak.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/redis.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/postgresql.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "githubPullRequests.ignoredPullRequestBranches": [ 3 | "master" 4 | ] 5 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/issuers/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | # 2 | 3 | Stuff -------------------------------------------------------------------------------- /terraform-provider-azure/image/naming_conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokedba/terraform-examples/HEAD/terraform-provider-azure/image/naming_conv.png -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/issuers/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Return the name of an Issuer or ClusterIssuer 3 | */}} 4 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/issuers/values.yaml: -------------------------------------------------------------------------------- 1 | issuer: 2 | 3 | # Used for ACME registration (if TLS is set) 4 | email: "no-reply@ateam-oracle.com" 5 | -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/modules/iam-compartment/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | oci = { 4 | source = "oracle/oci" 5 | version = ">=4.67.3" 6 | } 7 | } 8 | required_version = ">= 1.0.0" 9 | } 10 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/create-vpc/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # AliCloud Infrastructure Authentication 2 | ali_access_key = "xxxxxxxxxxxxx" # CHANGE ME 3 | ali_secret_key = "xxxxxxxxxxxxx" # CHANGE ME 4 | 5 | # Region 6 | # ali_region = "us-east-1" #"cn-hongkong-b" # CHANGE ME 7 | 8 | -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/modules/modules.json: -------------------------------------------------------------------------------- 1 | {"Modules":[{"Key":"","Source":"","Dir":"."},{"Key":"level_1_sub_compartments","Source":"./modules/iam-compartment","Dir":"./modules/iam-compartment"},{"Key":"level_2_sub_compartments","Source":"./modules/iam-compartment","Dir":"./modules/iam-compartment"}]} -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/issuers/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: issuers 3 | description: cert-manager ClusterIssuer and Issuer resources, simplified for use with terraform helm provider 4 | 5 | type: application 6 | version: 0.1.0 7 | appVersion: "1" 8 | -------------------------------------------------------------------------------- /terraform-provider-libvirt/cloud_init.cfg: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | disable_root: 0 3 | users: 4 | - name: root 5 | ssh-authorized-keys: 6 | - ${file("~/.ssh/id_rsa.pub")} 7 | ssh_pwauth: True 8 | chpasswd: 9 | list: | 10 | root:unix1234 11 | expire: False 12 | runcmd: 13 | - hostnamectl set-hostname terracentos -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/terraform.tfvars.template: -------------------------------------------------------------------------------- 1 | user_ocid = "ocid1.user.oc1.." #CHANGE ME 2 | fingerprint = "1c.." #CHANGE ME 3 | private_key_path = "~/.oci/oci_api_key.pem" #CHANGE ME 4 | tenancy_ocid = "ocid1.tenancy.oc1.." #CHANGE ME 5 | region = "us-ashburn-1" #CHANGE ME -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | **/*.tfstate* 4 | **/*.out 5 | **/.terraform.* 6 | **/terraform.tfvars 7 | 8 | # .tfstate files 9 | *.tfstate 10 | *.tfstate.* 11 | 12 | # .tfvars files 13 | *.tfvars 14 | 15 | # Local Files 16 | **/.DS_Store 17 | **/crash.log 18 | **/.csv 19 | *.pem 20 | test/** 21 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | **/*.tfstate* 4 | **/*.out 5 | **/.terraform.* 6 | **/terraform.tfvars 7 | 8 | # .tfstate files 9 | *.tfstate 10 | *.tfstate.* 11 | 12 | # .tfvars files 13 | *.tfvars 14 | *env-vars 15 | 16 | # Local Files 17 | **/.DS_Store 18 | **/crash.log 19 | **/.csv 20 | *.pem 21 | test/** -------------------------------------------------------------------------------- /terraform-provider-oci/publicIPs/.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | **/*.tfstate* 4 | **/*.out 5 | **/.terraform.* 6 | **/terraform.tfvars 7 | 8 | # .tfstate files 9 | *.tfstate 10 | *.tfstate.* 11 | 12 | # .tfvars files 13 | *.tfvars 14 | 15 | # Local Files 16 | **/.DS_Store 17 | **/crash.log 18 | **/.csv 19 | *.pem 20 | test/** -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | **/*.tfstate* 4 | **/*.out 5 | **/.terraform.* 6 | **/terraform.tfvars 7 | 8 | # .tfstate files 9 | *.tfstate 10 | *.tfstate.* 11 | 12 | # .tfvars files 13 | *.tfvars 14 | *env-vars 15 | 16 | # Local Files 17 | **/.DS_Store 18 | **/crash.log 19 | **/.csv 20 | *.pem 21 | test/** 22 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/vcn/datasources.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | data "oci_core_vcn" "main_or_existent" { 6 | vcn_id = var.create_new_vcn ? oci_core_vcn.main[0].id : var.existent_vcn_ocid 7 | } -------------------------------------------------------------------------------- /terraform-provider-oci/create-vcn/terraform.tfvars.template: -------------------------------------------------------------------------------- 1 | tenancy_ocid = "ocid1.tenancy.oc1.." #CHANGE ME 2 | user_ocid = "ocid1.user.oc1...." #CHANGE ME 3 | fingerprint = ".." #CHANGE ME 4 | private_key_path = "~/oci_api_key.pem" #CHANGE ME 5 | compartment_ocid= "ocid1.compartment.oc1.." #CHANGE ME 6 | region = "ca-toronto-1" #CHANGE ME 7 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # AliCloud Infrastructure Authentication 2 | ali_access_key = "xxxxxxxxxxxxx" # CHANGE ME 3 | ali_secret_key = "xxxxxxxxxxxxx" # CHANGE ME 4 | 5 | ## ssh_public_key = "~/id_rsa.pub" # CHANGE ME 6 | 7 | ## Region 8 | ## ali_region = "us-east-1" # "cn-hongkong-b" # CHANGE ME 9 | 10 | -------------------------------------------------------------------------------- /terraform-provider-oci/publicIPs/terraform.tfvars.template: -------------------------------------------------------------------------------- 1 | user_ocid = "ocid1.user.oc1.." #CHANGE ME 2 | fingerprint = "1c.." #CHANGE ME 3 | private_key_path = "~/.oci/api_key.pem" #CHANGE ME 4 | tenancy_ocid = "ocid1.tenancy.oc1.." #CHANGE ME 5 | region = "ca-toronto-1" #CHANGE ME 6 | dr_region= "ca-montreal-1" #CHANGE ME -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke-cluster-autoscaler/datasources.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Gets supported Kubernetes versions for node pools 6 | data "oci_containerengine_node_pool_option" "node_pool" { 7 | node_pool_option_id = "all" 8 | } 9 | -------------------------------------------------------------------------------- /.github/workflows/diagram.yml: -------------------------------------------------------------------------------- 1 | name: Create diagram 2 | on: 3 | workflow_dispatch: {} 4 | push: 5 | branches: 6 | - master 7 | jobs: 8 | get_data: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout code 12 | uses: actions/checkout@master 13 | - name: Update diagram 14 | uses: githubocto/repo-visualizer@main 15 | with: 16 | excluded_paths: "ignore,.github" 17 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/route_table/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "route_table_id" { 6 | value = var.create_route_table ? oci_core_route_table.route_table[0].id : null 7 | description = "The OCID of the Route Table." 8 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-vault-kms/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "oci_vault_key_id" { 6 | value = var.use_encryption_from_oci_vault ? (var.create_new_encryption_key ? oci_kms_key.oke_key[0].id : var.existent_encryption_key_id) : null 7 | } -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/civo_object_store-template.tf: -------------------------------------------------------------------------------- 1 | resource "civo_object_store" "template" { 2 | count = var.object_store_enabled ? 1 : 0 3 | name = "${var.cluster_name_prefix}objectstore" 4 | max_size_gb = var.object_store_size 5 | } 6 | 7 | 8 | data "civo_object_store_credential" "object_store" { 9 | count = var.object_store_enabled ? 1 : 0 10 | id = civo_object_store.template[0].access_key_id 11 | } 12 | -------------------------------------------------------------------------------- /terraform-provider-oci/database-system/storage.tf.old: -------------------------------------------------------------------------------- 1 | data "oci_objectstorage_namespace" "ns" { 2 | compartment_id = var.compartment_ocid 3 | } 4 | 5 | 6 | resource "oci_objectstorage_bucket" "MyBucket" { 7 | #Required 8 | compartment_id = var.compartment_ocid 9 | name = var.bucket_name 10 | namespace = data.oci_objectstorage_namespace.ns.namespace 11 | freeform_tags = {"Project": "DBsys-Poc"} 12 | } 13 | -------------------------------------------------------------------------------- /terraform-provider-oci/launch-instance/terraform.tfvars.template: -------------------------------------------------------------------------------- 1 | user_ocid = "ocid1.user.oc1...." #CHANGE ME 2 | fingerprint = ".." #CHANGE ME 3 | private_key_path = "~/oci_api_key.pem" #CHANGE ME 4 | tenancy_ocid = "ocid1.tenancy.oc1.." #CHANGE ME 5 | region = "ca-toronto-1" #CHANGE ME 6 | compartment_ocid= "ocid1.compartment.oc1.." #CHANGE ME 7 | ssh_public_key = "~/id_rsa.pub" #CHANGE ME 8 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/gateway/datasources.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | ## Available Services 6 | data "oci_core_services" "all_services" { 7 | filter { 8 | name = "name" 9 | values = ["All .* Services In Oracle Services Network"] 10 | regex = true 11 | } 12 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/original_FAQs.md: -------------------------------------------------------------------------------- 1 | # Frequently asked questions 2 | 3 | 1. How do I delete the sample application and free up my resources ? 4 | 5 | On Stack details page, click on `Terraform Actions > Destroy`. This will delete and free up all the resources that were created by the application. 6 | 7 | If you see something issue that is not listed here or have a question for us, please [open an issue](https://github.com/oracle/terraform-oci-oke-quickstart/issues/new) and we will get back to you. 8 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Starter pipeline 2 | # Start with a minimal pipeline that you can customize to build and deploy your code. 3 | # Add steps that build, run tests, deploy, and more: 4 | # https://aka.ms/yaml 5 | 6 | trigger: 7 | - master 8 | 9 | pool: 10 | vmImage: ubuntu-latest 11 | 12 | steps: 13 | - script: echo Hello, world! 14 | displayName: 'Run a one-line script' 15 | 16 | - script: | 17 | echo Add other tasks to build, test, and deploy your project. 18 | echo See https://aka.ms/yaml 19 | displayName: 'Run a multi-line script' 20 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/subnet/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "subnet_id" { 6 | value = var.create_subnet ? oci_core_subnet.subnet[0].id : null 7 | description = "The OCID of the subnet." 8 | } 9 | output "subnet_name" { 10 | value = var.subnet_name 11 | description = "The reference name of the subnet. (Not the display name)" 12 | } -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/kubernetes_secret_object_store.tf: -------------------------------------------------------------------------------- 1 | resource "kubernetes_secret" "object_store_access" { 2 | count = var.object_store_enabled ? 1 : 0 3 | metadata { 4 | name = "object-store-access" 5 | namespace = "default" 6 | } 7 | 8 | data = { 9 | "region" = format("https://objectstore.%s.civo.com", lower(var.region)) 10 | "access_key" = data.civo_object_store_credential.object_store[0].access_key_id 11 | "secret_key" = data.civo_object_store_credential.object_store[0].secret_access_key 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-policies/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "dynamic_group_id" { 6 | value = try(oci_identity_dynamic_group.for_policies.0.id, null) 7 | } 8 | output "dynamic_group_name" { 9 | value = try(oci_identity_dynamic_group.for_policies.0.name, null) 10 | } 11 | output "compartment_policy_id" { 12 | value = try(oci_identity_policy.policies.0.id, null) 13 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/verrazzano/main.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Verrazzano Operator Helm Chart 6 | 7 | resource "helm_release" "v8o_operator" { 8 | name = "verrazzano-operator" 9 | chart = "${path.module}/charts/verrazzano-operator" 10 | namespace = var.chart_namespace 11 | 12 | set { 13 | name = "issuer.email" 14 | value = var.ingress_email_issuer 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/network.tf: -------------------------------------------------------------------------------- 1 | resource "civo_network" "network" { 2 | count = data.civo_network.existing.id == "" ? 1 : 0 3 | label = var.network_name 4 | cidr_v4 = var.network_cidr 5 | region = var.region 6 | } 7 | 8 | # Data Source: Attempt to retrieve existing network if network_id is provided 9 | data "civo_network" "existing" { 10 | label = var.network_name 11 | region = var.region 12 | } 13 | 14 | # Local Variable: Determine the effective network ID 15 | locals { 16 | network_id = data.civo_network.existing.id != "" ? data.civo_network.existing.id : civo_network.network[0].id 17 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/security_list/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "security_list_id" { 6 | value = var.create_security_list ? oci_core_security_list.security_list[0].id : null 7 | description = "The OCID of the security list." 8 | } 9 | output "security_list_name" { 10 | value = var.security_list_name 11 | description = "The reference name of the security list. (Not the display name)" 12 | } -------------------------------------------------------------------------------- /terraform-provider-oci/publicIPs/output.tf: -------------------------------------------------------------------------------- 1 | # display the Public Ips 2 | output "Toronto_public_ips" { 3 | description = "Shows all public IPs and their OCIDs in Primary site [Toronto]" 4 | value = { for ip,p in oci_core_public_ip.primary_firewall_public_ip : ip => format("name: %s IP:%s OCID:%s",p.display_name,p.ip_address, p.id) } 5 | } 6 | 7 | output "Montreal_public_ips" { 8 | description = "Shows all public IPs and their OCIDs in DR site [Montreal]" 9 | value = { for ip,p in oci_core_public_ip.dr_firewall_public_ip : ip => format("name: %s IP:%s OCID:%s",p.display_name,p.ip_address, p.id) } 10 | } -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/civo_firewall-cluster.tf: -------------------------------------------------------------------------------- 1 | # Create a firewall 2 | resource "civo_firewall" "firewall" { 3 | name = "${var.cluster_name_prefix}-firewall" 4 | create_default_rules = false 5 | network_id = local.network_id 6 | 7 | ingress_rule { 8 | label = "kubernetes-api-server" 9 | protocol = "tcp" 10 | port_range = "6443" 11 | cidr = var.kubernetes_api_access 12 | action = "allow" 13 | } 14 | egress_rule { 15 | label = "all" 16 | protocol = "tcp" 17 | port_range = "1-65535" 18 | cidr = ["0.0.0.0/0"] 19 | action = "allow" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/vcn/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 4" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | local = { 14 | source = "hashicorp/local" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/local/ 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/gateway/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 4" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | local = { 14 | source = "hashicorp/local" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/local/ 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/subnet/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 4" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | local = { 14 | source = "hashicorp/local" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/local/ 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/route_table/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 4" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | local = { 14 | source = "hashicorp/local" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/local/ 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke/versions.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 5" #"~> 4, < 5" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | local = { 14 | source = "hashicorp/local" 15 | version = ">= 2" #"~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/local/ 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/civo_firewall-ingress.tf: -------------------------------------------------------------------------------- 1 | # Create a firewall 2 | resource "civo_firewall" "firewall-ingress" { 3 | name = "${var.cluster_name_prefix}-firewall-ingress" 4 | create_default_rules = false 5 | network_id = local.network_id 6 | ingress_rule { 7 | protocol = "tcp" 8 | port_range = "80" 9 | cidr = var.cluster_web_access 10 | label = "web" 11 | action = "allow" 12 | } 13 | 14 | ingress_rule { 15 | protocol = "tcp" 16 | port_range = "443" 17 | cidr = var.cluster_websecure_access 18 | label = "websecure" 19 | action = "allow" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke-node-pool/versions.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.5" #">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 6" #"~> 4, < 5" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | local = { 14 | source = "hashicorp/local" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/local/ 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /terraform-provider-oci/database-system/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Oracle Cloud Infrastructure Authentication 2 | tenancy_ocid = "ocid1.tenancy.oc1.." # CHANGE ME 3 | user_ocid = "ocid1.user.oc1.." # CHANGE ME 4 | fingerprint = "1c:" # CHANGE ME 5 | private_key_path = "~/oci_api_key.pem" # CHANGE ME 6 | ssh_public_key = "~/oci_api_key_public.pem" # CHANGE ME 7 | compartment_ocid = "ocid1.compartment.oc1." # CHANGE ME 8 | # Region 9 | region = "ca-toronto-1" # CHANGE ME 10 | # AD 11 | availability_domain = "CA-TORONTO-1-AD-1" # CHANGE ME 12 | 13 | # Database Admin Password 14 | db_admin_password = "DBwelcome2022##" 15 | -------------------------------------------------------------------------------- /terraform-provider-azure/create-vnet/variables.tf: -------------------------------------------------------------------------------- 1 | # Azure account region and authentication 2 | variable "prefix" { 3 | description = "The prefix used for all resources in this example" 4 | } 5 | 6 | variable "az_location" { 7 | default = "eastus" 8 | } 9 | # VPC INFO 10 | variable "vnet_name" { 11 | default = "Terravnet" 12 | } 13 | 14 | variable "vnet_cidr" { 15 | default = "192.168.0.0/16" 16 | } 17 | 18 | # SUBNET INFO 19 | variable "subnet_name"{ 20 | default = "terrasub" 21 | } 22 | 23 | variable "subnet_cidr"{ 24 | default = "192.168.10.0/24" 25 | } 26 | variable "sg_name" { 27 | default = "terra_sg" 28 | } 29 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/security_list/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 4" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | local = { 14 | source = "hashicorp/local" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/local/ 17 | } 18 | } 19 | # experiments = [module_variable_optional_attrs] 20 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-vault-kms/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.5" # ">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 6" #"~> 4" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | configuration_aliases = [oci.home_region] 13 | } 14 | local = { 15 | source = "hashicorp/local" 16 | version = "~> 2" 17 | # https://registry.terraform.io/providers/hashicorp/local/ 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/README.md: -------------------------------------------------------------------------------- 1 | # OCI Networking module 2 | 3 | > __Warning__: Moved to [oracle-quickstart/terraform-oci-networking](https://github.com/oracle-quickstart/terraform-oci-networking). Sub modules with specific OCI Networking resource also available. example: [Virtual Cloud Network](https://github.com/oracle-quickstart/terraform-oci-networking/tree/main/modules/vcn). 4 | 5 | 6 | ## Requirements 7 | 8 | No requirements. 9 | 10 | ## Providers 11 | 12 | No providers. 13 | 14 | ## Modules 15 | 16 | No modules. 17 | 18 | ## Resources 19 | 20 | No resources. 21 | 22 | ## Inputs 23 | 24 | No inputs. 25 | 26 | ## Outputs 27 | 28 | No outputs. 29 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/node_pools.tf: -------------------------------------------------------------------------------- 1 | # Add a node pool 2 | # resource "civo_kubernetes_node_pool" "back-end" { 3 | # cluster_id = civo_kubernetes_cluster.my-cluster.id 4 | # label = "back-end" // Optional 5 | # node_count = var.cluster_node_count 6 | # size = element(data.civo_size.xsmall.sizes, 0).name // var.cluster_node_size 7 | # region = var.region 8 | 9 | # labels = { 10 | # service = "backend" 11 | # priority = "high" 12 | # } 13 | 14 | # taint { 15 | # key = "workloadKind" 16 | # value = "database" 17 | # effect = "NoSchedule" 18 | # } 19 | 20 | # taint { 21 | # key = "workloadKind" 22 | # value = "frontend" 23 | # effect = "NoSchedule" 24 | # } 25 | # } 26 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-policies/versions.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.5" #">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 6" # "~> 4, < 5" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | configuration_aliases = [oci.home_region] 13 | } 14 | local = { 15 | source = "hashicorp/local" 16 | version = ">= 2" #"~> 2" 17 | # https://registry.terraform.io/providers/hashicorp/local/ 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/vcn/main.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | resource "oci_core_vcn" "main" { 6 | cidr_blocks = var.cidr_blocks 7 | compartment_id = var.compartment_ocid 8 | display_name = var.display_name 9 | dns_label = var.dns_label 10 | freeform_tags = var.vcn_tags.freeformTags 11 | defined_tags = var.vcn_tags.definedTags 12 | is_ipv6enabled = var.is_ipv6enabled 13 | ipv6private_cidr_blocks = var.ipv6private_cidr_blocks 14 | 15 | count = var.create_new_vcn ? 1 : 0 16 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/verrazzano/variables.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Cert Manager variables 6 | variable "chart_namespace" { 7 | default = "cert-manager" 8 | } 9 | variable "chart_repository" { 10 | default = "https://charts.jetstack.io" 11 | } 12 | variable "chart_version" { 13 | default = "1.9.1" 14 | } 15 | variable "ingress_email_issuer" { 16 | default = "no-reply@example.cloud" 17 | description = "You must replace this email address with your own. The certificate provider will use this to contact you about expiring certificates, and issues related to your account." 18 | } -------------------------------------------------------------------------------- /oci_devops/command_spec.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | component: command 3 | timeoutInSeconds: 10000 4 | shell: bash 5 | failImmediatelyOnError: true 6 | 7 | 8 | 9 | steps: 10 | - type: Command 11 | name: TerraformSetup 12 | shell: bash 13 | timeoutInSeconds: 3500 14 | failImmediatelyOnError: true 15 | command: | 16 | oci os object bulk-download -ns ${OBJECT_BUCKET_NAMESPACE_NAME} -bn ${OBJECT_BUCKET_NAME} --download-dir /tmp/ --include '*.tf' --prefix "terraform_build/" 17 | ls -ltr /tmp/terraform_build 18 | cd /tmp/terraform_build 19 | 20 | onFailure: 21 | - type: Command 22 | command: | 23 | echo "Handling Failure" 24 | echo "Failure successfully handled" 25 | timeoutInSeconds: 400 26 | 27 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke/datasources.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021-2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | data "oci_containerengine_cluster_option" "oke" { 6 | cluster_option_id = "all" 7 | } 8 | data "oci_containerengine_clusters" "oke" { 9 | compartment_id = local.oke_compartment_ocid 10 | } 11 | 12 | # Gets a list of Availability Domains 13 | data "oci_identity_availability_domains" "ADs" { 14 | compartment_id = var.tenancy_ocid 15 | } 16 | 17 | # Gets kubeconfig 18 | data "oci_containerengine_cluster_kube_config" "oke" { 19 | cluster_id = var.create_new_oke_cluster ? oci_containerengine_cluster.oke_cluster[0].id : var.existent_oke_cluster_id 20 | } 21 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/variables.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-24 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Cert Manager variables 6 | variable "chart_namespace" { 7 | default = "cert-manager" 8 | } 9 | variable "chart_repository" { 10 | default = "https://charts.jetstack.io" 11 | } 12 | variable "chart_version" { 13 | default = "1.15.3" # default = "1.9.1" 14 | } 15 | variable "ingress_email_issuer" { 16 | default = "no-reply@example.cloud" 17 | description = "You must replace this email address with your own. The certificate provider will use this to contact you about expiring certificates, and issues related to your account." 18 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/cert-manager.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Cert Manager variables 6 | variable "cert_manager_enabled" { 7 | default = true 8 | description = "Enable x509 Certificate Management" 9 | } 10 | 11 | module "cert-manager" { 12 | source = "./modules/cert-manager" 13 | 14 | # Helm Release variables 15 | chart_namespace = kubernetes_namespace.cluster_tools.0.id 16 | chart_repository = local.helm_repository.jetstack 17 | chart_version = local.helm_repository.jetstack_version 18 | ingress_email_issuer = var.ingress_email_issuer 19 | 20 | count = var.cert_manager_enabled ? 1 : 0 21 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | helm = { 9 | source = "hashicorp/helm" 10 | version = "~> 2" 11 | # https://registry.terraform.io/providers/hashicorp/helm/ 12 | } 13 | tls = { 14 | source = "hashicorp/tls" 15 | version = "~> 4" 16 | # https://registry.terraform.io/providers/hashicorp/tls/ 17 | } 18 | local = { 19 | source = "hashicorp/local" 20 | version = "~> 2" 21 | # https://registry.terraform.io/providers/hashicorp/local/ 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/verrazzano/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.1" 7 | required_providers { 8 | helm = { 9 | source = "hashicorp/helm" 10 | version = "~> 2" 11 | # https://registry.terraform.io/providers/hashicorp/helm/ 12 | } 13 | tls = { 14 | source = "hashicorp/tls" 15 | version = "~> 4" 16 | # https://registry.terraform.io/providers/hashicorp/tls/ 17 | } 18 | local = { 19 | source = "hashicorp/local" 20 | version = "~> 2" 21 | # https://registry.terraform.io/providers/hashicorp/local/ 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /terraform-provider-oci/create-vcn/env-vars: -------------------------------------------------------------------------------- 1 | 2 | # Adapt the below variables to your own tenancy/compartment/region and authentication configuration 3 | 4 | export TF_VAR_tenancy_ocid="ocid1.tenancy.oc1..aaaaaaaa" # change me 5 | export TF_VAR_user_ocid="ocid1.user.oc1..aaaaaaaa" # change me 6 | export TF_VAR_compartment_ocid="ocid1.tenancy.oc1..aaaaaaaa" # change me 7 | 8 | export TF_VAR_fingerprint=$(cat ../../.oci/oci_api_key_fingerprint) # change me 9 | export TF_VAR_private_key_path=../../.oci/oci_api_key.pem # change me 10 | 11 | export TF_VAR_ssh_public_key=$(cat ../../.ssh/id_rsa.pub) # change me 12 | export TF_VAR_ssh_private_key=$(cat ../../.ssh/id_rsa) # change me 13 | 14 | export TF_VAR_region="ca-toronto-1" # change me 15 | -------------------------------------------------------------------------------- /terraform-provider-oci/launch-instance/env-vars: -------------------------------------------------------------------------------- 1 | # Adapt the below variables to your own tenancy/compartment/region and authentication configuration 2 | 3 | export TF_VAR_tenancy_ocid="ocid1.tenancy.oc1..aaaaaaaa" # change me 4 | export TF_VAR_user_ocid="ocid1.user.oc1..aaaaaaaa" # change me 5 | export TF_VAR_compartment_ocid="ocid1.tenancy.oc1..aaaaaaaa" # change me 6 | 7 | export TF_VAR_fingerprint=$(cat ../../.oci/oci_api_key_fingerprint) # change me 8 | export TF_VAR_private_key_path=../../.oci/oci_api_key.pem # change me 9 | 10 | export TF_VAR_ssh_public_key=$(cat ../../.ssh/id_rsa.pub) # change me 11 | export TF_VAR_ssh_private_key=$(cat ../../.ssh/id_rsa) # change me 12 | 13 | export TF_VAR_region="ca-toronto-1" # change me 14 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke-cluster-autoscaler/versions.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version =">= 1.2" #">= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 6" #">= 5" #"~> 4, < 5" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | } 13 | kubernetes = { 14 | source = "hashicorp/kubernetes" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/kubernetes/ 17 | } 18 | local = { 19 | source = "hashicorp/local" 20 | version = "~> 2" 21 | # https://registry.terraform.io/providers/hashicorp/local/ 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /terraform-provider-oci/create-vcn/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | variable "compartment_ocid" {} 3 | variable "tenancy_ocid" {} 4 | variable "user_ocid" {} 5 | variable "fingerprint" {} 6 | variable "private_key_path" {} 7 | variable "region" {} 8 | 9 | variable "availability_domain_name" { 10 | default = "" 11 | description = "Availability Domain" 12 | } 13 | 14 | variable "vcn_display_name" { 15 | default = "Terravcn" 16 | } 17 | 18 | variable "vcn_cidr" { 19 | default = "192.168.64.0/20" 20 | } 21 | 22 | variable "vcn_dns_label" { 23 | default = "Terra" 24 | } 25 | # SUBNET INFO 26 | variable "subnet_dns_label" { 27 | default = "terra" 28 | } 29 | variable "subnet_display_name"{ 30 | default = "terrasub" 31 | } 32 | 33 | variable "subnet_cidr"{ 34 | default = "192.168.78.0/24" 35 | } 36 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/versions.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version = ">= 1.5" #">= 1.2" 7 | required_providers { 8 | helm = { 9 | source = "hashicorp/helm" 10 | version = ">= 2.15" # version = "~> 2" 11 | # https://registry.terraform.io/providers/hashicorp/helm/ 12 | } 13 | tls = { 14 | source = "hashicorp/tls" 15 | version = ">= 4" 16 | # https://registry.terraform.io/providers/hashicorp/tls/ 17 | } 18 | local = { 19 | source = "hashicorp/local" 20 | version = ">= 2.5" 21 | # https://registry.terraform.io/providers/hashicorp/local/ 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/datasources.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # # Gets home and current regions 6 | # data "oci_identity_tenancy" "tenant_details" { 7 | # tenancy_id = var.tenancy_ocid 8 | 9 | # provider = oci.current_region 10 | # } 11 | 12 | # data "oci_identity_regions" "home_region" { 13 | # filter { 14 | # name = "key" 15 | # values = [data.oci_identity_tenancy.tenant_details.home_region_key] 16 | # } 17 | 18 | # provider = oci.current_region 19 | # } 20 | 21 | # Available OCI Services 22 | data "oci_core_services" "all_services_network" { 23 | filter { 24 | name = "name" 25 | values = ["All .* Services In Oracle Services Network"] 26 | regex = true 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke-node-pool/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "node_pool_name" { 6 | value = var.create_new_node_pool ? oci_containerengine_node_pool.oke_node_pool.0.name : var.existent_oke_nodepool_id_for_autoscaler 7 | } 8 | output "node_pool_min_nodes" { 9 | value = var.node_pool_min_nodes 10 | } 11 | output "node_pool_max_nodes" { 12 | value = var.node_pool_max_nodes 13 | } 14 | output "node_pool_id" { 15 | value = var.create_new_node_pool ? oci_containerengine_node_pool.oke_node_pool.0.id : var.existent_oke_nodepool_id_for_autoscaler 16 | } 17 | output "node_k8s_version" { 18 | value = local.node_k8s_version 19 | } 20 | output "node_pool_autoscaler_enabled" { 21 | value = var.node_pool_autoscaler_enabled 22 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/route_table/main.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | resource "oci_core_route_table" "route_table" { 6 | compartment_id = var.compartment_ocid 7 | vcn_id = var.vcn_id 8 | display_name = var.display_name 9 | freeform_tags = var.route_table_tags.freeformTags 10 | defined_tags = var.route_table_tags.definedTags 11 | 12 | dynamic "route_rules" { 13 | for_each = var.route_rules 14 | content { 15 | description = route_rules.value.description 16 | destination = route_rules.value.destination 17 | destination_type = route_rules.value.destination_type 18 | network_entity_id = route_rules.value.network_entity_id 19 | } 20 | } 21 | 22 | count = var.create_route_table ? 1 : 0 23 | } -------------------------------------------------------------------------------- /terraform-provider-gcp/create-vpc/variables.tf: -------------------------------------------------------------------------------- 1 | # GCP Service account region and authentication 2 | # variable "prefix" { 3 | # description = "The prefix used for all resources in this example" 4 | #} 5 | variable "gcp_credentials"{ 6 | description = "default location of your service account json key file" 7 | default = "~/gcp-key.json" 8 | } 9 | 10 | variable "project" { 11 | default = "playground-s-11-83a5e4fc" 12 | } 13 | variable "region" { 14 | default = "us-east1" 15 | } 16 | 17 | variable "zone" { 18 | default = "us-east1-b" 19 | } 20 | # VPC INFO 21 | variable "vnet_name" { 22 | default = "Terravpc" 23 | } 24 | 25 | variable "subnet-02_cidr" { 26 | default = "192.168.0.0/16" 27 | } 28 | 29 | # SUBNET INFO 30 | variable "subnet_name"{ 31 | default = "terrasub" 32 | } 33 | 34 | variable "subnet_cidr"{ 35 | default = "192.168.10.0/24" 36 | } 37 | variable "firewall_name" { 38 | default = "terra_fw" 39 | } 40 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/test.yaml: -------------------------------------------------------------------------------- 1 | # Default Let's Encrypt ClusterIssuers 2 | # 3 | # Configures the common letsencrypt-staging and letsencrypt-prod ClusterIssuers 4 | # using a http01 solver that will work well with nginx-ingress. This is what 5 | # most small single-tenant clusters start with. 6 | 7 | _: &email user@example.com 8 | _: &solvers 9 | - http01: 10 | ingress: 11 | class: nginx 12 | 13 | clusterIssuers: 14 | - name: letsencrypt-prod 15 | spec: 16 | acme: 17 | email: *email 18 | server: https://acme-v02.api.letsencrypt.org/directory 19 | privateKeySecretRef: 20 | name: letsencrypt-prod-account-key 21 | solvers: *solvers 22 | - name: letsencrypt-staging 23 | spec: 24 | acme: 25 | email: *email 26 | server: https://acme-staging-v02.api.letsencrypt.org/directory 27 | privateKeySecretRef: 28 | name: letsencrypt-staging-account-key 29 | solvers: *solvers -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/route_table/variables.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | variable "compartment_ocid" {} 6 | variable "vcn_id" {} 7 | variable "route_table_name" {} 8 | variable "create_route_table" { 9 | default = false 10 | description = "Creates a new route table. If false, bypass the creation." 11 | } 12 | variable "display_name" { 13 | default = null 14 | description = "Display name for the subnet." 15 | } 16 | variable "route_rules" { 17 | type = list(object({ 18 | description = string 19 | destination = string 20 | destination_type = string 21 | network_entity_id = string 22 | })) 23 | default = [] 24 | } 25 | # Deployment Details + Freeform Tags + Defined Tags 26 | variable "route_table_tags" { 27 | description = "Tags to be added to the route table resources" 28 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/gateway/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "internet_gateway_id" { 6 | value = var.create_internet_gateway ? oci_core_internet_gateway.gateway[0].id : null 7 | description = "The OCID of the Internet Gateway." 8 | } 9 | output "nat_gateway_id" { 10 | value = var.create_nat_gateway ? oci_core_nat_gateway.gateway[0].id : null 11 | description = "The OCID of the NAT Gateway." 12 | } 13 | output "service_gateway_id" { 14 | value = var.create_service_gateway ? oci_core_service_gateway.gateway[0].id : null 15 | description = "The OCID of the Service Gateway." 16 | } 17 | output "local_peering_gateway_id" { 18 | value = var.create_local_peering_gateway ? oci_core_local_peering_gateway.gateway[0].id : null 19 | description = "The OCID of the Local Peering Gateway." 20 | } -------------------------------------------------------------------------------- /terraform-provider-oci/create-vcn/outputs.tf: -------------------------------------------------------------------------------- 1 | 2 | output "vcn_id" { 3 | description = "OCID of created VCN. " 4 | value = oci_core_vcn.vcnterra.id 5 | } 6 | 7 | output "default_security_list_id" { 8 | description = "OCID of default security list. " 9 | value = oci_core_vcn.vcnterra.default_security_list_id 10 | } 11 | 12 | output "default_dhcp_options_id" { 13 | description = "OCID of default DHCP options. " 14 | value = oci_core_vcn.vcnterra.default_dhcp_options_id 15 | } 16 | 17 | output "default_route_table_id" { 18 | description = "OCID of default route table. " 19 | value = oci_core_vcn.vcnterra.default_route_table_id 20 | } 21 | 22 | output "internet_gateway_id" { 23 | description = "OCID of internet gateway. " 24 | value = oci_core_internet_gateway.gtw.id 25 | } 26 | 27 | output "subnet_ids" { 28 | description = "ocid of subnet ids. " 29 | value = oci_core_subnet.terrasub.*.id 30 | } 31 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/subnet/main.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | resource "oci_core_subnet" "subnet" { 6 | cidr_block = var.cidr_block 7 | compartment_id = var.compartment_ocid 8 | display_name = var.display_name 9 | dns_label = var.dns_label 10 | vcn_id = var.vcn_id 11 | prohibit_public_ip_on_vnic = var.prohibit_public_ip_on_vnic 12 | prohibit_internet_ingress = var.prohibit_internet_ingress 13 | route_table_id = var.route_table_id 14 | dhcp_options_id = var.dhcp_options_id 15 | security_list_ids = var.security_list_ids 16 | ipv6cidr_block = var.ipv6cidr_block 17 | freeform_tags = var.subnet_tags.freeformTags 18 | defined_tags = var.subnet_tags.definedTags 19 | 20 | count = var.create_subnet ? 1 : 0 21 | } -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/modules/iam-compartment/main.tf: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, 2021, Oracle and/or its affiliates. 2 | 3 | 4 | ######################## 5 | # Compartment 6 | ######################## 7 | 8 | resource "oci_identity_compartment" "this" { 9 | count = var.compartment_create ? 1 : 0 10 | compartment_id = var.compartment_id != null ? var.compartment_id : var.tenancy_ocid 11 | name = var.compartment_name 12 | description = var.compartment_description 13 | enable_delete = var.enable_delete 14 | } 15 | 16 | data "oci_identity_compartments" "this" { 17 | count = var.compartment_create ? 0 : 1 18 | compartment_id = var.compartment_id 19 | 20 | filter { 21 | name = "name" 22 | values = [var.compartment_name] 23 | } 24 | } 25 | 26 | locals { 27 | compartment_ids = concat(flatten(data.oci_identity_compartments.this.*.compartments), tolist( [tomap({"id" = ""})])) 28 | parent_compartment_ids = concat(flatten(data.oci_identity_compartments.this.*.compartments), tolist([tomap({"compartment_id" = ""})])) 29 | } 30 | -------------------------------------------------------------------------------- /terraform-provider-aws/create-vpc/variables.tf: -------------------------------------------------------------------------------- 1 | # Aws account region and autehntication 2 | #variable "aws_access_key" {} 3 | #variable "aws_secret_key" {} 4 | variable "aws_region" { 5 | default = "us-east-1" 6 | } 7 | # VPC INFO 8 | variable "vpc_name" { 9 | default = "Terravpc" 10 | } 11 | 12 | variable "vpc_cidr" { 13 | default = "192.168.0.0/16" 14 | } 15 | 16 | # SUBNET INFO 17 | variable "subnet_name"{ 18 | default = "terrasub" 19 | } 20 | 21 | variable "subnet_cidr"{ 22 | default = "192.168.10.0/24" 23 | } 24 | variable "map_public_ip_on_launch" { 25 | description = "Indicate if instances launched into the VPC's Subnet will be assigned a public IP address . " 26 | default = true 27 | } 28 | 29 | # IGW INFO 30 | variable "igw_name"{ 31 | default = "terra-igw" 32 | } 33 | 34 | # ROUTE TABLE INFO 35 | variable "rt_name"{ 36 | default = "terra-rt" 37 | } 38 | # ROUTE TABLE INFO 39 | variable "sg_name"{ 40 | default = "terra-sg" 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/env-vars: -------------------------------------------------------------------------------- 1 | export TF_VAR_user_ocid="ocid1.user.oc1..." 2 | export TF_VAR_fingerprint="3b:..." 3 | export TF_VAR_private_key_path="~/.oci/oci_api_key.pem" 4 | export TF_VAR_tenancy_ocid="ocid1.tenancy.oc1...." 5 | export TF_VAR_region="ca-toronto-1" 6 | export TF_VAR_availability_domain_number="1" 7 | export TF_VAR_ssh_public_key=$(cat ~/.ssh/id_rsa.pub) 8 | export TF_VAR_compartment_ocid="ocid1.compartment.oc1...." 9 | export TF_VAR_cluster_type="ENHANCED_CLUSTER" 10 | export TF_VAR_prometheus_enabled=true 11 | export TF_VAR_grafana_enabled=true 12 | export TF_VAR_ingress_nginx_enabled=true 13 | export TF_VAR_node_pool_instance_shape_1='{"instanceShape":"VM.Standard.E4.Flex","ocpus":2,"memory":16}' 14 | export TF_VAR_node_pool_name_1="pool1" #oke_pool 15 | export TF_VAR_node_pool_initial_num_worker_nodes_1=1 16 | export TF_VAR_node_k8s_version="v1.30.1" # worker nodes version 17 | export TF_VAR_k8s_version="v1.30.1" # master /control plane node version 18 | export TF_VAR_node_pool_max_num_worker_nodes_1=3 19 | export TF_VAR_cluster_endpoint_visibility="Public" 20 | -------------------------------------------------------------------------------- /terraform-provider-oci/publicIPs/publicip.tf: -------------------------------------------------------------------------------- 1 | # ---- Terraform Version and configuration_aliases [primary Toronto, DR Montreal] 2 | terraform { 3 | required_version = ">= 1.0.3" 4 | required_providers { 5 | oci = { 6 | source = "oracle/oci" 7 | version = "4.105.0" 8 | configuration_aliases = [ oci.primary, oci.dr ] 9 | } 10 | } 11 | } 12 | 13 | resource "oci_core_public_ip" "primary_firewall_public_ip" { 14 | provider = oci.primary 15 | #Required 16 | for_each = local.ips.primary_site 17 | compartment_id = var.tenancy_ocid 18 | lifetime = "RESERVED" 19 | #Optional 20 | display_name = each.key 21 | # ---- Vnics aren't available yet, No assignment needed 22 | #assignedEntityId = oci_core_private_ip.test_private_ip.id 23 | #public_ip_pool_id = oci_core_public_ip_pool.test_public_ip_pool.id 24 | } 25 | 26 | resource "oci_core_public_ip" "dr_firewall_public_ip" { 27 | provider = oci.dr 28 | #Required 29 | for_each = local.ips.dr_site 30 | compartment_id = var.tenancy_ocid 31 | lifetime = "RESERVED" 32 | #Optional 33 | display_name = each.key 34 | 35 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/providers.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | terraform { 6 | required_version =">= 1.5" # ">= 1.1" 7 | required_providers { 8 | kubernetes = { 9 | source = "hashicorp/kubernetes" 10 | version = "~> 2" 11 | # https://registry.terraform.io/providers/hashicorp/kubernetes/ 12 | } 13 | helm = { 14 | source = "hashicorp/helm" 15 | version = "~> 2" 16 | # https://registry.terraform.io/providers/hashicorp/helm/ 17 | } 18 | tls = { 19 | source = "hashicorp/tls" 20 | version = "~> 4" 21 | # https://registry.terraform.io/providers/hashicorp/tls/ 22 | } 23 | local = { 24 | source = "hashicorp/local" 25 | version = "~> 2" 26 | # https://registry.terraform.io/providers/hashicorp/local/ 27 | } 28 | random = { 29 | source = "hashicorp/random" 30 | version = "~> 3" 31 | # https://registry.terraform.io/providers/hashicorp/random/ 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/metrics-server.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Metrics Server variables 6 | variable "metrics_server_enabled" { 7 | default = true 8 | description = "Enable Metrics Server for Metrics, HPA, VPA and Cluster Autoscaler" 9 | } 10 | 11 | # Metrics Server for the HPA 12 | ## https://github.com/kubernetes-sigs/metrics-server/blob/master/charts/metrics-server/README.md 13 | ## https://artifacthub.io/packages/helm/metrics-server/metrics-server 14 | resource "helm_release" "metrics_server" { 15 | name = "metrics-server" 16 | repository = local.helm_repository.metrics_server 17 | chart = "metrics-server" 18 | version = local.helm_repository.metrics_server_version 19 | namespace = "kube-system" # kubernetes_namespace.cluster_tools.id # Workaround to run on 1.24 20 | wait = false 21 | 22 | set { 23 | name = "args" 24 | value = "{--kubelet-insecure-tls,--kubelet-preferred-address-types=InternalIP}" 25 | } 26 | 27 | count = var.metrics_server_enabled ? 1 : 0 28 | } 29 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/helm_ingress_traefik.tf: -------------------------------------------------------------------------------- 1 | resource "helm_release" "traefik_ingress" { 2 | name = "traefik" 3 | 4 | repository = "https://helm.traefik.io/traefik" 5 | chart = "traefik" 6 | timeout = 900 # Increase timeout to 15 minutes 7 | create_namespace = true 8 | namespace = "traefik" 9 | 10 | set { 11 | type = "string" 12 | name = "service.annotations.kubernetes\\.civo\\.com/firewall-id" 13 | value = civo_firewall.firewall-ingress.id 14 | } 15 | 16 | 17 | set { 18 | name = "metrics.prometheus.service.enabled" 19 | value = "true" 20 | } 21 | # served directly by the Traefik internal service 22 | 23 | # set { 24 | # name = "ports.metrics.port" 25 | # value = "9100" # Set as string, Helm typically converts to number if needed 26 | # } 27 | 28 | # set { 29 | # name = "ports.metrics.exposedPort" 30 | # value = "9100" # Set as string 31 | # } 32 | 33 | # set { 34 | # name = "ports.metrics.protocol" 35 | # value = "TCP" # Set as string 36 | # } 37 | 38 | set { 39 | name = "ports.metrics.expose.default" 40 | value = "true" # Set as string, Helm converts "true" to boolean true 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/kubernetes_deployment-nginx.tf: -------------------------------------------------------------------------------- 1 | resource "kubernetes_deployment" "nginx" { 2 | metadata { 3 | name = "nginx" 4 | namespace = "default" 5 | } 6 | 7 | spec { 8 | replicas = 1 9 | selector { 10 | match_labels = { 11 | nginx = "nginx" 12 | } 13 | } 14 | template { 15 | metadata { 16 | labels = { 17 | nginx = "nginx" 18 | } 19 | } 20 | 21 | spec { 22 | container { 23 | image = "nginx:1.21.6" 24 | name = "nginx" 25 | resources { 26 | limits = { 27 | cpu = "0.5" 28 | memory = "512Mi" 29 | } 30 | requests = { 31 | cpu = "250m" 32 | memory = "50Mi" 33 | } 34 | } 35 | 36 | liveness_probe { 37 | http_get { 38 | path = "/" 39 | port = 80 40 | 41 | http_header { 42 | name = "X-Custom-Header" 43 | value = "Awesome" 44 | } 45 | } 46 | 47 | initial_delay_seconds = 3 48 | period_seconds = 3 49 | } 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/prometheus.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Prometheus variables 6 | variable "prometheus_enabled" { 7 | default = true 8 | description = "Enable Prometheus" 9 | } 10 | 11 | # Prometheus Helm chart 12 | ## https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus/README.md 13 | ## https://artifacthub.io/packages/helm/prometheus-community/prometheus 14 | resource "helm_release" "prometheus" { 15 | name = "prometheus" 16 | repository = local.helm_repository.prometheus 17 | chart = "prometheus" 18 | version = local.helm_repository.prometheus_version 19 | namespace = kubernetes_namespace.cluster_tools.0.id 20 | wait = false 21 | 22 | 23 | values = [ 24 | <= 1.1" 7 | required_providers { 8 | oci = { 9 | source = "oracle/oci" 10 | version = ">= 6" #"~> 4, < 5" 11 | # https://registry.terraform.io/providers/oracle/oci/ 12 | configuration_aliases = [oci.home_region] 13 | } 14 | kubernetes = { 15 | source = "hashicorp/kubernetes" 16 | version = ">= 2.32" #"~> 2" 17 | # https://registry.terraform.io/providers/hashicorp/kubernetes/ 18 | } 19 | helm = { 20 | source = "hashicorp/helm" 21 | version = ">= 2.15" #"~> 2" 22 | # https://registry.terraform.io/providers/hashicorp/helm/ 23 | } 24 | tls = { 25 | source = "hashicorp/tls" 26 | version = ">= 4" # "~> 4" 27 | # https://registry.terraform.io/providers/hashicorp/tls/ 28 | } 29 | local = { 30 | source = "hashicorp/local" 31 | version = ">= 2.5" #"~> 2" 32 | # https://registry.terraform.io/providers/hashicorp/local/ 33 | } 34 | random = { 35 | source = "hashicorp/random" 36 | version = ">= 3.6" #"~> 3" 37 | # https://registry.terraform.io/providers/hashicorp/random/ 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /terraform-provider-gcp/README.md: -------------------------------------------------------------------------------- 1 | # GCP Provider Examples 2 | 3 | This directory contains Terraform configuration files showing how to create specific resources. The create-vpc is intended to demonstrate how to create a vpc 4 | along with custom subnets and firewalls. The launch-instance contains both the vpc configuration we used above and the copute engine instance provisioning/configuration. 5 | For details on how to run these samples please refere to my [blog post >>](https://brokedba.blogspot.com) 6 | 7 | ![image](https://user-images.githubusercontent.com/29458929/137646325-9b216b7e-54cd-4089-a485-01db8be23cde.png) 8 | 9 | 10 | **Terraform Console**: 11 | - ***Functions:*** Although terraform is a declarative language, there are still myriads of functions you can use to process strings/number/lists/mappings etc. 12 | you will find an excellent all in one script with examples of most terraform functions in [terrafunctions.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-gcp/terrafunctions.sh) 13 | 14 | - ***expressions:*** Same goes for expressions here is a simple shell script that creates a main.tf with multiples expressions and apply it for you [terraexpression.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-gcp/terraexpressions.sh) No need to deploy anything in the cloud it's all local. 15 | 16 | Credit : [CloudaFFair](https://cloudaffaire.com/terraform-functions/) 17 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/modules/cert-manager/issuers/templates/clusterissuers.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Capabilities.APIVersions.Has "cert-manager.io/v1" -}} 2 | apiVersion: cert-manager.io/v1 3 | kind: ClusterIssuer 4 | metadata: 5 | name: letsencrypt-prod 6 | spec: 7 | acme: 8 | # The ACME production api URL 9 | server: https://acme-v02.api.letsencrypt.org/directory 10 | # Email address used for ACME registration 11 | email: {{ .Values.issuer.email }} 12 | # Name of a secret used to store the ACME account private key 13 | privateKeySecretRef: 14 | name: letsencrypt-prod 15 | solvers: 16 | - http01: 17 | ingress: 18 | class: nginx 19 | --- 20 | apiVersion: cert-manager.io/v1 21 | kind: ClusterIssuer 22 | metadata: 23 | name: letsencrypt-staging 24 | spec: 25 | acme: 26 | # The ACME staging api URL 27 | server: https://acme-staging-v02.api.letsencrypt.org/directory 28 | # Email address used for ACME registration 29 | email: {{ .Values.issuer.email }} 30 | # Name of a secret used to store the ACME account private key 31 | privateKeySecretRef: 32 | name: letsencrypt-staging 33 | solvers: 34 | - http01: 35 | ingress: 36 | class: nginx 37 | --- 38 | apiVersion: cert-manager.io/v1 39 | kind: ClusterIssuer 40 | metadata: 41 | name: selfsigned 42 | spec: 43 | selfSigned: {} 44 | {{ else -}} 45 | {{ fail "cert-manager.io/v1 CRD not available" -}} 46 | {{- end -}} 47 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/vcn/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "vcn_id" { 6 | value = data.oci_core_vcn.main_or_existent.id 7 | } 8 | output "default_dhcp_options_id" { 9 | value = data.oci_core_vcn.main_or_existent.default_dhcp_options_id 10 | } 11 | output "compartment_id" { 12 | value = data.oci_core_vcn.main_or_existent.compartment_id 13 | } 14 | output "default_route_table_id" { 15 | value = data.oci_core_vcn.main_or_existent.default_route_table_id 16 | } 17 | output "default_security_list_id" { 18 | value = data.oci_core_vcn.main_or_existent.default_security_list_id 19 | } 20 | output "dns_label" { 21 | value = data.oci_core_vcn.main_or_existent.dns_label 22 | } 23 | output "display_name" { 24 | value = data.oci_core_vcn.main_or_existent.display_name 25 | } 26 | output "cidr_blocks" { 27 | value = data.oci_core_vcn.main_or_existent.cidr_blocks 28 | } 29 | output "byoipv6cidr_blocks" { 30 | value = data.oci_core_vcn.main_or_existent.byoipv6cidr_blocks 31 | } 32 | output "ipv6cidr_blocks" { 33 | value = data.oci_core_vcn.main_or_existent.ipv6cidr_blocks 34 | } 35 | output "ipv6private_cidr_blocks" { 36 | value = data.oci_core_vcn.main_or_existent.ipv6private_cidr_blocks 37 | } 38 | output "vcn_domain_name" { 39 | value = data.oci_core_vcn.main_or_existent.vcn_domain_name 40 | } 41 | -------------------------------------------------------------------------------- /terraform-provider-aws/README.md: -------------------------------------------------------------------------------- 1 | # AWS Provider Examples 2 | This directory contains Terraform configuration files showing how to create specific resources. The create-vpc is intended to demonstrate how to create a vpc along with the route table, the subnet and security group. The launch-instance contains both the vpc configuration we used above and the instance provisioning configuration. 3 | For details on how to run these samples please refere to my [blog post (Launch an instance with a static website on AWS) >>](https://brokedba.blogspot.com/2020/10/terraform-for-dummies-part-2-launch.html) 4 | 5 | ![image](https://user-images.githubusercontent.com/29458929/137570698-bc70e932-3499-4d9b-a20c-cec3f8fe421d.png) 6 | 7 | **Terraform Console**: 8 | - ***Functions:*** Although terraform is a declarative language, there are still myriads of functions you can use to process strings/number/lists/mappings etc. 9 | you will find an excellent all in one script with examples of most terraform functions in [terrafunctions.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terrafunctions.sh) 10 | 11 | - ***expressions:*** Same goes for expressions here is a simple shell script that creates a main.tf with multiples expressions and apply it for you [terraexpression.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terraexpressions.sh) No need to deploy anything in the cloud it's all local. 12 | 13 | Credit : [CloudaFFair](https://cloudaffaire.com/terraform-functions/) 14 | -------------------------------------------------------------------------------- /terraform-provider-aws/launch-instance/cloud-init/ubto_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The AWS Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | 22 | sudo apt --assume-yes install nginx 23 | sudo ufw allow 'Nginx HTTP' 24 | #sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | # sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 28 | sudo cat $FILE > /var/www/html/index.html -------------------------------------------------------------------------------- /terraform-provider-azure/README.md: -------------------------------------------------------------------------------- 1 | # AZURE Provider Examples 2 | This directory contains Terraform configuration files showing how to create specific resources. The create-vnet is intended to demonstrate how to create a vnet 3 | along with custom subnets and security group. The launch-instance contains both the vnet configuration we used above and the instance provisioning configuration. 4 | For details on how to run these samples please refere to my [blog post( Launch a vm with a static website on Azure) >>](https://brokedba.blogspot.com/2021/10/terraform-for-dummies-part-3-launch-vm.html) 5 | 6 | ![image](https://user-images.githubusercontent.com/29458929/137570644-cf688c8f-df70-490a-b849-6845d3746181.png) 7 | 8 | 9 | **Terraform Console**: 10 | - ***Functions:*** Although terraform is a declarative language, there are still myriads of functions you can use to process strings/number/lists/mappings etc. 11 | you will find an excellent all in one script with examples of most terraform functions in [terrafunctions.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terrafunctions.sh) 12 | 13 | - ***expressions:*** Same goes for expressions here is a simple shell script that creates a main.tf with multiples expressions and apply it for you [terraexpression.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terraexpressions.sh) No need to deploy anything in the cloud it's all local. 14 | 15 | Credit : [CloudaFFair](https://cloudaffaire.com/terraform-functions/) 16 | -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/ubto_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | 22 | sudo apt --assume-yes install nginx 23 | sudo ufw allow 'Nginx HTTP' 24 | #sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | # sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 28 | sudo cat $FILE > /var/www/html/index.html -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/ubto_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | 22 | sudo apt --assume-yes install nginx 23 | sudo ufw allow 'Nginx HTTP' 24 | #sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | # sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 28 | sudo cat $FILE > /var/www/html/index.html -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/ubto_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The ALIBABA Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | 22 | sudo apt --assume-yes install nginx 23 | sudo ufw allow 'Nginx HTTP' 24 | #sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | # sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 28 | sudo cat $FILE > /var/www/html/index.html -------------------------------------------------------------------------------- /terraform-provider-aws/create-vpc-dynamic/README.md: -------------------------------------------------------------------------------- 1 | # Create a vpc with dynamic seurity group rule block and local variables substitution 2 | The create-vpc-dynamic is intended to demonstrate how to create a vpc with a dynamic block of securtiy group rules. 3 | For details on how to run this sample please refere to my [blog post >>](https://brokedba.blogspot.com/2020/10/terraform-tricks-how-to-mimic-nested.html) 4 | 5 | # In a nutshell : 6 | To consolidate all sg rules combinations in one main map and still call them using the a local variable one would need to write it as below . 7 | 8 | ``` 9 | # all cases in one map 10 | variable "main_sg" { 11 | default = { 12 | sg_ssh = { 13 | SSH = 22 14 | }, 15 | sg_web = { 16 | SSH = 22 17 | HTTP = 80 18 | HTTPS = 443 }, 19 | sg_win { 20 | RDP = 3389 21 | HTTP = 80 22 | HTTPS = 443 } 23 | } 24 | } 25 | # Locals block locals { 26 | sg_mapping = { # variable substitution within a variable 27 | SSH = var.main_sg.sg_ssh 28 | WEB = var.main_sg.sg_web 29 | WIN = var.main_sg.sg_win 30 | } 31 | } 32 | 33 | # you can set the default for sg_type depending on your vm deployment see example below 34 | variable "sg_type"{ 35 | default = "WEB" 36 | } 37 | 38 | 39 | # DYNAMIC sg rules using FOR_EACH LOOP and local variable 40 | resource "aws_security_group_rule" "terra_sg_rule" { 41 | for_each = local.sg_mapping[var.sg_type] 42 | ... 43 | ``` 44 | -------------------------------------------------------------------------------- /terraform-provider-aws/create-vpc-dynamic/variables.tf: -------------------------------------------------------------------------------- 1 | # Aws account region and autehntication 2 | #variable "aws_access_key" {} 3 | #variable "aws_secret_key" {} 4 | variable "aws_region" { 5 | default = "us-east-1" 6 | } 7 | # VPC INFO 8 | variable "vpc_name" { 9 | default = "Terravpc" 10 | } 11 | 12 | variable "vpc_cidr" { 13 | default = "192.168.0.0/16" 14 | } 15 | 16 | # SUBNET INFO 17 | variable "subnet_name"{ 18 | default = "terrasub" 19 | } 20 | 21 | variable "subnet_cidr"{ 22 | default = "192.168.10.0/24" 23 | } 24 | variable "map_public_ip_on_launch" { 25 | description = "Indicate if instances launched into the VPC's Subnet will be assigned a public IP address . " 26 | default = true 27 | } 28 | 29 | # IGW INFO 30 | variable "igw_name"{ 31 | default = "terra-igw" 32 | } 33 | 34 | # ROUTE TABLE INFO 35 | variable "rt_name"{ 36 | default = "terra-rt" 37 | } 38 | # ROUTE TABLE INFO 39 | variable "sg_name"{ 40 | default = "terra-sg" 41 | } 42 | 43 | # SG rules 44 | 45 | 46 | variable "main_sg" { 47 | default = { 48 | sg_ssh = { 49 | SSH = 22 50 | }, 51 | sg_web = { 52 | SSH = 22 53 | HTTP = 80 54 | HTTPS= 443 55 | }, 56 | sg_win = { 57 | RDP = 3389 58 | HTTP = 80 59 | HTTPS= 443 60 | } 61 | } 62 | } 63 | 64 | 65 | variable "sg_type"{ 66 | default = "WEB" 67 | } 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /terraform-provider-aws/terraexpressions.sh: -------------------------------------------------------------------------------- 1 | ## Terraform: Expressions ## 2 | ##---------------------------- 3 | ## Create a directory and get inside it 4 | ## v0 -- Author Debjeet Bhowmik https://cloudaffaire.com/terraform-expressions/ 5 | ## v1 -- brokedba => replaced the vi by a Heredoc (EOF) to print the input into the main.tf and added the terraform init before the apply. 6 | #mkdir terraform && cd terraform 7 | 8 | ## Create main.tf 9 | cat < main.tf 10 | variable "ENV" { 11 | default = "PROD" 12 | } 13 | variable "A" { 14 | default = 20 15 | } 16 | variable "B" { 17 | default = 10 18 | } 19 | variable "C" { 20 | default = 3 21 | } 22 | resource "null_resource" "myresource" { #creates three null resources 23 | count = var.C 24 | #for(i=0;i<3;i++){return i} 25 | } 26 | output "myoutput1" { 27 | value = "\${var.ENV == "PROD" ? "PRODUCTION" : "NONPRODUCTION"}" 28 | #if(ENV=="PROD"){return "PRODUCTION"} else{return "NONPRODUCTION"} 29 | } 30 | output "myoutput2" { 31 | value = "A + B = \${var.A + var.B}\n A - B = \${var.A - var.B}\n A * B = \${var.A * var.B}\n A / B = \${var.A / var.B}\n A % C = \${var.A % var.C}" 32 | } 33 | output "myoutput3" { 34 | value = "\${((var.A > var.B && var.A > var.C) ? "A is greatest" : (var.B > var.C ? "B is greatest" : "C is greatest"))}" 35 | #if(A>B && A>C){return A} elseif(B>C){return B} else{return C} 36 | } 37 | output "myoutput4" { 38 | value = ["\${null_resource.myresource.*.id}"] 39 | } 40 | EOF 41 | ## Format the code 42 | terraform fmt 43 | terraform init 44 | ## Apply 45 | terraform apply -auto-approve 46 | 47 | ## Cleanup 48 | -------------------------------------------------------------------------------- /terraform-provider-gcp/terraexpressions.sh: -------------------------------------------------------------------------------- 1 | ## Terraform: Expressions ## 2 | ##---------------------------- 3 | ## Create a directory and get inside it 4 | ## v0 -- Author Debjeet Bhowmik https://cloudaffaire.com/terraform-expressions/ 5 | ## v1 -- brokedba => replaced the vi by a Heredoc (EOF) to print the input into the main.tf and added the terraform init before the apply. 6 | #mkdir terraform && cd terraform 7 | 8 | ## Create main.tf 9 | cat < main.tf 10 | variable "ENV" { 11 | default = "PROD" 12 | } 13 | variable "A" { 14 | default = 20 15 | } 16 | variable "B" { 17 | default = 10 18 | } 19 | variable "C" { 20 | default = 3 21 | } 22 | resource "null_resource" "myresource" { #creates three null resources 23 | count = var.C 24 | #for(i=0;i<3;i++){return i} 25 | } 26 | output "myoutput1" { 27 | value = "\${var.ENV == "PROD" ? "PRODUCTION" : "NONPRODUCTION"}" 28 | #if(ENV=="PROD"){return "PRODUCTION"} else{return "NONPRODUCTION"} 29 | } 30 | output "myoutput2" { 31 | value = "A + B = \${var.A + var.B}\n A - B = \${var.A - var.B}\n A * B = \${var.A * var.B}\n A / B = \${var.A / var.B}\n A % C = \${var.A % var.C}" 32 | } 33 | output "myoutput3" { 34 | value = "\${((var.A > var.B && var.A > var.C) ? "A is greatest" : (var.B > var.C ? "B is greatest" : "C is greatest"))}" 35 | #if(A>B && A>C){return A} elseif(B>C){return B} else{return C} 36 | } 37 | output "myoutput4" { 38 | value = ["\${null_resource.myresource.*.id}"] 39 | } 40 | EOF 41 | ## Format the code 42 | terraform fmt 43 | terraform init 44 | ## Apply 45 | terraform apply -auto-approve 46 | 47 | ## Cleanup 48 | -------------------------------------------------------------------------------- /terraform-provider-azure/terraexpressions.sh: -------------------------------------------------------------------------------- 1 | ## Terraform: Expressions ## 2 | ##---------------------------- 3 | ## Create a directory and get inside it 4 | ## v0 -- Author Debjeet Bhowmik https://cloudaffaire.com/terraform-expressions/ 5 | ## v1 -- brokedba => replaced the vi by a Heredoc (EOF) to print the input into the main.tf and added the terraform init before the apply. 6 | #mkdir terraform && cd terraform 7 | 8 | ## Create main.tf 9 | cat < main.tf 10 | variable "ENV" { 11 | default = "PROD" 12 | } 13 | variable "A" { 14 | default = 20 15 | } 16 | variable "B" { 17 | default = 10 18 | } 19 | variable "C" { 20 | default = 3 21 | } 22 | resource "null_resource" "myresource" { #creates three null resources 23 | count = var.C 24 | #for(i=0;i<3;i++){return i} 25 | } 26 | output "myoutput1" { 27 | value = "\${var.ENV == "PROD" ? "PRODUCTION" : "NONPRODUCTION"}" 28 | #if(ENV=="PROD"){return "PRODUCTION"} else{return "NONPRODUCTION"} 29 | } 30 | output "myoutput2" { 31 | value = "A + B = \${var.A + var.B}\n A - B = \${var.A - var.B}\n A * B = \${var.A * var.B}\n A / B = \${var.A / var.B}\n A % C = \${var.A % var.C}" 32 | } 33 | output "myoutput3" { 34 | value = "\${((var.A > var.B && var.A > var.C) ? "A is greatest" : (var.B > var.C ? "B is greatest" : "C is greatest"))}" 35 | #if(A>B && A>C){return A} elseif(B>C){return B} else{return C} 36 | } 37 | output "myoutput4" { 38 | value = ["\${null_resource.myresource.*.id}"] 39 | } 40 | EOF 41 | ## Format the code 42 | terraform fmt 43 | terraform init 44 | ## Apply 45 | terraform apply -auto-approve 46 | 47 | ## Cleanup 48 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-policies/main.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | resource "oci_identity_dynamic_group" "for_policies" { 6 | name = "${local.app_name_normalized}-${local.dynamic_group_name_normalized}-${local.deploy_id}" 7 | description = "${local.app_name} ${var.dynamic_group_name} (${local.deploy_id})" 8 | compartment_id = var.tenancy_ocid 9 | matching_rule = "${var.dynamic_group_main_condition} {${join(",", var.dynamic_group_matching_rules)}}" 10 | freeform_tags = var.oci_tag_values.freeformTags 11 | defined_tags = var.oci_tag_values.definedTags 12 | 13 | provider = oci.home_region 14 | 15 | count = var.create_dynamic_group ? 1 : 0 16 | } 17 | 18 | resource "oci_identity_policy" "policies" { 19 | name = "${local.app_name_normalized}-${local.policy_name_normalized}-${local.deploy_id}" 20 | description = "${local.app_name} ${var.policy_name} (${local.deploy_id})" 21 | compartment_id = local.policy_compartment_ocid 22 | statements = var.policy_statements 23 | freeform_tags = var.oci_tag_values.freeformTags 24 | defined_tags = var.oci_tag_values.definedTags 25 | 26 | depends_on = [oci_identity_dynamic_group.for_policies] 27 | 28 | provider = oci.home_region 29 | 30 | count = var.create_policy ? 1 : 0 31 | } 32 | 33 | locals { 34 | policy_compartment_ocid = var.compartment_ocid != "" ? var.compartment_ocid : var.tenancy_ocid 35 | } -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/terraform.tfvars.example: -------------------------------------------------------------------------------- 1 | app_name = "grafana" 2 | applications = "metrics-server,cert-manager,traefik2-nodeport" 3 | chart_version = "1.15.3" 4 | cluster_name_prefix = "cloudthrill" 5 | cluster_node_count = 2 6 | cluster_node_size = "" 7 | cluster_tools_namespace = "cluster-tools" 8 | cluster_type = "talos" 9 | cluster_web_access = [ 10 | "0.0.0.0/0" 11 | ] 12 | cluster_websecure_access = [ 13 | "0.0.0.0/0" 14 | ] 15 | cni = "flannel" 16 | compute_type = "standard" 17 | grafana_enabled = true 18 | ingress_cluster_issuer = "letsencrypt-prod" 19 | ingress_email_issuer = "no-reply@example.cloud" 20 | ingress_hosts = "" 21 | ingress_hosts_include_nip_io = true 22 | kubernetes_api_access = [ 23 | "0.0.0.0/0" 24 | ] 25 | kubernetes_namespace = "my-namespace" 26 | kubernetes_version = "talos-v1.5.0" 27 | label = "k8s-pool" 28 | metrics_server_enabled = true 29 | network_cidr = "10.20.0.0/16" 30 | network_name = "default" 31 | nip_io_domain = "nip.io" 32 | node_pool_labels = {} 33 | object_store_enabled = false 34 | object_store_prefix = "tf-template-" 35 | object_store_size = 500 36 | prometheus_enabled = true 37 | region = "NYC1" 38 | tags = "terraform" 39 | taints = [ 40 | { 41 | "effect": "NoSchedule", 42 | "key": "My-app-workload", 43 | "value": "frontend" 44 | } 45 | ] 46 | telemetry_namespace = "telemetry-ns" 47 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/vcn/variables.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | variable "compartment_ocid" {} 6 | variable "create_new_vcn" { 7 | default = true 8 | description = "Creates a new Virtual Cloud Network (VCN). If false, the VCN OCID must be provided in the variable 'existent_vcn_ocid'." 9 | } 10 | variable "existent_vcn_ocid" { 11 | default = "" 12 | description = "Using existent Virtual Cloud Network (VCN) OCID." 13 | } 14 | variable "cidr_blocks" { 15 | default = ["10.20.0.0/16"] 16 | description = "IPv4 CIDR Blocks for the Virtual Cloud Network (VCN). If use more than one block, separate them with comma. e.g.: 10.20.0.0/16,10.80.0.0/16" 17 | } 18 | variable "display_name" { 19 | default = "Dev VCN 1" 20 | description = "Display name for the Virtual Cloud Network (VCN)." 21 | } 22 | variable "dns_label" { 23 | default = "vcn1" 24 | description = "DNS Label for Virtual Cloud Network (VCN)." 25 | } 26 | variable "is_ipv6enabled" { 27 | default = false 28 | description = "Whether IPv6 is enabled for the Virtual Cloud Network (VCN)." 29 | } 30 | variable "ipv6private_cidr_blocks" { 31 | default = [] 32 | description = "The list of one or more ULA or Private IPv6 CIDR blocks for the Virtual Cloud Network (VCN)." 33 | } 34 | 35 | # Deployment Details + Freeform Tags + Defined Tags 36 | variable "vcn_tags" { 37 | description = "Tags to be added to the VCN resources" 38 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/cluster-tools/cluster-tools.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Create namespace cluster-tools for supporting services 6 | resource "kubernetes_namespace" "cluster_tools" { 7 | metadata { 8 | name = var.cluster_tools_namespace 9 | } 10 | 11 | count = local.use_cluster_tools_namespace ? 1 : 0 12 | } 13 | 14 | locals { 15 | # Helm repos 16 | helm_repository = { 17 | ingress_nginx = "https://kubernetes.github.io/ingress-nginx" 18 | ingress_nginx_version = "4.11.2" #"4.6.1" 19 | jetstack = "https://charts.jetstack.io" # cert-manager 20 | jetstack_version = "1.15.3" #"1.12.0" # cert-manager 21 | grafana = "https://grafana.github.io/helm-charts" 22 | grafana_version = "8.4.8" #"6.56.5" 23 | prometheus = "https://prometheus-community.github.io/helm-charts" 24 | prometheus_version = "25.26.0" #"22.6.2" 25 | metrics_server = "https://kubernetes-sigs.github.io/metrics-server" 26 | metrics_server_version = "3.12.1" #"3.10.0" 27 | } 28 | use_cluster_tools_namespace = anytrue([var.grafana_enabled, var.ingress_nginx_enabled, var.cert_manager_enabled, var.prometheus_enabled]) ? true : false 29 | } 30 | 31 | # OCI Provider 32 | variable "tenancy_ocid" {} 33 | # variable "compartment_ocid" {} 34 | variable "region" {} 35 | 36 | # Namespace 37 | variable "cluster_tools_namespace" { 38 | default = "cluster-tools" 39 | } -------------------------------------------------------------------------------- /terraform-provider-oci/launch-instance/outputs.tf: -------------------------------------------------------------------------------- 1 | 2 | output "vcn_id" { 3 | description = "OCID of created VCN. " 4 | value = oci_core_vcn.vcnterra.id 5 | } 6 | 7 | output "default_security_list_id" { 8 | description = "OCID of default security list. " 9 | value = oci_core_vcn.vcnterra.default_security_list_id 10 | } 11 | 12 | output "default_dhcp_options_id" { 13 | description = "OCID of default DHCP options. " 14 | value = oci_core_vcn.vcnterra.default_dhcp_options_id 15 | } 16 | 17 | output "default_route_table_id" { 18 | description = "OCID of default route table. " 19 | value = oci_core_vcn.vcnterra.default_route_table_id 20 | } 21 | 22 | output "internet_gateway_id" { 23 | description = "OCID of internet gateway. " 24 | value = oci_core_internet_gateway.gtw.id 25 | } 26 | 27 | output "subnet_ids" { 28 | description = "ocid of subnet ids. " 29 | value = oci_core_subnet.terrasub.*.id 30 | } 31 | ## INSTANCE OUTPUT 32 | 33 | output "instance_id" { 34 | description = "ocid of created instances. " 35 | value = [oci_core_instance.terra_inst.id] 36 | } 37 | 38 | output "private_ip" { 39 | description = "Private IPs of created instances. " 40 | value = [oci_core_instance.terra_inst.private_ip] 41 | } 42 | 43 | output "public_ip" { 44 | description = "Public IPs of created instances. " 45 | value = [oci_core_instance.terra_inst.public_ip] 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # terraform-examples 2 | This repository is aimed to gather labs from different terraform providers to start learning . The terraform for dummies series will include but are not limited to resource deployments for providers like: 3 | - [Azure](https://github.com/brokedba/terraform-examples/tree/master/terraform-provider-azure) 4 | - [AWS](https://github.com/brokedba/terraform-examples/tree/master/terraform-provider-aws) 5 | - [OCI](https://github.com/brokedba/terraform-examples/tree/master/terraform-provider-oci) 6 | - [GCP](https://github.com/brokedba/terraform-examples/tree/master/terraform-provider-gcp) 7 | - [AliBabaCloud](https://github.com/brokedba/terraform-examples/tree/master/terraform-provider-alicloud) 8 | - [Libvirt (for KVM On-prem )](https://github.com/brokedba/terraform-examples/tree/master/terraform-provider-libvirt) 9 | 10 | Please visit my recap blog post for more information ![terraform_for_dummies](https://github.com/user-attachments/assets/efade26f-8cc3-4a69-970e-412e1ea54d31) 11 | 12 | 👉🏻[my-terraform-labs](http://www.brokedba.com/2021/12/my-terraform-labs-2021-cloud-recap.html) 13 | 14 | 15 | # Variables 16 | Some variables used to deploy the steps have default values, check those before deployment to ensure they match your requirements. For more information, there are tables of inputs and outputs for the Terraform configs, each with a detailed description of their variables. Look for variables marked as not required in the section Inputs of these READMEs: 17 | # Recently added Cloud stack 18 | - [ALIBABA CLOUD ](/terraform-provider-alicloud) 19 | # 🎦 Repository Visualization 20 | ![Visualization of the codebase](./diagram.svg) 21 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/cluster-tools.tf: -------------------------------------------------------------------------------- 1 | # Description: This file contains the configuration for deploying Grafana on Kubernetes using Helm. 2 | # Namespace 3 | resource "kubernetes_namespace" "landing_ns" { 4 | depends_on = [local_file.cluster-config] 5 | metadata { 6 | name = var.kubernetes_namespace 7 | } 8 | } 9 | 10 | 11 | 12 | # Create namespace cluster-tools for supporting services 13 | resource "kubernetes_namespace" "cluster_tools" { 14 | metadata { 15 | name = var.cluster_tools_namespace 16 | # allow for privileged prometheus-node-exporter to scrape Hostnetwork & HostPID metrics 17 | labels = { 18 | "pod-security.kubernetes.io/enforce" = "privileged" 19 | } 20 | } 21 | 22 | count = local.use_cluster_tools_namespace ? 1 : 0 23 | 24 | } 25 | 26 | locals { 27 | # Helm repos 28 | helm_repository = { 29 | ingress_nginx = "https://kubernetes.github.io/ingress-nginx" 30 | ingress_nginx_version = "4.11.2" #"4.6.1" 31 | jetstack = "https://charts.jetstack.io" # cert-manager 32 | jetstack_version = "1.15.3" #"1.12.0" # cert-manager 33 | grafana = "https://grafana.github.io/helm-charts" 34 | grafana_version = "8.4.8" #"8.13.1" 35 | prometheus = "https://prometheus-community.github.io/helm-charts" 36 | prometheus_version = "27.11.0" # "25.26.0" 37 | metrics_server = "https://kubernetes-sigs.github.io/metrics-server" 38 | metrics_server_version = "3.12.1" #"3.12.2" 39 | } 40 | use_cluster_tools_namespace = anytrue([var.grafana_enabled, var.prometheus_enabled]) ? true : false 41 | } 42 | 43 | -------------------------------------------------------------------------------- /terraform-provider-aws/launch-instance/cloud-init/amzl_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The AWS Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | 22 | sudo amazon-linux-extras install -y nginx1 23 | sudo systemctl start nginx 24 | sudo systemctl enable nginx 25 | sudo systemctl status nginx 26 | #sudo firewall-cmd --zone=public --permanent --add-service=http 27 | #sudo firewall-cmd --zone=public --permanent --add-service=https 28 | #sudo firewall-cmd --reload 29 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 30 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-aws/launch-instance/cloud-init/sles_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The AWS Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | #cat /etc/os-release 22 | sudo zypper addrepo -G -c 'https://nginx.org/packages/sles/15' nginx 23 | sudo zypper -n install nginx 24 | sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | #zypper in SuSEfirewall2 + add FW_SERVICES_EXT_TCP="22 80 443" in line 253 28 | #sudo firewall-cmd --zone=public --permanent --add-service=https 29 | #sudo firewall-cmd --reload 30 | sudo cat $FILE > /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/sles_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | #cat /etc/os-release 22 | sudo zypper addrepo -G -c 'https://nginx.org/packages/sles/15' nginx 23 | sudo zypper -n install nginx 24 | sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | #zypper in SuSEfirewall2 + add FW_SERVICES_EXT_TCP="22 80 443" in line 253 28 | #sudo firewall-cmd --zone=public --permanent --add-service=https 29 | #sudo firewall-cmd --reload 30 | sudo cat $FILE > /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/sles_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | #cat /etc/os-release 22 | sudo zypper addrepo -G -c 'https://nginx.org/packages/sles/15' nginx 23 | sudo zypper -n install nginx 24 | sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | #zypper in SuSEfirewall2 + add FW_SERVICES_EXT_TCP="22 80 443" in line 253 28 | #sudo firewall-cmd --zone=public --permanent --add-service=https 29 | #sudo firewall-cmd --reload 30 | sudo cat $FILE > /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/sles_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The ALIBABALoco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | #cat /etc/os-release 22 | sudo zypper addrepo -G -c 'https://nginx.org/packages/sles/15' nginx 23 | sudo zypper -n install nginx 24 | sudo systemctl start nginx 25 | sudo systemctl enable nginx 26 | sudo systemctl status nginx 27 | #zypper in SuSEfirewall2 + add FW_SERVICES_EXT_TCP="22 80 443" in line 253 28 | #sudo firewall-cmd --zone=public --permanent --add-service=https 29 | #sudo firewall-cmd --reload 30 | sudo cat $FILE > /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-libvirt/kvm-compute.tf: -------------------------------------------------------------------------------- 1 | provider "libvirt" { 2 | uri = "qemu:///system" 3 | } 4 | terraform { 5 | required_providers { 6 | libvirt = { 7 | source = "dmacvicar/libvirt" 8 | version = "0.6.2" 9 | } 10 | } 11 | } 12 | #provider "libvirt" { 13 | # alias = "server2" 14 | # uri = "qemu+ssh://root@192.168.100.10/system" 15 | #} 16 | 17 | resource "libvirt_volume" "centos7-qcow2" { 18 | name = "centos7.qcow2" 19 | pool = "default" 20 | source = "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2" 21 | #source = "./CentOS-7-x86_64-GenericCloud.qcow2" 22 | format = "qcow2" 23 | } 24 | # Use CloudInit to add our ssh-key to the instance 25 | resource "libvirt_cloudinit_disk" "commoninit" { 26 | name = "commoninit.iso" 27 | pool = "default" #CHANGEME 28 | user_data = data.template_file.user_data.rendered 29 | } 30 | 31 | data "template_file" "user_data" { 32 | template = file("${path.module}/cloud_init.cfg") 33 | } 34 | # Define KVM domain to create 35 | resource "libvirt_domain" "centovm" { 36 | name = "centovm" 37 | memory = "1024" 38 | vcpu = 1 39 | 40 | cloudinit = libvirt_cloudinit_disk.commoninit.id 41 | 42 | network_interface { 43 | network_name = "default" 44 | hostname = "terracentos" 45 | } 46 | 47 | disk { 48 | volume_id = "${libvirt_volume.centos7-qcow2.id}" 49 | } 50 | 51 | console { 52 | type = "pty" 53 | target_type = "serial" 54 | target_port = "0" 55 | } 56 | 57 | graphics { 58 | type = "spice" 59 | listen_type = "address" 60 | autoport = true 61 | } 62 | } -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/bastion/variables.tf: -------------------------------------------------------------------------------- 1 | variable "compartment_ocid" {} 2 | # Network Details 3 | variable "vcn_id" { description = "VCN OCID to deploy OKE Cluster" } 4 | variable "k8s_endpoint_subnet_id" { description = "Kubernetes Endpoint Subnet OCID to deploy OKE Cluster" } 5 | variable "cluster_workers_visibility" { 6 | default = "Private" 7 | description = "The Kubernetes worker nodes that are created will be hosted in public or private subnet(s)" 8 | } 9 | variable "cluster_endpoint_visibility" { 10 | default = "Public" 11 | description = "The Kubernetes cluster that is created will be hosted on a public subnet with a public IP address auto-assigned or on a private subnet. If Private, additional configuration will be necessary to run kubectl commands" 12 | } 13 | 14 | # Bastion details 15 | variable "bastion_cidr_block_allow_list" { 16 | default= "0.0.0.0/0" 17 | } 18 | 19 | variable "bastion_name" { 20 | default = "oke-Bastion" 21 | } 22 | 23 | variable "session_session_ttl_in_seconds" { 24 | default = "10800" 25 | 26 | } 27 | 28 | variable "session_target_resource_details_session_type" { 29 | default = "" 30 | } 31 | 32 | variable "bastion_session_type" { 33 | default = "PORT_FORWARDING" 34 | 35 | } 36 | variable "bastion_session_name" { 37 | default = "oke-bastion-session1" 38 | 39 | } 40 | 41 | variable "public_ssh_key" { 42 | default = "" 43 | description = "In order to access your private nodes with a public SSH key you will need to set up a bastion host (a.k.a. jump box). If using public nodes, bastion is not needed. Left blank to not import keys." 44 | } 45 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/create-vpc/variables.tf: -------------------------------------------------------------------------------- 1 | # Aws account region and autehntication 2 | variable "ali_access_key" {} 3 | variable "ali_secret_key" {} 4 | 5 | variable "prefix" { 6 | description = "The prefix used for the resources group in this example" 7 | default = "TerraDemo" 8 | } 9 | 10 | # Ali Cloud Zone 11 | 12 | variable "ali_zone" { 13 | type = map 14 | default = { 15 | us-east-1 = "us-east-1b" 16 | hongkong = "cn-hongkong-b" # Centos 7 17 | germany = "eu-central-1a" #8.8 18 | UK = "eu-west-1a" 19 | us-west-1 = "us-west-1a" 20 | } 21 | } 22 | 23 | variable "ali_region" { 24 | default = "us-east-1" # "hongkong" have only # 2C4G free tier 3 months , not 1C1G free tier CPus 25 | } 26 | 27 | # VPC INFO 28 | variable "vpc_name" { 29 | default = "Terravpc" 30 | } 31 | 32 | variable "vpc_cidr" { 33 | default = "192.168.0.0/16" 34 | } 35 | 36 | # SUBNET/VSWITCH INFO 37 | variable "vswitch_name"{ 38 | default = "terrasub" 39 | } 40 | 41 | variable "vswitch_cidr"{ 42 | default = "192.168.10.0/24" 43 | } 44 | variable "map_public_ip_on_launch" { 45 | description = "Indicate if instances launched into the VPC's Subnet will be assigned a public IP address . " 46 | default = true 47 | } 48 | 49 | # IGW INFO 50 | variable "igw_name"{ 51 | default = "terra-igw" 52 | } 53 | 54 | # ROUTE TABLE INFO 55 | variable "rt_name"{ 56 | default = "terra-rt" 57 | } 58 | # ROUTE TABLE INFO 59 | variable "sg_name"{ 60 | default = "terra-sg" 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /terraform-provider-oci/launch-instance/cloud-init/vm.cloud-config: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | write_files: 3 | - content: | 4 | 5 | 6 | 7 | 8 | Here you are Papy 9 | 10 | 15 | 16 | 17 |
18 |

Welcome to The OCI Loco Party :D !!!

19 | 20 |
21 | 22 | 23 | 24 | owner: opc:opc 25 | path: /home/opc/index.html 26 | runcmd: 27 | - /bin/yum install -y nginx 28 | - /bin/systemctl start nginx 29 | - /bin/firewall-offline-cmd --add-port=80/tcp 30 | - /bin/systemctl restart firewalld 31 | - cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 32 | - cat /home/opc/index.html > /usr/share/nginx/html/index.html 33 | -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/centos_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 35 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/centos_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The GCP Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 35 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/modules/iam-compartment/variables.tf: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, 2021, Oracle and/or its affiliates. 2 | 3 | variable "tenancy_ocid" { 4 | type = string 5 | description = "(Deprecated) The OCID of the tenancy." 6 | default = null 7 | } 8 | 9 | variable "compartment_id" { 10 | type = string 11 | description = "The OCID of the parent compartment containing the compartment. Allow for sub-compartments creation" 12 | default = null 13 | } 14 | 15 | variable "compartment_name" { 16 | type = string 17 | description = "The name you assign to the compartment during creation. The name must be unique across all compartments in the tenancy. " 18 | default = null 19 | } 20 | 21 | // The description is only used if compartment_create = true. 22 | variable "compartment_description" { 23 | type = string 24 | description = "The description you assign to the compartment. Does not have to be unique, and it's changeable. " 25 | default = null 26 | } 27 | 28 | variable "compartment_create" { 29 | type = bool 30 | description = "(Deprecated) Create the compartment or not. If true, the compartment will be managed by this module, and the user must have permissions to create the compartment; If false, compartment data will be returned about the compartment if it exists, if not found, then an empty string will be returned for the compartment ID." 31 | default = true 32 | } 33 | 34 | variable "enable_delete" { 35 | type = bool 36 | description = "Enable compartment delete on destroy. If true, compartment will be deleted when `terraform destroy` is executed; If false, compartment will not be deleted on `terraform destroy` execution" 37 | default = false 38 | } 39 | -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/variables.tf: -------------------------------------------------------------------------------- 1 | provider "oci" { 2 | tenancy_ocid = var.tenancy_ocid 3 | user_ocid = var.user_ocid 4 | fingerprint = var.fingerprint 5 | private_key_path = var.private_key_path 6 | region = var.region 7 | } 8 | 9 | ############################ 10 | # Hidden Variable Group # 11 | ############################ 12 | variable "tenancy_ocid" {} 13 | variable "user_ocid" {} 14 | variable "fingerprint" {} 15 | variable "private_key_path" {} 16 | variable "region" {} 17 | 18 | variable "main_compartment_name" { 19 | default = "mycomp" 20 | } 21 | variable "main_compartment_desc" { 22 | default = "Enclosing compartment at root level" 23 | } 24 | 25 | variable "app_compartment_name" { 26 | default = "comp-app" 27 | } 28 | ###################### 29 | # locals : compartment 30 | ###################### 31 | # all cases in one map 32 | locals { 33 | compartments = { 34 | l1_subcomp = { 35 | comp-shared = "for shared services like AD, Commvault,Monitoring" 36 | comp-network = "for all FW, VCNs and LBRs" 37 | comp-security = "for Security related resources like Vaults, keys" 38 | (var.app_compartment_name) = "Parent compartment for all application resources" 39 | }, 40 | l2_subcomp = { 41 | "${var.app_compartment_name}-prod" = " production VMs" 42 | "${var.app_compartment_name}-nprod" = "non-production VMs" 43 | "${var.app_compartment_name}-dr" = "DR VMs" 44 | "${var.app_compartment_name}-db" = "Database instances and resources" 45 | } 46 | } 47 | } 48 | 49 | 50 | ############################ 51 | # Additional Configuration # 52 | ############################ -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/vm.cloud-config: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | write_files: 3 | - content: | 4 | 5 | 6 | 7 | 8 | Here you are Papy 9 | 10 | 15 | 16 | 17 |
18 |

ALIBABA Loco Party Chapter II

19 | 20 |
21 | 22 | 23 | 24 | owner: centos:centos 25 | path: /home/centos/index.html 26 | runcmd: 27 | - /bin/yum install -y nginx 28 | - /bin/systemctl start nginx 29 | - /bin/firewall-offline-cmd --add-port=80/tcp 30 | - /bin/systemctl restart firewalld 31 | - cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 32 | - cat /home/centos/index.html > /usr/share/nginx/html/index.html 33 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/centos_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The ALIBABA Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 35 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-azure/create-vnet/outputs.tf: -------------------------------------------------------------------------------- 1 | output "vnet_name" { 2 | description = "The Name of the newly created vNet" 3 | value = azurerm_virtual_network.terra_vnet.name 4 | } 5 | output "vnet_id" { 6 | description = "id of created VNET. " 7 | value = azurerm_virtual_network.terra_vnet.id 8 | } 9 | output "vnet_CIDR" { 10 | description = "cidr block of created VNET. " 11 | value = azurerm_virtual_network.terra_vnet.address_space 12 | } 13 | 14 | output "Subnet_Name" { 15 | description = "Name of created VNET's Subnet. " 16 | value = azurerm_subnet.terra_sub.name 17 | } 18 | output "Subnet_id" { 19 | description = "id of created VNET. " 20 | value = azurerm_subnet.terra_sub.id 21 | } 22 | output "Subnet_CIDR" { 23 | description = "cidr block of VNET's Subnet. " 24 | value = azurerm_subnet.terra_sub.address_prefixes 25 | } 26 | 27 | 28 | output "vnet_dedicated_security_group_Name" { 29 | description = "Security Group Name. " 30 | value = azurerm_network_security_group.terra_nsg.name 31 | } 32 | output "vnet_dedicated_security_group_id" { 33 | description = "Security group id. " 34 | value = azurerm_network_security_group.terra_nsg.id 35 | } 36 | output "vnet_dedicated_security_ingress_rules" { 37 | description = "Shows ingress rules of the Security group " 38 | value = azurerm_network_security_group.terra_nsg.security_rule 39 | } 40 | # formatlist("%s: %s" ,azurerm_network_security_group.terra_sg.ingress[*].description,formatlist("%s , CIDR: %s", azurerm_network_security_group.terra_sg.ingress[*].to_port,azurerm_network_security_group.terra_sg.ingress[*].cidr_blocks[0])) 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke/oke-orm-private-endpoint.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | ### Important Notice ### 6 | # OCI Resource Manager Private Endpoint is only available when using Resource Manager. 7 | # If you use local Terraform, you will need to setup an OCI Bastion for connectivity to the Private OKE. 8 | # If using OCI CloudShell, you need to activate the OCI Private Endpoint for OCI CLoud Shell. 9 | 10 | resource "oci_resourcemanager_private_endpoint" "private_kubernetes_endpoint" { 11 | compartment_id = local.oke_compartment_ocid 12 | display_name = "Private Endpoint for OKE ${local.app_name} - ${local.deploy_id}" 13 | description = "Resource Manager Private Endpoint for OKE for the ${local.app_name} - ${local.deploy_id}" 14 | vcn_id = var.vcn_id 15 | subnet_id = var.k8s_endpoint_subnet_id 16 | freeform_tags = var.cluster_tags.freeformTags 17 | defined_tags = var.cluster_tags.definedTags 18 | 19 | count = var.create_new_oke_cluster ? ((var.cluster_endpoint_visibility == "Private") ? 1 : 0) : 0 20 | } 21 | 22 | # Resolves the private IP of the customer's private endpoint to a NAT IP. 23 | data "oci_resourcemanager_private_endpoint_reachable_ip" "private_kubernetes_endpoint" { 24 | private_endpoint_id = var.create_new_oke_cluster ? oci_resourcemanager_private_endpoint.private_kubernetes_endpoint[0].id : var.existent_oke_cluster_private_endpoint 25 | private_ip = trimsuffix(oci_containerengine_cluster.oke_cluster[0].endpoints.0.private_endpoint, ":6443") # TODO: Pending rule when has existent cluster 26 | 27 | count = (var.cluster_endpoint_visibility == "Private") ? 1 : 0 28 | } -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/output.tf: -------------------------------------------------------------------------------- 1 | output "kubernetes_cluster_name" { 2 | value = civo_kubernetes_cluster.cluster.name 3 | } 4 | 5 | output "master_ip" { 6 | value = civo_kubernetes_cluster.cluster.master_ip 7 | } 8 | output "kubernetes_cluster_endpoint" { 9 | value = civo_kubernetes_cluster.cluster.api_endpoint 10 | } 11 | 12 | output "kubernetes_cluster_id" { 13 | value = civo_kubernetes_cluster.cluster.id 14 | } 15 | 16 | output "kubernetes_cluster_status" { 17 | value = civo_kubernetes_cluster.cluster.status 18 | } 19 | 20 | output "kubernetes_cluster_ready" { 21 | value = civo_kubernetes_cluster.cluster.ready 22 | } 23 | 24 | output "kubernetes_cluster_version" { 25 | value = civo_kubernetes_cluster.cluster.kubernetes_version 26 | } 27 | 28 | output "network_id" { 29 | description = "The ID of the Civo Network." 30 | value = local.network_id 31 | } 32 | 33 | 34 | 35 | 36 | output "cluster_installed_applications" { 37 | value = civo_kubernetes_cluster.cluster.installed_applications[*].application 38 | } 39 | 40 | 41 | output "ingress_controller_load_balancer_hostname" { 42 | value = data.kubernetes_service.traefik.status[0].load_balancer.0.ingress.0.hostname 43 | } 44 | 45 | 46 | output "grafana_url" { 47 | value = local.app_nip_io_domain 48 | } 49 | 50 | # output "namespace_id" { 51 | 52 | # value = kubernetes_namespace.cluster_tools 53 | # } 54 | 55 | # Node pools 56 | /* output "node_pool_instance_names" { 57 | # description = "List of instance names in each node pool." 58 | # value = { 59 | # for pool_key, pool in module.civo_node_pools : 60 | # pool_key => pool.instance_names 61 | # } 62 | # } 63 | output "node_pool_ids" { 64 | description = "List of IDs of the Civo Kubernetes Node Pools." 65 | value = [for pool in module.civo_node_pools : pool.node_pool_id] 66 | } 67 | */ -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | output "comments" { 6 | value = "The application URL will be unavailable for a few minutes after provisioning while the application is configured and deployed to Kubernetes" 7 | } 8 | output "deployed_oke_kubernetes_version" { 9 | value = local.deployed_k8s_version 10 | } 11 | output "deployed_to_region" { 12 | value = var.region 13 | } 14 | output "dev" { 15 | value = "Made with \u2764 by Oracle Developers. Forked and Hacked by @Clouddude🍉" 16 | } 17 | output "kubeconfig" { 18 | value = data.oci_containerengine_cluster_kube_config.oke.content 19 | } 20 | output "kubeconfig_for_kubectl" { 21 | value = "export KUBECONFIG=${path.root}/generated/kubeconfig" 22 | description = "If using Terraform locally, this command set KUBECONFIG environment variable to run kubectl locally" 23 | } 24 | output "orm_private_endpoint_oke_api_ip_address" { 25 | value = (var.cluster_endpoint_visibility == "Private") ? data.oci_resourcemanager_private_endpoint_reachable_ip.private_kubernetes_endpoint.0.ip_address : "" 26 | description = "OCI Resource Manager Private Endpoint ip address for OKE Kubernetes API Private Endpoint" 27 | 28 | depends_on = [ 29 | oci_resourcemanager_private_endpoint.private_kubernetes_endpoint 30 | ] 31 | } 32 | 33 | # OKE info 34 | output "oke_cluster_ocid" { 35 | value = var.create_new_oke_cluster ? oci_containerengine_cluster.oke_cluster[0].id : "" 36 | description = "OKE Cluster OCID" 37 | } 38 | output "oke_cluster_compartment_ocid" { 39 | value = local.oke_compartment_ocid 40 | description = "Compartment OCID used by the OKE Cluster" 41 | } 42 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/cluster.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | node_size = coalesce( 3 | var.cluster_node_size, 4 | var.compute_type == "ai" ? element(data.civo_size.ai.sizes, 0).name : element(data.civo_size.standard.sizes, 0).name 5 | ) 6 | kubernetes_version = ( 7 | length(data.civo_kubernetes_version.latest_talos.versions) > 0 ? 8 | coalesce(var.kubernetes_version, data.civo_kubernetes_version.latest_talos.versions[0].version) : 9 | var.kubernetes_version 10 | ) 11 | } 12 | 13 | resource "civo_kubernetes_cluster" "cluster" { 14 | name = "${var.cluster_name_prefix}-cluster" 15 | cluster_type = var.cluster_type 16 | kubernetes_version = local.kubernetes_version 17 | network_id = local.network_id # if not declare we use the default one 18 | firewall_id = civo_firewall.firewall.id 19 | region = var.region 20 | 21 | cni = var.cni # Talos cluster type only support "flannel" 22 | 23 | write_kubeconfig = true 24 | applications = var.cluster_type == "talos" ? "" : var.applications # "civo-cluster-autoscaler" applications = var.applications 25 | 26 | pools { 27 | node_count = var.cluster_node_count 28 | size = local.node_size 29 | label = var.label # "my-pool-label" This label will be set as an annotation on the nodes in the pool 30 | # labels = var.node_pool_labels 31 | # taints = var.taints 32 | } 33 | timeouts { 34 | create = "5m" 35 | } 36 | # tags = var.tags 37 | # lifecycle { 38 | # ignore_changes = [ kubernetes_version] 39 | # } 40 | } 41 | 42 | resource "local_file" "cluster-config" { 43 | content = civo_kubernetes_cluster.cluster.kubeconfig 44 | filename = "${path.module}/kubeconfig" 45 | file_permission = "0600" 46 | directory_permission = "0755" 47 | } -------------------------------------------------------------------------------- /terraform-provider-aws/launch-instance/cloud-init/el_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The AWS Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | #sudo firewall-cmd --zone=public --permanent --add-service=http 35 | #sudo firewall-cmd --zone=public --permanent --add-service=https 36 | #sudo firewall-cmd --reload 37 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 38 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-aws/launch-instance/cloud-init/vm.cloud-config: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | write_files: 3 | - content: | 4 | 5 | 6 | 7 | 8 | Here you are Papy 9 | 10 | 15 | 16 | 17 |
18 |

Welcome to The AWS Loco Party :D !!!

19 | 20 |
21 | 22 | 23 | 24 | owner: centos:centos 25 | path: /home/centos/index.html 26 | runcmd: 27 | - /bin/yum install -y nginx 28 | - /bin/systemctl start nginx 29 | - /bin/firewall-offline-cmd --add-port=80/tcp 30 | - /bin/systemctl restart firewalld 31 | - cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 32 | - cat /home/centos/index.html > /usr/share/nginx/html/index.html 33 | - mkfs -t xfs /dev/xvdb 34 | - mkdir /data 35 | - cp /etc/fstab /etc/fstab.orig 36 | - sudo mount /dev/xvdf /data 37 | -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/olinux_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo firewall-cmd --zone=public --permanent --add-service=http 35 | sudo firewall-cmd --zone=public --permanent --add-service=https 36 | sudo firewall-cmd --reload 37 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 38 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/olinux_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo firewall-cmd --zone=public --permanent --add-service=http 35 | sudo firewall-cmd --zone=public --permanent --add-service=https 36 | sudo firewall-cmd --reload 37 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 38 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-alicloud/README.md: -------------------------------------------------------------------------------- 1 | # Alibaba Cloud Infrastructure Provider Examples 2 | 3 | This directory contains Terraform configuration files showing how to create specific resources. 4 | - The create-vpc is intended to demonstrate how to create a vpc along with Vswitch and security group rules. 5 | - The launch-instance contains both the vpc configuration we used above and the instance provisioning configuration. 6 | - For details on how to run these samples please refere to my blog post 7 | 8 | [Terraform for dummies part 6: Deploy a static website on Alibaba Cloud](http://www.brokedba.blogspot.com/2023/11/terraform-for-dummies-part-7-deploy.html) 9 | ![image](https://github.com/brokedba/terraform-examples/assets/29458929/07e6e70a-1d8e-4f17-a794-522ba9b80231) 10 | 11 | ![Topology1](https://github-production-user-asset-6210df.s3.amazonaws.com/29458929/280509394-9114f2cc-2c06-4372-8d13-b01077f4b850.png) 12 | 13 | `` Please run either one of them at a time (apply and destroy before runing the other) as the VPC attributes are the same . 14 | `` 15 | 16 | 17 | **Terraform Console**: 18 | - ***Functions:*** Although terraform is a declarative language, there are still myriads of functions you can use to process strings/number/lists/mappings etc. 19 | you will find an excellent all in one script with examples of most terraform functions in [terrafunctions.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terrafunctions.sh) 20 | 21 | - ***expressions:*** Same goes for expressions here is a simple shell script that creates a main.tf with multiples expressions and apply it for you [terraexpression.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terraexpressions.sh) No need to deploy anything in the cloud it's all local. 22 | 23 | Credit : [CloudaFFair](https://cloudaffaire.com/terraform-functions/) 24 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/el_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The ALIBABA Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | #sudo firewall-cmd --zone=public --permanent --add-service=http 35 | #sudo firewall-cmd --zone=public --permanent --add-service=https 36 | #sudo firewall-cmd --reload 37 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 38 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/rhel_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo firewall-offline-cmd --add-port=80/tcp 35 | sudo firewall-offline-cmd --add-port=443/tcp 36 | sudo /bin/systemctl restart firewalld 37 | #sudo firewall-cmd --reload 38 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 39 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/rhel_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo firewall-offline-cmd --add-port=80/tcp 35 | sudo firewall-offline-cmd --add-port=443/tcp 36 | sudo /bin/systemctl restart firewalld 37 | #sudo firewall-cmd --reload 38 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 39 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-oci/database-system/bastion.tf: -------------------------------------------------------------------------------- 1 | 2 | 3 | resource "oci_bastion_bastion" "mybastion" { 4 | #Required 5 | bastion_type = "standard" 6 | compartment_id = var.compartment_ocid 7 | target_subnet_id = oci_core_subnet.terraDB.id 8 | #oci_core_subnet.db_subnet.id 9 | name = var.bastion_name 10 | client_cidr_block_allow_list = [var.bastion_cidr_block_allow_list] 11 | /* 12 | #Optional 13 | client_cidr_block_allow_list = var.bastion_cidr_block_allow_list 14 | #defined_tags = {"foo-namespace.bar-key"= "value"} 15 | freeform_tags = {"bar-key"= "value"} 16 | max_session_ttl_in_seconds = "10800" 17 | phone_book_entry = var.bastion_phone_book_entry 18 | # static_jump_host_ip_addresses = var.bastion_static_jump_host_ip_addresses 19 | */ 20 | } 21 | 22 | 23 | ################################## 24 | # Bastion Session 25 | ################################## 26 | resource "oci_bastion_session" "mybastion_session" { 27 | #Required 28 | bastion_id = oci_bastion_bastion.mybastion.id 29 | key_details { 30 | #Required 31 | public_key_content = file(var.ssh_public_key) 32 | } 33 | target_resource_details { 34 | #Required 35 | session_type = var.bastion_session_type 36 | 37 | #Optional 38 | target_resource_port = "22" #var.bastion_session_port 39 | target_resource_private_ip_address = "192.168.78.10" # oci_database_db_system.MYDBSYS.private_ip 40 | # target_resource_id = oci_bastion_target_resource.test_target_resource.id -->MANAGED_SSH 41 | # target_resource_operating_system_user_name = oci_identity_user.test_user.name -->MANAGED_SSH 42 | } 43 | 44 | #Optional 45 | display_name = var.bastion_session_name #Session-Mybastion 46 | key_type = "PUB" 47 | session_ttl_in_seconds = var.session_session_ttl_in_seconds #"10800" 48 | 49 | } 50 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/bastion/bastion.tf: -------------------------------------------------------------------------------- 1 | 2 | 3 | resource "oci_bastion_bastion" "mybastion" { 4 | #Required 5 | bastion_type = "standard" 6 | compartment_id = var.compartment_ocid 7 | target_subnet_id = var.k8s_endpoint_subnet_id 8 | name = var.bastion_name 9 | client_cidr_block_allow_list = [var.bastion_cidr_block_allow_list] 10 | /* 11 | #Optional 12 | client_cidr_block_allow_list = var.bastion_cidr_block_allow_list 13 | #defined_tags = {"foo-namespace.bar-key"= "value"} 14 | freeform_tags = {"bar-key"= "value"} 15 | max_session_ttl_in_seconds = "10800" 16 | phone_book_entry = var.bastion_phone_book_entry 17 | # static_jump_host_ip_addresses = var.bastion_static_jump_host_ip_addresses 18 | */ 19 | } 20 | 21 | 22 | ################################## 23 | # Bastion Session 24 | ################################## 25 | resource "oci_bastion_session" "mybastion_session" { 26 | #Required 27 | bastion_id = oci_bastion_bastion.mybastion.id 28 | key_details { 29 | #Required 30 | public_key_content = file(var.ssh_public_key) 31 | } 32 | target_resource_details { 33 | #Required 34 | session_type = var.bastion_session_type 35 | 36 | #Optional 37 | target_resource_port = "22" #var.bastion_session_port 38 | target_resource_private_ip_address = "192.168.78.10" # oci_database_db_system.MYDBSYS.private_ip 39 | # target_resource_id = oci_bastion_target_resource.test_target_resource.id -->MANAGED_SSH 40 | # target_resource_operating_system_user_name = oci_identity_user.test_user.name -->MANAGED_SSH 41 | } 42 | 43 | #Optional 44 | display_name = var.bastion_session_name #Session-Mybastion 45 | key_type = "PUB" 46 | session_ttl_in_seconds = var.session_session_ttl_in_seconds #"10800" 47 | 48 | } -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/olinux_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The ALIBABA Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo firewall-cmd --zone=public --permanent --add-service=http 35 | sudo firewall-cmd --zone=public --permanent --add-service=https 36 | sudo firewall-cmd --reload 37 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 38 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/rhel_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The ALIBABA Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo firewall-offline-cmd --add-port=80/tcp 35 | sudo firewall-offline-cmd --add-port=443/tcp 36 | sudo /bin/systemctl restart firewalld 37 | #sudo firewall-cmd --reload 38 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 39 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/el_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo /bin/systemctl enable firewalld 35 | sudo /bin/systemctl start firewalld 36 | sudo firewall-cmd --zone=public --permanent --add-service=http 37 | sudo firewall-cmd --zone=public --permanent --add-service=https 38 | sudo firewall-cmd --reload 39 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 40 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/el_userdata.txt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo echo Script started > /tmp/script.log 3 | 4 | FILE="/tmp/index.html" 5 | sudo /bin/cat <$FILE 6 | 7 | Here you are Papy 8 | 12 | 13 | 14 |
15 |

Welcome to The Azure Loco Party :D !!!

16 | 17 |
18 | 19 | 20 | EOF 21 | YUM_REPO="/etc/yum.repos.d/nginx.repo" 22 | sudo /bin/cat <$YUM_REPO 23 | [nginx] 24 | name=nginx repo 25 | baseurl=http://nginx.org/packages/mainline/rhel/7/\$basearch/ 26 | gpgcheck=0 27 | enabled=1 28 | EOF 29 | 30 | sudo yum install -y nginx 31 | sudo systemctl start nginx 32 | sudo systemctl enable nginx 33 | sudo systemctl status nginx 34 | sudo /bin/systemctl enable firewalld 35 | sudo /bin/systemctl start firewalld 36 | sudo firewall-cmd --zone=public --permanent --add-service=http 37 | sudo firewall-cmd --zone=public --permanent --add-service=https 38 | sudo firewall-cmd --reload 39 | sudo cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index.original.html 40 | sudo cp $FILE /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/modules/iam-compartment/output.tf: -------------------------------------------------------------------------------- 1 | output "compartment_id" { 2 | description = "Compartment ocid" 3 | // This allows the compartment ID to be retrieved from the resource if it exists, and if not to use the data source. 4 | value = var.compartment_create ? element(concat(oci_identity_compartment.this.*.id, tolist([""])), 0) : lookup(local.compartment_ids[0], "id") 5 | } 6 | 7 | output "parent_compartment_id" { 8 | description = "Parent Compartment ocid" 9 | // This allows the compartment ID to be retrieved from the resource if it exists, and if not to use the data source. 10 | value = var.compartment_create ? element(concat(oci_identity_compartment.this.*.compartment_id, tolist([""])), 0) : lookup(local.parent_compartment_ids[0], "compartment_id") 11 | } 12 | 13 | output "compartment_name" { 14 | description = "Compartment name" 15 | value = var.compartment_name 16 | } 17 | 18 | output "compartment_description" { 19 | description = "Compartment description" 20 | value = var.compartment_description 21 | } 22 | 23 | /* 24 | output "level_1_sub_compartments" { 25 | description = "compartment name, description, ocid, and parent ocid" 26 | value = { 27 | name = module.level_1_sub_compartments.compartment_name, 28 | description = module.level_1_sub_compartments.compartment_description, 29 | ocid = module.level_1_sub_compartments.compartment_id, 30 | parent = module.level_1_sub_compartments.parent_compartment_id 31 | } 32 | } 33 | 34 | output "level_2_sub_compartments" { 35 | description = "compartment name, description, ocid, and parent ocid" 36 | value = { 37 | name = module.level_2_sub_compartments.compartment_name, 38 | description = module.level_2_sub_compartments.compartment_description, 39 | ocid = module.level_2_sub_compartments.compartment_id, 40 | parent = module.level_2_sub_compartments.parent_compartment_id 41 | } 42 | } 43 | */ -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | 3 | The Universal Permissive License (UPL), Version 1.0 4 | 5 | Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this 6 | software, associated documentation and/or data (collectively the "Software"), free of charge and under any and 7 | all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor 8 | hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or 9 | (ii) the Larger Works (as defined below), to deal in both 10 | 11 | (a) the Software, and 12 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software 13 | (each a “Larger Work” to which the Software is contributed by such licensors), 14 | 15 | without restriction, including without limitation the rights to copy, create derivative works of, display, 16 | perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have 17 | sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms. 18 | 19 | This license is subject to the following condition: 20 | The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must 21 | be included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 24 | THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 26 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 27 | IN THE SOFTWARE. 28 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Deployment outputs 6 | output "stack_version" { 7 | value = file("${path.module}/VERSION") 8 | } 9 | output "deploy_id" { 10 | value = local.deploy_id 11 | } 12 | 13 | # OKE Outputs 14 | output "comments" { 15 | value = module.oke.comments 16 | } 17 | output "deployed_oke_kubernetes_version" { 18 | value = module.oke.deployed_oke_kubernetes_version 19 | } 20 | output "deployed_to_region" { 21 | value = module.oke.deployed_to_region 22 | } 23 | output "cluster_endpoint_visibility" { 24 | description = "The visibility of the cluster endpoint." 25 | value = var.cluster_endpoint_visibility 26 | } 27 | output "kubeconfig" { 28 | value = module.oke.kubeconfig 29 | sensitive = true 30 | } 31 | output "kubeconfig_for_kubectl" { 32 | value = module.oke.kubeconfig_for_kubectl 33 | description = "If using Terraform locally, this sets KUBECONFIG environment variable to run kubectl locally" 34 | } 35 | output "oke_cluster_ocid" { 36 | value = module.oke.oke_cluster_ocid 37 | } 38 | output "oke_node_pools" { 39 | value = module.oke_node_pools 40 | } 41 | output "subnets" { 42 | value = module.subnets 43 | } 44 | 45 | output "dev" { 46 | value = module.oke.dev 47 | } 48 | ### Important Security Notice ### 49 | # The private key generated by this resource will be stored unencrypted in your Terraform state file. 50 | # Use of this resource for production deployments is not recommended. 51 | # Instead, generate a private key file outside of Terraform and distribute it securely to the system where Terraform will be run. 52 | output "generated_private_key_pem" { 53 | value = var.generate_public_ssh_key ? tls_private_key.oke_worker_node_ssh_key.private_key_pem : "No Keys Auto Generated" 54 | sensitive = true 55 | } 56 | 57 | 58 | output "cluster_type_value" { 59 | value = var.cluster_type 60 | } 61 | -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/Win_userdata.txt: -------------------------------------------------------------------------------- 1 | cd C:\Users\Administrator 2 | powershell Set-ExecutionPolicy Unrestricted 3 | powershell New-NetFirewallRule -Display 'EC2 HTTP Inbound' -Dir Inbound -Action Allow -Prot TCP -LocalP @('80', '443') 4 | echo param($url, $filename)> "download.ps1" 5 | echo $client = new-object System.Net.WebClient>> "download.ps1" 6 | echo $client.DownloadFile( $url, $filename)>> "download.ps1" 7 | powershell -ExecutionPolicy RemoteSigned -File "download.ps1" "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 8 | powershell -NoP -NonI -Command "Expand-Archive -Force '.\nginx-1.19.2.zip' '.\'" 9 | cd nginx-1.19.2 10 | ren html\index.html "index.original.html" 11 | cd html 12 | echo ^^>"index.html" 13 | echo ^^<^title^>Here you are Papy^<^/title^>>>"index.html" 14 | echo ^^ >>"index.html" 15 | echo .videoWrapper { position: absolute;top: 0;left: 0;width: 100%%;height: 100%%;background-image: linear-gradient(to top, #86377b 20%%, #27273c 80%%);}>>"index.html" 16 | echo .videoWrapper iframe { top: 10;left: 50;width: 100%%;height: 100%%;}>>"index.html" 17 | echo .centered {position: absolute;top: 10%%;left: 35%%;}^>>"index.html" 18 | echo ^>>"index.html" 19 | echo ^>>"index.html" 20 | echo ^
>>"index.html" 21 | echo ^
^

Welcome to The ^ AWS Loco Party :D !!!^^ ^>>"index.html" 22 | echo ^" >>index.html 23 | echo "

" >>index.html 24 | echo "" >>index.html 25 | echo "" >>index.html 26 | cd .. 27 | start nginx.exe 28 | 29 | -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/Win_userdata.ps: -------------------------------------------------------------------------------- 1 | cd C:\Users\Administrator 2 | powershell Set-ExecutionPolicy Unrestricted 3 | powershell New-NetFirewallRule -Display 'EC2 HTTP Inbound' -Dir Inbound -Action Allow -Prot TCP -LocalP @('80', '443') 4 | echo param($url, $filename)> "download.ps1" 5 | echo $client = new-object System.Net.WebClient>> "download.ps1" 6 | echo $client.DownloadFile( $url, $filename)>> "download.ps1" 7 | powershell -ExecutionPolicy RemoteSigned -File "download.ps1" "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 8 | powershell -NoP -NonI -Command "Expand-Archive -Force '.\nginx-1.19.2.zip' '.\'" 9 | cd nginx-1.19.2 10 | ren html\index.html "index.original.html" 11 | cd html 12 | echo "" >index.html 13 | echo "Here you are Papy">>index.html 14 | echo "" >>index.html 18 | echo "" >>index.html 19 | echo "" >>index.html 20 | echo "
" >>index.html 21 | echo "

Welcome to The AWS Loco Party :D !!!

" >>index.html 22 | echo "" >>index.html 23 | echo "
" >>index.html 24 | echo "" >>index.html 25 | echo "" >>index.html 26 | cd .. 27 | start nginx.exe 28 | 29 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oke-node-pool/datasources.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | # Gets supported Kubernetes versions for node pools 6 | data "oci_containerengine_node_pool_option" "node_pool" { 7 | node_pool_option_id = "all" 8 | } 9 | 10 | # Gets a list of supported images based on the shape, operating_system and operating_system_version provided 11 | data "oci_core_images" "node_pool_images" { 12 | compartment_id = var.oke_cluster_compartment_ocid 13 | operating_system = var.image_operating_system 14 | operating_system_version = var.image_operating_system_version 15 | shape = var.node_pool_shape 16 | sort_by = "TIMECREATED" 17 | sort_order = "DESC" 18 | } 19 | 20 | # Gets a list of Availability Domains 21 | data "oci_identity_availability_domains" "ADs" { 22 | compartment_id = var.tenancy_ocid 23 | } 24 | # Gets a specfic Availability Domain 25 | data "oci_identity_availability_domain" "specfic" { 26 | compartment_id = var.tenancy_ocid 27 | ad_number = var.node_pool_shape_specific_ad 28 | 29 | count = (var.node_pool_shape_specific_ad > 0) ? 1 : 0 30 | } 31 | 32 | # Prepare Cloud Unit for Node Pool nodes 33 | data "cloudinit_config" "nodes" { 34 | gzip = true 35 | base64_encode = true 36 | 37 | part { 38 | content_type = "text/x-shellscript" 39 | content = </var/run/oke-init.sh 42 | bash /var/run/oke-init.sh ${var.node_pool_oke_init_params} 43 | /usr/libexec/oci-growfs -y 44 | EOF 45 | } 46 | 47 | dynamic "part" { 48 | for_each = var.node_pool_cloud_init_parts 49 | content { 50 | content_type = part.value["content_type"] 51 | content = part.value["content"] 52 | filename = part.value["filename"] 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/cloud-init/Win_userdata.ps1: -------------------------------------------------------------------------------- 1 | #cd C:\Users\azureuser 2 | Set-ExecutionPolicy Unrestricted -Force 3 | New-NetFirewallRule -Display 'EC2 HTTP Inbound' -Dir Inbound -Action Allow -Prot TCP -LocalP @('80', '443') 4 | function down_ngx { 5 | param($url, $filename) 6 | $client = New-Object System.Net.WebClient 7 | $client.DownloadFile( $url, $filename) 8 | } 9 | 10 | down_ngx "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 11 | #-ExecutionPolicy RemoteSigned -File "download.ps1" "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 12 | Expand-Archive -Force '.\nginx-1.19.2.zip' '.\' 13 | Remove-Item -Path nginx-1.19.2.zip 14 | cd nginx-1.19.2 15 | ren html\index.html "index.original.html" 16 | cd html 17 | echo "" >index.html 18 | echo "Here you are Papy">>index.html 19 | echo "" >>index.html 23 | echo "" >>index.html 24 | echo "" >>index.html 25 | echo "
" >>index.html 26 | echo "

Welcome to The Azure Loco Party :D !!!

" >>index.html 27 | echo "" >>index.html 28 | echo "
" >>index.html 29 | echo "" >>index.html 30 | echo "" >>index.html 31 | cd .. 32 | start nginx.exe -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/cloud-init/Win_userdata.ps1: -------------------------------------------------------------------------------- 1 | #cd C:\Users\azureuser 2 | Set-ExecutionPolicy Unrestricted -Force 3 | New-NetFirewallRule -Display 'EC2 HTTP Inbound' -Dir Inbound -Action Allow -Prot TCP -LocalP @('80', '443') 4 | function down_ngx { 5 | param($url, $filename) 6 | $client = New-Object System.Net.WebClient 7 | $client.DownloadFile( $url, $filename) 8 | } 9 | 10 | down_ngx "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 11 | #-ExecutionPolicy RemoteSigned -File "download.ps1" "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 12 | Expand-Archive -Force '.\nginx-1.19.2.zip' '.\' 13 | Remove-Item -Path nginx-1.19.2.zip 14 | cd nginx-1.19.2 15 | ren html\index.html "index.original.html" 16 | cd html 17 | echo "" >index.html 18 | echo "Here you are Papy">>index.html 19 | echo "" >>index.html 23 | echo "" >>index.html 24 | echo "" >>index.html 25 | echo "
" >>index.html 26 | echo "

Welcome to The Azure Loco Party :D !!!

" >>index.html 27 | echo "" >>index.html 28 | echo "
" >>index.html 29 | echo "" >>index.html 30 | echo "" >>index.html 31 | cd .. 32 | start nginx.exe -------------------------------------------------------------------------------- /terraform-provider-aws/launch-instance/cloud-init/Win_userdata.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/Win_userdata.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/Win_userdata.ps: -------------------------------------------------------------------------------- 1 | cd C:\Users\Administrator 2 | powershell Set-ExecutionPolicy Unrestricted 3 | powershell New-NetFirewallRule -Display 'EC2 HTTP Inbound' -Dir Inbound -Action Allow -Prot TCP -LocalP @('80', '443') 4 | echo param($url, $filename)> "download.ps1" 5 | echo $client = new-object System.Net.WebClient>> "download.ps1" 6 | echo $client.DownloadFile( $url, $filename)>> "download.ps1" 7 | powershell -ExecutionPolicy RemoteSigned -File "download.ps1" "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 8 | powershell -NoP -NonI -Command "Expand-Archive -Force '.\nginx-1.19.2.zip' '.\'" 9 | cd nginx-1.19.2 10 | ren html\index.html "index.original.html" 11 | cd html 12 | echo "" >index.html 13 | echo "Here you are Papy">>index.html 14 | echo "" >>index.html 18 | echo "" >>index.html 19 | echo "" >>index.html 20 | echo "
" >>index.html 21 | echo "

Welcome to The ALIBABA Loco Party :D !!!

" >>index.html 22 | echo "" >>index.html 23 | echo "
" >>index.html 24 | echo "" >>index.html 25 | echo "" >>index.html 26 | cd .. 27 | start nginx.exe 28 | 29 | -------------------------------------------------------------------------------- /terraform-provider-gcp/launch-instance/outputs.tf: -------------------------------------------------------------------------------- 1 | output "vpc_name" { 2 | description = "The Name of the newly created vpc" 3 | value = google_compute_network.terra_vpc.name 4 | } 5 | #output "vpc_id" { 6 | # description = "id of created vpc. " 7 | # value = google_compute_network.terra_vpc.id 8 | # } 9 | 10 | output "Subnet_Name" { 11 | description = "Name of created vpc's Subnet. " 12 | value = google_compute_subnetwork.terra_sub.name 13 | } 14 | output "Subnet_id" { 15 | description = "id of created vpc. " 16 | value = google_compute_subnetwork.terra_sub.id 17 | } 18 | output "Subnet_CIDR" { 19 | description = "cidr block of vpc's Subnet. " 20 | value = google_compute_subnetwork.terra_sub.ip_cidr_range 21 | } 22 | 23 | output "fire_wall_rules" { 24 | description = "Shows ingress rules of the Security group " 25 | value = google_compute_firewall.web-server.allow 26 | } 27 | 28 | ## INSTANCE OUTPUT 29 | 30 | output "instance_name" { 31 | description = " id of created instances. " 32 | value = google_compute_instance.terra_instance.name 33 | } 34 | 35 | output "hostname" { 36 | description = " id of created instances. " 37 | value = google_compute_instance.terra_instance.hostname 38 | } 39 | 40 | output "private_ip" { 41 | description = "Private IPs of created instances. " 42 | value = google_compute_instance.terra_instance.network_interface.0.network_ip 43 | } 44 | 45 | output "public_ip" { 46 | description = "Public IPs of created instances. " 47 | value = google_compute_instance.terra_instance.network_interface.0.access_config.0.nat_ip 48 | } 49 | 50 | output "SSH_Connection" { 51 | value = format("ssh connection to instance ${var.instance_name} ==> sudo ssh -i ~/id_rsa_gcp ${var.admin}@%s",google_compute_instance.terra_instance.network_interface.0.access_config.0.nat_ip) 52 | } 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /terraform-provider-alicloud/launch-instance/cloud-init/Win_userdata.ps1: -------------------------------------------------------------------------------- 1 | #cd C:\Users\azureuser 2 | Set-ExecutionPolicy Unrestricted -Force 3 | New-NetFirewallRule -Display 'EC2 HTTP Inbound' -Dir Inbound -Action Allow -Prot TCP -LocalP @('80', '443') 4 | function down_ngx { 5 | param($url, $filename) 6 | $client = New-Object System.Net.WebClient 7 | $client.DownloadFile( $url, $filename) 8 | } 9 | 10 | down_ngx "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 11 | #-ExecutionPolicy RemoteSigned -File "download.ps1" "http://nginx.org/download/nginx-1.19.2.zip" "nginx-1.19.2.zip" 12 | Expand-Archive -Force '.\nginx-1.19.2.zip' '.\' 13 | Remove-Item -Path nginx-1.19.2.zip 14 | cd nginx-1.19.2 15 | ren html\index.html "index.original.html" 16 | cd html 17 | echo "" >index.html 18 | echo "Here you are Papy">>index.html 19 | echo "" >>index.html 23 | echo "" >>index.html 24 | echo "" >>index.html 25 | echo "
" >>index.html 26 | echo "

Welcome to The ALIBABA Loco Party :D !!!

" >>index.html 27 | echo "" >>index.html 28 | echo "
" >>index.html 29 | echo "" >>index.html 30 | echo "" >>index.html 31 | cd .. 32 | start nginx.exe -------------------------------------------------------------------------------- /terraform-provider-oci/publicIPs/variables.tf: -------------------------------------------------------------------------------- 1 | ######################################################### 2 | # Public IPs. 3 | # Author Brokedba https://twitter.com/BrokeDba 4 | ######################################################### 5 | provider "oci" { 6 | alias = "primary" 7 | tenancy_ocid = var.tenancy_ocid 8 | user_ocid = var.user_ocid 9 | fingerprint = var.fingerprint 10 | private_key_path = var.private_key_path 11 | region = var.region 12 | } 13 | 14 | provider "oci" { 15 | alias = "dr" 16 | tenancy_ocid = var.tenancy_ocid 17 | user_ocid = var.user_ocid 18 | fingerprint = var.fingerprint 19 | private_key_path = var.private_key_path 20 | region = var.dr_region 21 | } 22 | ############################ 23 | # Hidden Variable Group # 24 | ############################ 25 | variable "tenancy_ocid" {} 26 | variable "user_ocid" {} 27 | variable "fingerprint" {} 28 | variable "private_key_path" {} 29 | variable "region" {} 30 | variable "dr_region" {} 31 | 32 | ###################### 33 | # locals : 34 | ###################### 35 | # all cases in one map 36 | locals { 37 | ips = { 38 | primary_site = { # key (display_name) => value (description) 39 | mgmt-public_ip-vm-a = "Public IP for Firewall Primary VM management Interface" 40 | mgmt-public_ip-vm-b = "Public IP for Firewall Secondary VM management Interface" 41 | untrust-floating-public_ip = "Floating Public IP for Firewall Untrust Interface" 42 | untrust-floating-public_ip_frontend_1 = "Floating Public IP for Firewall Untrust Interface inbound (frontend cluster ip)" 43 | }, 44 | dr_site = { 45 | dr-mgmt-public_ip-vm-c = "DR Public IP for Firewall Primary VM management Interface" 46 | dr-mgmt-public_ip-vm-d = "DR Public IP for Firewall Secondary VM management Interface" 47 | dr-untrust-floating-public_ip = "DR Floating Public IP for Firewall Untrust Interface" 48 | dr-untrust-floating-public_ip_frontend_1 = "DR Floating Public IP for Firewall Untrust Interface inbound (frontend cluster ip)" 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /terraform-provider-oci/README.md: -------------------------------------------------------------------------------- 1 | # Oracle Cloud Infrastructure Provider Examples 2 | 3 | This directory contains Terraform configuration files showing how to create specific resources. 4 | 1. **create-vcn** is intended to demonstrate how to create a vcn along with the route table, the subnets and their security lists. 5 | 2. **launch-instance** contains both the vcn configuration we used above and the instance provisioning configuration . 6 | For details on how to run these samples please refere to my blog post 7 | https://brokedba.blogspot.com/2020/07/terraform-for-dummies-launch-instance.html 8 | 9 | ![Topology1](https://1.bp.blogspot.com/-xd37jpj29Is/Xv_8fPjXEpI/AAAAAAAABxM/B5XBjEakBpc944IWHIulDDPV9pVcRHKhgCK4BGAsYHg/s853/oci-Terraform.png) 10 | 11 | `` Please run either one of them at a time ( apply and destroy before runing the other) as the vcn attributes are the same . 12 | `` 13 | 14 | 3. **compartments** 15 | - see blog : http://www.brokedba.com/2023/08/deploy-multilevel-oci-sub-compartment.html 16 | 17 | 5. **Database-system** 18 | - see blog : http://www.brokedba.com/2022/04/terraform-for-dummies-part-6-deploy.html 19 | 20 | 7. **public IPs** 21 | - see blog : http://www.brokedba.com/2023/06/how-to-deploy-multi-region-resources.html 22 | 9. **oke** 23 | - see blog : [my-terraform-oci-oke-quickstart-fork](https://cloudthrill.ca/my-terraform-oci-oke-quickstart-fork) 24 | 25 | **Terraform Console**: 26 | - ***Functions:*** Although terraform is a declarative language, there are still myriads of functions you can use to process strings/number/lists/mappings etc. 27 | you will find an excellent all in one script with examples of most terraform functions in [terrafunctions.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terrafunctions.sh) 28 | 29 | - ***expressions:*** Same goes for expressions here is a simple shell script that creates a main.tf with multiples expressions and apply it for you [terraexpression.sh](https://github.com/brokedba/terraform-examples/blob/master/terraform-provider-azure/terraexpressions.sh) No need to deploy anything in the cloud it's all local. 30 | 31 | Credit : [CloudaFFair](https://cloudaffaire.com/terraform-functions/) 32 | -------------------------------------------------------------------------------- /terraform-provider-oci/compartments/output.tf: -------------------------------------------------------------------------------- 1 | output "main_compartment" { 2 | value = { 3 | Comp_name = oci_identity_compartment.iam_compartment_main.name 4 | comp_desc = oci_identity_compartment.iam_compartment_main.description 5 | comp_ocid = oci_identity_compartment.iam_compartment_main.id 6 | } 7 | } 8 | 9 | output "l1_sub_compartment" { 10 | value = { 11 | comp_name = module.level_1_sub_compartments[var.app_compartment_name].compartment_name 12 | 13 | } 14 | } 15 | output "l1_sub_compartments" { 16 | description = "Shows all level one subcompartments details " 17 | #value = {for k,v in aws_security_group_rule.terra_sg_rule : k => v.to_port} 18 | value = { for comp, p in module.level_1_sub_compartments : comp => format("%s => Desc: %s", p.compartment_id, p.compartment_description) } 19 | } 20 | 21 | output "l2_sub_compartments" { 22 | description = "Shows all level one subcompartments details " 23 | #value = {for k,v in aws_security_group_rule.terra_sg_rule : k => v.to_port} 24 | value = { for comp, p in module.level_2_sub_compartments : comp => format("%s => Desc: %s", p.compartment_id, p.compartment_description) } 25 | } 26 | 27 | output "comp-network-ocid" { 28 | value = module.level_1_sub_compartments["comp-network"].compartment_id 29 | } 30 | 31 | output "comp-security-ocid" { 32 | value = module.level_1_sub_compartments["comp-security"].compartment_id 33 | } 34 | 35 | output "comp-shared-ocid" { 36 | value = module.level_1_sub_compartments["comp-shared"].compartment_id 37 | } 38 | output "comp-app-ocid" { 39 | value = module.level_1_sub_compartments[var.app_compartment_name].compartment_id 40 | } 41 | output "comp-app-db-ocid" { 42 | value = module.level_2_sub_compartments["${var.app_compartment_name}-db"].compartment_id 43 | } 44 | 45 | output "comp-app-prod-ocid" { 46 | value = module.level_2_sub_compartments["${var.app_compartment_name}-prod"].compartment_id 47 | } 48 | 49 | output "comp-app-nprod-ocid" { 50 | value = module.level_2_sub_compartments["${var.app_compartment_name}-nprod"].compartment_id 51 | } 52 | 53 | output "comp-app-dr-ocid" { 54 | value = module.level_2_sub_compartments["${var.app_compartment_name}-dr"].compartment_id 55 | } 56 | 57 | -------------------------------------------------------------------------------- /terraform-provider-civo/k8s/talos/prometheus.tf: -------------------------------------------------------------------------------- 1 | 2 | # Prometheus Helm chart 3 | ## https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus/README.md 4 | # Node Exporter Deployment Configuration 5 | ## https://artifacthub.io/packages/helm/prometheus-community/prometheus 6 | # Default traefik prometheus metrics entrypoint is on port 8080, at the path /metrics internally. 7 | # PodSecurityPolicy (PSP) has been deprecated since Kubernetes v1.21 and was fully removed in v1.25: 8 | # Pod Security Admission (PSA) mechanism is too open (namespaced) 9 | resource "helm_release" "prometheus" { 10 | name = "prometheus" 11 | repository = local.helm_repository.prometheus 12 | chart = "prometheus" 13 | version = local.helm_repository.prometheus_version 14 | namespace = kubernetes_namespace.cluster_tools[0].id 15 | wait = false 16 | 17 | values = [ 18 | < ${TF_VAR_ssh_public_key} " 29 | terraform validate 30 | - type: Command 31 | timeoutInSeconds: 600 32 | name: "terraform apply" 33 | command: | 34 | cd /tmp/terraform_build 35 | echo "Deploying the webserver" 36 | terraform apply --auto-approve instance.tfplan 37 | oci os object put -ns ${BUCKET_NAMESPACE_NAME} -bn ${BUCKET_NAME} --file terraform.tfstate --content-type auto --name "terraform_build/terraform.tfstate" --force 38 | sleep 2m 39 | - type: Command 40 | timeoutInSeconds: 600 41 | name: "terraform destroy" 42 | command: | 43 | cd /tmp/terraform_build 44 | cat terraform.tfstate | wc -l 45 | echo " move local statefile" 46 | mv terraform.tfstate terraform.tfstate.old 47 | echo " downloading remote statefile" 48 | oci os object get -ns ${BUCKET_NAMESPACE_NAME} -bn ${BUCKET_NAME} --file terraform.tfstate --name "terraform_build/terraform.tfstate" 49 | echo "number of lines after download" 50 | cat terraform.tfstate | wc -l 51 | echo "final destroy command" 52 | export TF_VAR_ssh_public_key=${SSH_PUB_KEY} 53 | terraform destroy --auto-approve 54 | 55 | onFailure: 56 | - type: Command 57 | command: | 58 | echo "Handling Failure" 59 | echo "Failure successfully handled" 60 | timeoutInSeconds: 40 61 | runAs: root 62 | 63 | 64 | -------------------------------------------------------------------------------- /terraform-provider-azure/launch-instance/outputs.tf: -------------------------------------------------------------------------------- 1 | output "vnet_name" { 2 | description = "The Name of the newly created vNet" 3 | value = azurerm_virtual_network.terra_vnet.name 4 | } 5 | output "vnet_id" { 6 | description = "id of created VNET. " 7 | value = azurerm_virtual_network.terra_vnet.id 8 | } 9 | output "vnet_CIDR" { 10 | description = "cidr block of created VNET. " 11 | value = azurerm_virtual_network.terra_vnet.address_space 12 | } 13 | 14 | output "Subnet_Name" { 15 | description = "Name of created VNET's Subnet. " 16 | value = azurerm_subnet.terra_sub.name 17 | } 18 | output "Subnet_id" { 19 | description = "id of created VNET. " 20 | value = azurerm_subnet.terra_sub.id 21 | } 22 | output "Subnet_CIDR" { 23 | description = "cidr block of VNET's Subnet. " 24 | value = azurerm_subnet.terra_sub.address_prefixes 25 | } 26 | 27 | 28 | output "vnet_dedicated_security_group_Name" { 29 | description = "Security Group Name. " 30 | value = azurerm_network_security_group.terra_nsg.name 31 | } 32 | output "vnet_dedicated_security_group_id" { 33 | description = "Security group id. " 34 | value = azurerm_network_security_group.terra_nsg.id 35 | } 36 | output "vnet_dedicated_security_ingress_rules" { 37 | description = "Shows ingress rules of the Security group " 38 | value = azurerm_network_security_group.terra_nsg.security_rule 39 | } 40 | 41 | ## INSTANCE OUTPUT 42 | 43 | output "instance_id" { 44 | description = " id of created instances. " 45 | value = azurerm_linux_virtual_machine.terravm.id 46 | } 47 | 48 | output "private_ip" { 49 | description = "Private IPs of created instances. " 50 | value = azurerm_linux_virtual_machine.terravm.private_ip_address 51 | } 52 | 53 | output "public_ip" { 54 | description = "Public IPs of created instances. " 55 | value = azurerm_public_ip.terrapubip.ip_address 56 | } 57 | 58 | output "SSH_Connection" { 59 | value = format("ssh connection to instance ${var.prefix}-vm ==> sudo ssh -i ~/id_rsa_az centos@%s",azurerm_public_ip.terrapubip.ip_address) 60 | } 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /terraform-provider-oci/oke-quickstartz/modules/oci-networking/gateway/main.tf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | resource "oci_core_internet_gateway" "gateway" { 6 | compartment_id = var.compartment_ocid 7 | display_name = var.internet_gateway_display_name 8 | enabled = var.internet_gateway_enabled 9 | vcn_id = var.vcn_id 10 | route_table_id = var.internet_gateway_route_table_id 11 | freeform_tags = var.gateways_tags.freeformTags 12 | defined_tags = var.gateways_tags.definedTags 13 | 14 | count = var.create_internet_gateway ? 1 : 0 15 | } 16 | 17 | resource "oci_core_nat_gateway" "gateway" { 18 | block_traffic = var.nat_gateway_block_traffic 19 | compartment_id = var.compartment_ocid 20 | display_name = var.nat_gateway_display_name 21 | vcn_id = var.vcn_id 22 | public_ip_id = var.nat_gateway_public_ip_id 23 | route_table_id = var.nat_gateway_route_table_id 24 | freeform_tags = var.gateways_tags.freeformTags 25 | defined_tags = var.gateways_tags.definedTags 26 | 27 | count = var.create_nat_gateway ? 1 : 0 28 | lifecycle { 29 | ignore_changes = [ 30 | defined_tags["Oracle-Tags.CreatedBy"], 31 | defined_tags["Oracle-Tags.CreatedOn"], 32 | ] 33 | } 34 | } 35 | 36 | resource "oci_core_service_gateway" "gateway" { 37 | compartment_id = var.compartment_ocid 38 | display_name = var.service_gateway_display_name 39 | vcn_id = var.vcn_id 40 | route_table_id = var.service_gateway_route_table_id 41 | freeform_tags = var.gateways_tags.freeformTags 42 | defined_tags = var.gateways_tags.definedTags 43 | 44 | services { 45 | service_id = lookup(data.oci_core_services.all_services.services[0], "id") 46 | } 47 | 48 | count = var.create_service_gateway ? 1 : 0 49 | } 50 | 51 | resource "oci_core_local_peering_gateway" "gateway" { 52 | compartment_id = var.compartment_ocid 53 | display_name = var.local_peering_gateway_display_name 54 | vcn_id = var.vcn_id 55 | peer_id = var.local_peering_gateway_peer_id 56 | route_table_id = var.local_peering_gateway_route_table_id 57 | freeform_tags = var.gateways_tags.freeformTags 58 | defined_tags = var.gateways_tags.definedTags 59 | 60 | count = var.create_local_peering_gateway ? 1 : 0 61 | } --------------------------------------------------------------------------------