moved images to s3 and added terraform scripts

This commit is contained in:
2020-08-08 19:27:32 +09:00
parent d0a8424731
commit 94a9d18c02
90 changed files with 859 additions and 55 deletions

View File

@@ -0,0 +1 @@
/.terraform/

View File

@@ -0,0 +1,8 @@
terraform {
backend "s3" {
bucket = "catherine-fc-infra"
key = "catherine-fc-ec2/terraform.tfstate"
region = "ap-northeast-1"
encrypt = true
}
}

View 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
}

View File

@@ -0,0 +1,3 @@
output "asg_arn" {
value = module.catherine-fc.asg_arn
}

View File

@@ -0,0 +1,4 @@
provider "aws" {
region = "ap-northeast-1"
version = "~> 2.0"
}

View 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"
}
}