This commit is contained in:
parent
e69aeeac62
commit
562740ff10
39
.drone.yml
Normal file
39
.drone.yml
Normal file
@ -0,0 +1,39 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Apply Cloud infra changes
|
||||
|
||||
environment:
|
||||
ARM_CLIENT_ID:
|
||||
from_secret: "ARM_CLIENT_ID"
|
||||
ARM_CLIENT_SECRET:
|
||||
from_secret: "ARM_CLIENT_SECRET"
|
||||
ARM_SUBSCRIPTION_ID:
|
||||
from_secret: "ARM_SUBSCRIPTION_ID"
|
||||
ARM_TENANT_ID:
|
||||
from_secret: "ARM_TENANT_ID"
|
||||
CLOUDFLARE_EMAIL:
|
||||
from_secret: "CLOUDFLARE_EMAIL"
|
||||
CLOUDFLARE_API_TOKEN:
|
||||
from_secret: "CLOUDFLARE_API_TOKEN"
|
||||
ARTIFACTORY_USERNAME:
|
||||
from_secret: "ARTIFACTORY_USERNAME"
|
||||
ARTIFACTORY_PASSWORD:
|
||||
from_secret: "ARTIFACTORY_PASSWORD"
|
||||
ARTIFACTORY_URL:
|
||||
from_secret: "ARTIFACTORY_URL"
|
||||
|
||||
steps:
|
||||
- name: Validate Terraform configuration
|
||||
image: hashicorp/terraform
|
||||
commands:
|
||||
- terraform validate
|
||||
|
||||
- name: Check state changes in infrastructure
|
||||
image: hashicorp/terraform
|
||||
commands:
|
||||
- terraform plan
|
||||
|
||||
- name: Apply changes
|
||||
image: hashicorp/terraform
|
||||
commands:
|
||||
- terraform apply -auto-approve
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
creds.txt
|
||||
creds.sh
|
||||
.terraform
|
||||
*.tfstate
|
||||
*.info
|
||||
*.backup
|
||||
terraform.tfstate*
|
||||
*.log
|
||||
|
@ -1,3 +1,5 @@
|
||||
# cloud-resources
|
||||
|
||||
Terraform configuration for resources in public clouds.
|
||||
|
||||
[![Build Status](https://drone.kmlabz.com/api/badges/stargate-cluster/cloud-resources/status.svg)](https://drone.kmlabz.com/stargate-cluster/cloud-resources)
|
@ -1,9 +1,9 @@
|
||||
resource "azurerm_resource_group" "rg-static-site" {
|
||||
name = "rg-static-site"
|
||||
location = "West Europe"
|
||||
location = "westeurope"
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "rg-personalsite-staticwebapp" {
|
||||
name = "rg-personalsite-staticwebapp"
|
||||
location = "West Europe"
|
||||
location = "westeurope"
|
||||
}
|
||||
|
@ -1,11 +1,23 @@
|
||||
resource "azurerm_static_site" "tormakristofeu" {
|
||||
name = "tormakristofeu"
|
||||
resource_group_name = "rg-static-site"
|
||||
location = "West Europe"
|
||||
location = "westeurope"
|
||||
}
|
||||
|
||||
resource "azurerm_static_site_custom_domain" "statictormakristofeu" {
|
||||
static_site_id = azurerm_static_site.tormakristofeu.id
|
||||
domain_name = "static.tormakristof.eu"
|
||||
validation_type = "cname-delegation"
|
||||
}
|
||||
|
||||
resource "azurerm_static_site" "personal-site" {
|
||||
name = "personal-site"
|
||||
resource_group_name = "rg-personalsite-staticwebapp"
|
||||
location = "West Europe"
|
||||
location = "westeurope"
|
||||
}
|
||||
|
||||
resource "azurerm_static_site_custom_domain" "wwwtormakristofeu" {
|
||||
static_site_id = azurerm_static_site.personal-site.id
|
||||
domain_name = "www.tormakristof.eu"
|
||||
validation_type = "cname-delegation"
|
||||
}
|
||||
|
39
cloudflare-zones.tf
Normal file
39
cloudflare-zones.tf
Normal file
@ -0,0 +1,39 @@
|
||||
resource "cloudflare_zone" "tormakristofeu" {
|
||||
zone = "tormakristof.eu"
|
||||
}
|
||||
|
||||
resource "cloudflare_zone_dnssec" "tormakristofeu" {
|
||||
zone_id = cloudflare_zone.tormakristofeu.id
|
||||
}
|
||||
|
||||
resource "cloudflare_zone" "tormakrisdev" {
|
||||
zone = "tormakris.dev"
|
||||
}
|
||||
|
||||
resource "cloudflare_zone_dnssec" "tormakrisdev" {
|
||||
zone_id = cloudflare_zone.tormakrisdev.id
|
||||
}
|
||||
|
||||
resource "cloudflare_zone" "tormaxyz" {
|
||||
zone = "torma.xyz"
|
||||
}
|
||||
|
||||
resource "cloudflare_zone_dnssec" "tormaxyz" {
|
||||
zone_id = cloudflare_zone.tormaxyz.id
|
||||
}
|
||||
|
||||
resource "cloudflare_zone" "kmlabzcom" {
|
||||
zone = "kmlabz.com"
|
||||
}
|
||||
|
||||
resource "cloudflare_zone_dnssec" "kmlabzcom" {
|
||||
zone_id = cloudflare_zone.kmlabzcom.id
|
||||
}
|
||||
|
||||
resource "cloudflare_zone" "csekventillatorokcom" {
|
||||
zone = "csakventillatorok.com"
|
||||
}
|
||||
|
||||
resource "cloudflare_zone_dnssec" "csekventillatorokcom" {
|
||||
zone_id = cloudflare_zone.csekventillatorokcom.id
|
||||
}
|
12
main.tf
12
main.tf
@ -1,9 +1,18 @@
|
||||
terraform {
|
||||
backend "artifactory" {
|
||||
repo = "terraform"
|
||||
subpath = "terraform-state"
|
||||
}
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "~> 3.0.2"
|
||||
}
|
||||
|
||||
cloudflare = {
|
||||
source = "cloudflare/cloudflare"
|
||||
version = "~> 3.0"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -11,3 +20,6 @@ terraform {
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
}
|
||||
|
||||
provider "cloudflare" {
|
||||
}
|
||||
|
Reference in New Issue
Block a user