Skip to content
Snippets Groups Projects
Commit 48904dcf authored by Edouard DE BRYE's avatar Edouard DE BRYE
Browse files

Added terraform configuration

parent 533c12c9
No related branches found
No related tags found
No related merge requests found
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
#
*.tfvars
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# Ignore CLI configuration files
.terraformrc
terraform.rc
\ No newline at end of file
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/aws" {
version = "3.30.0"
constraints = ">= 3.30.0"
hashes = [
"h1:z9kdXY2A/+dIZrPy9hNlg/B5I/AuETQsp0jz9EgprIQ=",
"zh:01f562a6a31fe46a8ca74804f360e3452b26f71abc549ce1f0ab5a8af2484cdf",
"zh:25bacc5ed725051f0ab1f7d575e45c901e5b8e1d50da4156a31dda92b2b7e481",
"zh:349b79979d9169db614d8ebd1bc2e0caeb7a38dc816e261b8b2b4b5204615519",
"zh:5e41446acc54c6fc15e82c3fa14b72174b30eba81e0711ede297e5620c55a628",
"zh:68ad98f6d612bdc35a65d48950abc8e75c69decb49db28258ce8eeb5458586b7",
"zh:704603d65e8bac17d203b57c2db142c3134a91076e1b4a31c40f75eb3257dde8",
"zh:a362c700032b2db047d16007d52f28b3f216d32671b6b355d23bdaa082c66a4b",
"zh:bd197797b41268de3c93cad02b7c655dc0c4d8661abb37544ca049e6b1eccae6",
"zh:deb12ef0e3396a71d485977ddc14b695775f7937097ebf2b2f53ed348a4365e7",
"zh:ec8a7d0f02738f290107d39bf401d68ddce82a95cd9d998003f7e04b3a196411",
"zh:ffcc43b6c5e7f26c55e2a8c539d7370fca8042722400a3e06bdce4240bd7088a",
]
}
version: '3.7'
services:
terraform:
image: hashicorp/terraform:0.14.7
volumes:
- .:/infra
working_dir: /infra
environment:
- AWS_SECRET_ACCESS_KEY
- AWS_ACCESS_KEY_ID
terraform {
backend "s3" {
bucket = "edebrye-cloud-monitor-tfstate"
key = "cloud-monitor-app.tfstate"
region = "eu-west-1"
encrypt = true
dynamodb_table = "edebrye-cloud-monitor-tfstate-lock"
}
required_providers {
aws = {
version = ">= 3.30.0"
source = "hashicorp/aws"
}
}
}
provider "aws" {
region = var.aws_region
}
locals {
prefix = "${var.prefix}-${terraform.workspace}"
common_tags = {
Environment = terraform.workspace
Project = var.project
Owner = var.contact
ManagedBy = "Terraform"
}
}
data "aws_region" "current" {}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
instance_tenancy = "default"
tags = merge(
local.common_tags,
map("Name","${local.prefix}-main")
)
}
\ No newline at end of file
variable "contact" {
type = string
default = "edebrye@ippon.fr"
}
variable "project" {
type = string
default = "cloud-monitor"
}
variable "prefix" {
type = string
default = "cloudmon"
}
variable "aws_region" {
type = string
default = "eu-west-1"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment