Upgrade to Pro — share decks privately, control downloads, hide ads and more …

테라폼 도입기: 클라우드 인프라스트럭처 코드로 재정의하기


nacyot
January 13, 2018

테라폼 도입기: 클라우드 인프라스트럭처 코드로 재정의하기


nacyot

January 13, 2018
Tweet

More Decks by nacyot

Other Decks in Technology

Transcript

  1. ҙܻ ߑߨ ؀࢚ ࢸ੿ ҙܻ Configuration Management ௏٘ ࢲߡ ܻࣗझ

    ࢶ঱ بҳ
 Resource Management ௏٘ ܻࣗझ
  2. ҙܻ ߑߨ ؀࢚ ࢸ੿ ҙܻ Configuration Management ௏٘ ࢲߡ ܻࣗझ

    ࢶ঱ بҳ
 Resource Management ௏٘ ܻࣗझ
  3. ҙܻ ߑߨ ؀࢚ ࢸ੿ ҙܻ Configuration Management ௏٘ ࢲߡ ܻࣗझ

    ࢶ঱ بҳ
 Resource Management ௏٘ ܻࣗझ
  4. ҙܻ ߑߨ ؀࢚ ࢸ੿ ҙܻ Configuration Management ௏٘ ࢲߡ ܻࣗझ

    ࢶ঱ بҳ
 Resource Management ௏٘ ܻࣗझ
  5. 핆핂큲 $ terraform apply aws_instance.bastion: Creating... ami: "" => "ami-1eabd32"

    type: "" => "m4.large" ... aws_instance.bastion: Creation complete (ID: bastion) Apply complete! 1 added, 0 changed, 0 destroyed.
  6. )$-읺콚큲 resource "aws_instance" "bastion" { ami = "${ var.ami_id }"

    instance_type = "${ var.type }" } 쬲팒퐪
  7. )$-읺콚큲 resource "aws_instance" "bastion" { ami = "${ var.ami_id }"

    instance_type = "${ var.type }" } 쬲팒퐪쬊
  8. )$-읺콚큲 resource "aws_instance" "bastion" { ami = "${ var.ami_id }"

    instance_type = "${ var.type }" } 팓튷쬊 팓튷붘
  9. )$-읺콚큲 resource "aws_instance" "bastion" { ami = "${ var.ami_id }"

    instance_type = "${ var.type }" } 쬲팒퐪 쬲팒퐪쬊 팓튷쬊 팓튷붘
  10. 8SJUF resource "aws_instance" "bastion" { ami = "${ var.ami_id }"

    instance_type = "${ var.type }" } instance.tf
  11. 1MBO $ terraform plan ... + aws_instance.bastion ami: "ami-1eabd32" type:

    "m4.large" .... Plan: 1 to add, 0 to change, 0 to destroy.
  12. $SFBUF $ terraform apply aws_instance.bastion: Creating... ami: "" => "ami-1eabd32"

    type: "" => "m4.large" ... aws_instance.bastion: Creation complete (ID: bastion) Apply complete! 1 added, 0 changed, 0 destroyed.
  13. ˖ 믎쯢옪믆  ˖ PVUTJEFS ˖ BTCVCBN ˖ KQ ˖

    OBDZPU 캋힖뫊믾옫 않픒삲욶몮핖쁢믎쯢옪믆
  14. ˖ 믎쯢옪믆  ˖ PVUTJEFS ˖ BTCVCBN ˖ KQ ˖

    OBDZPU 캋힖뫊믾옫 않픒삲욶몮핖쁢믎쯢옪믆
  15. $ terraforming vpc resource "aws_vpc" "default_vpc" { cidr_block = "10.1.0.0/24"

    enable_dns_hostnames = true enable_dns_support = true instance_tenancy = "default" tags { "Name" = "default_vpc" } }
  16.    UFSSBGPSN  DPNNPO  WQD  JBN

      옪헫묺혾 UFSSBGPSNJOH픦핒짷킫펞싾않묺컿 } ਬࢎೠ ܻࣗझٜਸ ٣۩ఠܻ ߹۽ ੐ನ౟
  17.    UFSSBGPSN  DPNNPO  TFSWJDFT  TFSWJDF@B

     TFSWJDF@C   묺혾맪컮 컪찒큲삶퓒옪쭒읺 } ࢲ࠺झ ߹ ೐۽ં౟۽ ҙܻ
  18.    UFSSBGPSN  DPNNPO  TFSWJDFT  NPEVMFT

     TFSWJDF@B  TFSWJDF@C 묺혾맪컮 졶슖옪컪찒큲읺콚큲쭒읺
  19. 71$ *". 3%4 " # $ Common Services A ೐۽ં౟ীࢲ

    ҕਬ੗ਗ੄ ࢚కܳ ଵઑ 옪헫쪒읺콚큲뫃퓮
  20. 쿦 ˖ /BNF ˖ 5FSSBGPSN.BOBHFE ˖ 5FSSBGPSN1BUI ˖ 71$ ˖

    $SFBUPS 퐃켦 ˖ 1SPKFDU ˖ .BJOUBJOFS ˖ 5FBN 밓뮪
  21. resource "aws_s3_bucket" "awesome_bucket" { bucket = "awsome_bucket" acl = "private"

    tags { "Name" = "Awesome Bucket" "TerraformManaged" = "true" "TerraformRepository" = "tech/infrastructure" "TerraformPath" = "/terraform/common/s3/s3_bucket.tf" "Organization" = "tech" "Creator" = "asbubam" "Deployer" = "asbubam" "IsStaticHosting" = "false" "IsCloudFrontOrigin" = "false" } }
  22. resource "aws_s3_bucket" "awesome_bucket" { bucket = "awsome_bucket" acl = "private"

    tags { "Name" = "Awesome Bucket" "TerraformManaged" = "true" "TerraformRepository" = "tech/infrastructure" "TerraformPath" = "/terraform/common/s3/s3_bucket.tf" "Organization" = "tech" "Creator" = "asbubam" "Deployer" = "asbubam" "IsStaticHosting" = "false" "IsCloudFrontOrigin" = "false" } }
  23. terraform { required_version = "= 0.10.7" backend "s3" { bucket

    = "terraform-state" key = "projects/project/terraform.tfstate" region = "ap-northeast-1" encrypt = true kms_key_id = "alias/terraform_state" dynamodb_table = "terraform-lock" } }
  24. terraform { required_version = "= 0.10.7" backend "s3" { bucket

    = "terraform-state" key = "projects/project/terraform.tfstate" region = "ap-northeast-1" encrypt = true kms_key_id = "alias/terraform_state" dynamodb_table = "terraform-lock" } }
  25. terraform { required_version = "= 0.10.7" backend "s3" { bucket

    = "terraform-state" key = "projects/project/terraform.tfstate" region = "ap-northeast-1" encrypt = true kms_key_id = "alias/terraform_state" dynamodb_table = "terraform-lock" } }
  26. module "app1" { source = "module_v1" p_color= "blue" s_count =

    2 } module "app2" { source = "module_v1" p_color = "purple" s_count = 3 }
  27. module "app1" { source = "module_v2" p_color= "blue" s_count =

    2 } module "app2" { source = "module_v2" p_color = "red" s_count = 3 }
  28. ˖ *OGSBTUSVDUVSFBT$PEF 졶읺큲 ˖ $IFG4PMP핓줆 핂빦폲퍊 ˖ 5FSSBGPSN6QBOE3VOOJOH :FWHFOJZ#SJLNBO ˖

    핆않큲얻뫎읺솒묺않핓줆 OBDZPU ˖ 5FSSBGPSN .PP:FPM1SFTDPUU-FF ˖ )BTIJ$PSQ픦솒 0VUTJEFS삦쩖펻 ˖ 5FSSBGPSN칺푷 0VUTJEFS삦쩖펻 벦핋픊졂홙픎핞욚