Skip to content

Commit

Permalink
Create production deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
smokestacklightnin committed Oct 16, 2024
1 parent 14a4a82 commit 986f240
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
24 changes: 24 additions & 0 deletions web/deploy/terraform/production/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
terraform {
required_version = ">= 1.8.0, < 2.0.0"

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

backend "s3" {
bucket = "${var.state_bucket_name}-${var.environment}"
key = var.state_backend_key
region = var.state_storage_region
dynamodb_table = "${var.state_table_name}-${var.environment}"
encrypt = true
}
}

module "ec2" {
source = "../modules/ec2/"
environment = var.environment
instance_type = var.instance_type
}
Empty file.
11 changes: 11 additions & 0 deletions web/deploy/terraform/production/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "environment" {
description = "The name of the environment. Usually `prod`."
default = "prod"
type = string
}

variable "instance_type" {
description = "EC2 instance type"
default = "t2.nano"
type = string
}
23 changes: 23 additions & 0 deletions web/deploy/terraform/production/variables_state.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
variable "state_storage_region" {
description = "AWS region"
default = "us-east-1"
type = string
}

variable "state_bucket_name" {
description = "The name of the S3 bucket to store Terraform state."
type = string
default = "osm-terraform-state-storage"
}

variable "state_table_name" {
description = "The name of the DynamoDB table for Terraform state locks."
type = string
default = "terraform-state-locks"
}

variable "state_backend_key" {
description = "Path to the state file inside the S3 Bucket"
type = string
default = "terraform.tfstate"
}

0 comments on commit 986f240

Please sign in to comment.