54 lines
1.2 KiB
HCL

### Setup/Configuration
provider "aws" {
region = var.aws_region
}
terraform {
backend "s3" {
bucket = "operations.jdb-software.com"
region = "us-west-2"
key = "terraform/toclerbe.tfstate"
dynamodb_table = "terraform-state-lock.jdb-software.com"
}
}
data "terraform_remote_state" "jdbsoft" {
backend = "s3"
config = {
bucket = "operations.jdb-software.com"
region = "us-west-2"
key = "terraform/operations.tfstate"
dynamodb_table = "terraform-state-lock.jdb-software.com"
}
}
### Variables
variable "aws_region" {
description = "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html"
default = "us-west-2" # Oregon
}
variable "app_domain" {
description = "Name of the app domain."
default = "to.cler.be"
}
variable "app_name" {
description = "Name of the app domain."
default = "toclerbe"
}
data "external" "git_describe" {
program = ["sh", "-c", "git describe | xargs printf '{\"version\": \"%s\"}'"]
}
resource "aws_ecr_repository" "toclerbe" {
name = "${var.app_name}"
image_tag_mutability = "IMMUTABLE"
image_scanning_configuration {
scan_on_push = true
}
}