-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from cloud-barista/feature/Add-operate-service
Feature/add operate service
- Loading branch information
Showing
44 changed files
with
1,630 additions
and
18 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
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
70 changes: 70 additions & 0 deletions
70
data/var/run/data-manager/template/example/AWS/BUILDER/main.tf
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,70 @@ | ||
# main.tf | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.73.0" | ||
} | ||
} | ||
} | ||
|
||
# AWS Provider set | ||
provider "aws" { | ||
region = var.region | ||
access_key = var.access_key | ||
secret_key = var.secret_key | ||
|
||
} | ||
|
||
resource "aws_vpc" "main" { | ||
cidr_block = "10.0.0.0/16" | ||
} | ||
|
||
resource "aws_subnet" "main" { | ||
vpc_id = aws_vpc.main.id | ||
cidr_block = "10.0.1.0/24" | ||
availability_zone = var.zone | ||
} | ||
|
||
|
||
resource "aws_security_group" "allow_all" { | ||
name = "allow_all_traffic" | ||
description = "Allow all inbound and outbound traffic" | ||
vpc_id = aws_vpc.main.id | ||
|
||
ingress { | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
egress { | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
} | ||
|
||
|
||
|
||
# S3 module call | ||
module "s3" { | ||
source = "./modules/storage" | ||
bucket_name = var.bucket_name | ||
} | ||
|
||
# mysql module call | ||
module "mysql" { | ||
source = "./modules/mysql" | ||
db_name = var.db_name | ||
db_user = var.db_user | ||
db_pswd = var.db_pswd | ||
} | ||
|
||
# DynamoDB module call | ||
module "dynamodb" { | ||
source = "./modules/dynamodb" | ||
table_name = var.table_name | ||
} |
12 changes: 12 additions & 0 deletions
12
data/var/run/data-manager/template/example/AWS/BUILDER/modules/dynamodb/main.tf
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,12 @@ | ||
resource "aws_dynamodb_table" "dynamodb_table" { | ||
name = var.table_name | ||
read_capacity = 1 | ||
write_capacity = 1 | ||
hash_key = "UserId" | ||
|
||
attribute { | ||
name = "UserId" | ||
type = "S" | ||
} | ||
deletion_protection_enabled = false | ||
} |
60 changes: 60 additions & 0 deletions
60
data/var/run/data-manager/template/example/AWS/BUILDER/modules/dynamodb/variables.tf
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,60 @@ | ||
# variables.tf | ||
|
||
# variable "access_key" { | ||
# description = "AWS Access Key" | ||
# type = string | ||
# } | ||
|
||
# variable "secret_key" { | ||
# description = "AWS Secret Key" | ||
# type = string | ||
# } | ||
|
||
# variable "region" { | ||
# description = "AWS Region" | ||
# type = string | ||
# default = "KR" | ||
# } | ||
|
||
# variable "vpc_name" { | ||
# description = "vpc_name" | ||
# type = string | ||
# default = "mcmp-vpc" | ||
|
||
# } | ||
|
||
# variable "private_subnet_name" { | ||
# description = "private_subnet_name" | ||
# type = string | ||
|
||
# } | ||
# variable "public_subnet_name" { | ||
# description = "public_subnet_name" | ||
# type = string | ||
|
||
# } | ||
|
||
variable "table_name" { | ||
description = "table_name" | ||
type = string | ||
} | ||
|
||
# variable "db_name" { | ||
# description = "DB name" | ||
# type = string | ||
# } | ||
|
||
|
||
# variable "db_user" { | ||
# description = "DB user" | ||
# type = string | ||
# } | ||
|
||
# variable "db_pswd" { | ||
# description = "DB PW" | ||
# type = string | ||
# } | ||
|
||
|
||
|
||
|
15 changes: 15 additions & 0 deletions
15
data/var/run/data-manager/template/example/AWS/BUILDER/modules/mysql/main.tf
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,15 @@ | ||
|
||
|
||
|
||
resource "aws_db_instance" "default" { | ||
allocated_storage = 10 | ||
db_name = var.db_name | ||
engine = "mysql" | ||
engine_version = "8.0" | ||
instance_class = "db.t3.micro" | ||
username = var.db_user | ||
password = var.db_pswd | ||
parameter_group_name = "default.mysql8.0" | ||
skip_final_snapshot = true | ||
deletion_protection = false | ||
} |
60 changes: 60 additions & 0 deletions
60
data/var/run/data-manager/template/example/AWS/BUILDER/modules/mysql/variables.tf
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,60 @@ | ||
# variables.tf | ||
|
||
# variable "access_key" { | ||
# description = "AWS Access Key" | ||
# type = string | ||
# } | ||
|
||
# variable "secret_key" { | ||
# description = "AWS Secret Key" | ||
# type = string | ||
# } | ||
|
||
# variable "region" { | ||
# description = "AWS Region" | ||
# type = string | ||
# default = "KR" | ||
# } | ||
|
||
# variable "vpc_name" { | ||
# description = "vpc_name" | ||
# type = string | ||
# default = "mcmp-vpc" | ||
|
||
# } | ||
|
||
# variable "private_subnet_name" { | ||
# description = "private_subnet_name" | ||
# type = string | ||
|
||
# } | ||
# variable "public_subnet_name" { | ||
# description = "public_subnet_name" | ||
# type = string | ||
|
||
# } | ||
|
||
# variable "bucket_name" { | ||
# description = "bucket_name" | ||
# type = string | ||
# } | ||
|
||
variable "db_name" { | ||
description = "DB name" | ||
type = string | ||
} | ||
|
||
|
||
variable "db_user" { | ||
description = "DB user" | ||
type = string | ||
} | ||
|
||
variable "db_pswd" { | ||
description = "DB PW" | ||
type = string | ||
} | ||
|
||
|
||
|
||
|
6 changes: 6 additions & 0 deletions
6
data/var/run/data-manager/template/example/AWS/BUILDER/modules/storage/main.tf
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,6 @@ | ||
|
||
|
||
resource "aws_s3_bucket" "bucket" { | ||
bucket = var.bucket_name | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
data/var/run/data-manager/template/example/AWS/BUILDER/modules/storage/variables.tf
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,60 @@ | ||
# variables.tf | ||
|
||
# variable "access_key" { | ||
# description = "AWS Access Key" | ||
# type = string | ||
# } | ||
|
||
# variable "secret_key" { | ||
# description = "AWS Secret Key" | ||
# type = string | ||
# } | ||
|
||
# variable "region" { | ||
# description = "AWS Region" | ||
# type = string | ||
# default = "KR" | ||
# } | ||
|
||
# variable "vpc_name" { | ||
# description = "vpc_name" | ||
# type = string | ||
# default = "mcmp-vpc" | ||
|
||
# } | ||
|
||
# variable "private_subnet_name" { | ||
# description = "private_subnet_name" | ||
# type = string | ||
|
||
# } | ||
# variable "public_subnet_name" { | ||
# description = "public_subnet_name" | ||
# type = string | ||
|
||
# } | ||
|
||
variable "bucket_name" { | ||
description = "bucket_name" | ||
type = string | ||
} | ||
|
||
# variable "db_name" { | ||
# description = "DB name" | ||
# type = string | ||
# } | ||
|
||
|
||
# variable "db_user" { | ||
# description = "DB user" | ||
# type = string | ||
# } | ||
|
||
# variable "db_pswd" { | ||
# description = "DB PW" | ||
# type = string | ||
# } | ||
|
||
|
||
|
||
|
Oops, something went wrong.