Skip to content

Commit

Permalink
add: repo skeleton
Browse files Browse the repository at this point in the history
jordi.bru committed May 20, 2024
1 parent da6dc6c commit 42f969b
Showing 6 changed files with 101 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
**/terragrunt_variables.tf
**/.terraform.lock.hcl
**/*.zip
**/backend.tf

# Created by https://www.toptal.com/developers/gitignore/api/terraform,terragrunt
# Edit at https://www.toptal.com/developers/gitignore?templates=terraform,terragrunt

### Terraform ###
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.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*

### Terragrunt ###
# terragrunt cache directories
**/.terragrunt-cache/*

# End of https://www.toptal.com/developers/gitignore/api/terraform,terragrunt

### VSCode ###
.vscode/
4 changes: 4 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# More on CODEOWNERS files: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

# Path # Maintainer
* @JordiiBru
Empty file added main.tf
Empty file.
1 change: 1 addition & 0 deletions output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# More on: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket#attribute-reference
15 changes: 15 additions & 0 deletions providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
terraform {
required_version = ">= 1.5.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}

provider "aws" {
region = "eu-west-1"
profile = "aws-jordi-account"
}
35 changes: 35 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# REQUIRED VARIABLES

variable "stage" {
description = "Stage of development"
type = string

validation {
condition = can(regex("^(test|dev|stagin|prod)$", var.stage))
error_message = "Stage must be dev, staging or prod."
}
}

variable "purpose" {
description = "Short description about the created resource"
type = string
default = null

validation {
condition = can(regex("^([a-zA-Z0-9-_]*)$", var.purpose))
error_message = "Only the expression [a-zA-Z0-9-_]* is allowed."
}
}

variable "owner" {
description = "Owner of the deployed infrastructure"
type = string
default = null

validation {
condition = length(var.owner) >= 3
error_message = "You must define an owner with more than three letters."
}
}

# OPTIONAL VARIABLES

0 comments on commit 42f969b

Please sign in to comment.