moved images to s3 and added terraform scripts
This commit is contained in:
1
infra/terraform/environments/catherine-fc/.gitignore
vendored
Normal file
1
infra/terraform/environments/catherine-fc/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/.terraform/
|
||||
8
infra/terraform/environments/catherine-fc/backend.tf
Normal file
8
infra/terraform/environments/catherine-fc/backend.tf
Normal file
@@ -0,0 +1,8 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "catherine-fc-infra"
|
||||
key = "catherine-fc-ec2/terraform.tfstate"
|
||||
region = "ap-northeast-1"
|
||||
encrypt = true
|
||||
}
|
||||
}
|
||||
12
infra/terraform/environments/catherine-fc/main.tf
Normal file
12
infra/terraform/environments/catherine-fc/main.tf
Normal file
@@ -0,0 +1,12 @@
|
||||
module "catherine-fc" {
|
||||
source = "../../modules/catherine-fc/main"
|
||||
vpc_id = var.vpc_id[terraform.workspace]
|
||||
internal_subnet_ids = var.internal_subnet_ids[terraform.workspace]
|
||||
tags = var.tags
|
||||
asg_tags = var.asg_tags
|
||||
basename = "catherine-fc"
|
||||
asg_caps = var.asg_caps["catherine-fc"]
|
||||
ec2_instance_type = "t2.micro"
|
||||
key_name = var.key_name[terraform.workspace]
|
||||
asg_arn = module.catherine-fc.asg_arn
|
||||
}
|
||||
3
infra/terraform/environments/catherine-fc/output.tf
Normal file
3
infra/terraform/environments/catherine-fc/output.tf
Normal file
@@ -0,0 +1,3 @@
|
||||
output "asg_arn" {
|
||||
value = module.catherine-fc.asg_arn
|
||||
}
|
||||
4
infra/terraform/environments/catherine-fc/provider.tf
Normal file
4
infra/terraform/environments/catherine-fc/provider.tf
Normal file
@@ -0,0 +1,4 @@
|
||||
provider "aws" {
|
||||
region = "ap-northeast-1"
|
||||
version = "~> 2.0"
|
||||
}
|
||||
46
infra/terraform/environments/catherine-fc/variable.tf
Normal file
46
infra/terraform/environments/catherine-fc/variable.tf
Normal file
@@ -0,0 +1,46 @@
|
||||
variable "tags" {
|
||||
type = map(string)
|
||||
default = {
|
||||
PROJECT = "CATHERINE_FC"
|
||||
}
|
||||
}
|
||||
|
||||
variable "asg_tags" {
|
||||
type = list(object({key=string, value=string, propagate_at_launch=bool}))
|
||||
default = [
|
||||
{
|
||||
key = "PROJECT",
|
||||
value = "CATHERINE_FC",
|
||||
propagate_at_launch = true
|
||||
}
|
||||
]
|
||||
}
|
||||
variable "asg_caps" {
|
||||
type = map(map(number))
|
||||
default = {
|
||||
"catherine-fc" = {
|
||||
min = 1
|
||||
max = 1
|
||||
desired = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "vpc_id" {
|
||||
type = map(string)
|
||||
default = {
|
||||
prod = "vpc-c54553a2"
|
||||
}
|
||||
}
|
||||
variable "internal_subnet_ids" {
|
||||
type = map(list(string))
|
||||
default = {
|
||||
prod = [ "subnet-0d0fdf45", "subnet-4dcecc16", "subnet-4dcecc16" ]
|
||||
}
|
||||
}
|
||||
variable "key_name" {
|
||||
type = map(string)
|
||||
default = {
|
||||
prod = "catherine-fc"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user