first commit
This commit is contained in:
commit
2b00eb61f7
8 files changed
+102
No files matched your search
@@ -0,0 +1,6 @@
|
||||
# Terraform files
|
||||
*/.terraform/
|
||||
*/.terraform.lock.hcl
|
||||
*/*.tfstate
|
||||
*/*.tfstate.backup
|
||||
*/*.tfvars
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026, tchivert
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,19 @@
|
||||
## Requirements
|
||||
|
||||
Export the API key:
|
||||
|
||||
```bash
|
||||
export FASTLY_API_KEY="das_key"
|
||||
```
|
||||
|
||||
Navigate to the right project, init and plan:
|
||||
|
||||
```bash
|
||||
cd poc
|
||||
terraform init
|
||||
terraform plan
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -0,0 +1,15 @@
|
||||
resource "fastly_service_vcl" "service" {
|
||||
name = "${var.domain}"
|
||||
|
||||
backend {
|
||||
address = "${var.backend}"
|
||||
name = "${var.backend}"
|
||||
}
|
||||
|
||||
force_destroy = true
|
||||
}
|
||||
|
||||
resource "fastly_domain_v1" "domain" {
|
||||
fqdn = "${var.domain}"
|
||||
service_id = fastly_service_vcl.service.id
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
fastly = {
|
||||
source = "fastly/fastly"
|
||||
version = ">=8.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
variable "domain" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "backend" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "id" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
module "service-vcl" {
|
||||
source = "../modules/service-vcl"
|
||||
domain = var.domain
|
||||
backend = var.backend
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
variable "domain" {
|
||||
type = string
|
||||
default = "dev.git.rznet.fr"
|
||||
}
|
||||
|
||||
variable "backend" {
|
||||
type = string
|
||||
default = "rznet.fr"
|
||||
}
|
||||
|
||||
variable "id" {
|
||||
type = string
|
||||
default = "ExV9uRBX4NYxzY6fPt9mMm"
|
||||
}
|
||||
Reference in new issue
Block a user