-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14a4a82
commit 986f240
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |