Eureka EngineeringLearn about Eurekaâs engineering efforts, product developments and more.
Eureka EngineeringLearn about Eurekaâs engineering efforts, product developments and more.
ã¯ã©ã¦ãã¯ã¼ã¯ã¹ã®ç¼¶ã³ã¼ãã¼ã¨ã³ã¸ãã¢ã®æ£®ç°(@minamijoyo)ã§ãã ã ãããæ¯æ¥ç¼¶ã³ã¼ãã¼ã飲ã¿ãªãã主ã«ã¤ã³ãã©å¨ãã®ä»äºããã¦ãã®ã§ãã¯ã©ã¦ãã¯ã¼ã¯ã¹ã®ã¤ã³ãã©ã®ä¸é¨ã¯ç¼¶ã³ã¼ãã¼ã§ã§ãã¦ããã¨è¨ã£ã¦ãéè¨ã§ã¯ãªãããããªããããã¨æãä»æ¥ãã®é ãã¡ãªã¿ã«æè¿ã®ãã¤ãã¼ã ã¯FIREã®ãã¯ã¤ã¢ã³å¾®ç³ã§ãã ããã¾ã§ã®ãããã ã¯ã©ã¦ãã¯ã¼ã¯ã¹ã§ã¯AWS(Amazon Web Services)ã§ãµã¼ããéç¨ãã¦ãããAWSã§ã®IAM(Identity and Access Management)ã¦ã¼ã¶ã®ã°ã«ã¼ãããªã·ã¼ã®ç®¡çã«ã¤ãã¦ã以åãããªè¨äºãæ¸ãã¾ããã Terraformã§AWSã®IAMã¦ã¼ã¶ã®ã°ã«ã¼ãããªã·ã¼ã管çãã - Qiita Terraform+Atlas+GitHubã§AWSã®IAMã¦ã¼ã¶ã®ã°ã«ã¼ãããªã·ã¼ããããããã«ç®¡çãã - ã¯ã©ã¦ãã¯ã¼ã¯ã¹ ã¨ã³
ã¯ããã« çããAWSã®IAMã®æ¨©é管çã£ã¦ã©ããã¦ã¾ããï¼IAMã¯AWSã使ã以ä¸ã¯é¿ãã¦ã¯éããªãæ©è½ã§ãããããã¶ã使ãåæãæªããæ©ã¾ããåé¡ã§ãã人æ°ãå°ãªããã°å ¨å¡Administratorsã§ããããã§ããã©ã人æ°å¢ãã¦ããã¨å ¨å¡Administratorsãªã®ãã¡ãã£ã¨å¾®å¦ããã¨è¨ã£ã¦ãéçºãã¼ã å ã§IAM権éçµãã¨ãæ¢åã®æ¥åããå¤ãããä½ãæ°ãããã¨ããããã¨ããã¨æ¨©é足ããªãã¨ã©ã¼ã«ãªã£ã¦ã権éãã人ã«ãé¡ãããªãã¨æ¨©éå¤æ´ã§ããªãã¨ããªãã¨ãéçºã®ã¹ãã¼ããè½ã¡ã¾ãããã¨ã権éãã人ãIAMããªã·ã¼ã人ã®ããã«èª¿ã¹ã¦æ¸ãã®ã¯è¦çã§ããã§ããã°ããªã·ã¼ã¯æ¨©éã欲ãã人ã«èª¿ã¹ã¦æ¸ãã¦ãããããã¨ããã§ãã ããã§ãTerraformã使ã£ã¦IAMã®ããªã·ã¼ã管çããã°ãIAMã®ã³ã³ã½ã¼ã«ã§JSONãç·¨éããã¨ããè¦è¡ããéæ¾ãããgitã§ç®¡çã§ããããã«ãªãããã¤æ¨©éã
Kubernetesç¨VMã¤ã¡ã¼ã¸ã®ä½æ Packerã使ã Kubernetesã¯ã©ã¹ã¿ã®æ§ç¯ããããããããããããã主è¦ãªããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã³ã»ããã¢ããããã¦ããOpenStackã®VMã¤ã¡ã¼ã¸ãPackerã§ä½æãã¾ãï¼å³3ï¼ã Packerã使ããetcdã«é¢ããããã±ã¼ã¸ãªã©å ¨ã¦ã®VMã§å ±éã§ä½¿ç¨ããããã±ã¼ã¸ã¯äºåã«ã¤ã¡ã¼ã¸ã«åãè¾¼ã¿ã¾ãã ãããããã¨ã§ãVMãç«ã¡ä¸ããåæç¶æ ã§Kubernetesãæ§ç¯ããããã«ãããç¨åº¦æºåãããç°å¢ãæä¾ãããå¾ã®ãããã¤ä½æ¥ãå¹çåãã¾ãã å³3. Packerã«ããKubernetesç¨VMä½æ Packerã®è¨å®ã¨ã¤ã¡ã¼ã¸ä½æ OpenStackã«ä¸ãã£ã¦ããVMã¤ã¡ã¼ã¸ããã¼ã¹ã«Kubernetesç¨ã®ã¤ã¡ã¼ã¸ãçæãã¾ãã æå ã«ã¤ã¡ã¼ã¸ããã¦ã³ãã¼ãããå¿ è¦ã¯ããã¾ããã JSONå½¢å¼ã®è¨å®ãã¡ã¤ã«ã«å¤æ°ï¼v
ã¯ããã« ããã«ã¡ã¯ãä¸å±±ã§ãã Terraformã使ç¨ãã¦ããä¸ã§ãã©ã®ãããªãã£ã¬ã¯ããªæ§é (tfãã¡ã¤ã«ã®é ç½®æ¹å¼)ããã¹ããªã®ãã¨èãããã¨ã¯ããã¾ããããç§èªèº«ããããã¨è©¦ãã¦ããæä¸ãªã®ã§ãããç¾æç¹ã§ç§ãèãããã¹ããã©ã¯ãã£ã¹ããç´¹ä»ãã¾ãã ãã£ã¬ã¯ããªæ§é ãããªãã§ããã以ä¸ã®ã¨ããã§ãã âââ Makefile âââ README.md âââ app.tf âââ bastion.tf âââ cloudfront.tf âââ db.tf âââ elasticache.tf âââ elb.tf âââ envs â  âââ dev â  â  âââ main.tf â  â  âââ variables.tf â  âââ prd â  â  âââ main.tf â  â  âââ variables.tf â  âââ
ãªããDMMããweb3ã«åå ¥ããã®ããSeamoon Protocolããç®æãæ°ããªã¨ã³ã¿ã¡ä½é¨ã®æªæ¥ã¨ã¯
ã¤ã³ãã©ã¨ã³ã¸ãã¢ããããã§ãªãã¨ã³ã¸ãã¢ããç¨åº¦ã®å·®ããããAWSï¼ãããªãã¯ã¯ã©ã¦ãï¼ã®ç¥èã¯æ¬ ãããªããã®ã«ãªãã¤ã¤ããã¾ããããããªãããé£ããå«ãã ããªãã¾ã ãããAWSã«ããããåãçµã¿ç¶ãã¦ããã®ã«ããã°ãã°å«æ°ããããã¨ããããã®ã¯ãAWSã®è¤éããåå ã®ï¼ã¤ã§ããã¨ãã£ã¦ããã§ãããã ä»åã¯ããããªè¤éãªä»çµã¿ã®ä¸ã¤ããTerraformç¨ã«ã³ã¼ãåãããã¨ã§ã³ã³ãã®ã¹ããããåããã¾ãã Infrastructure as Code ã®éç¨ Infrastructure as Code ã«ãã£ã¦ãæå管çãããã¦èªååãããã¨ã®ã¡ãªããã¯è¨ãã¾ã§ããªãã§ãããä»åã¯èªååããéç¨ã«ããé常ã«å¤§ããªã¡ãªããããããã¨ããè¦ç¹ã«ã¹ããããå½ã¦ã¦ããã¾ãã AWSã¯å¤æ©è½ã§ä¾¿å©ã§ãããããã«ãè¤éã§ããããã¦ãè¤éã§ãããããã«ãã客ããã«ç°¡åã«æ±ã£ã¦ãããããããæä½ãç°¡
Terraformã¯ããããããã¤ã³ãã©æ§æãè¨å®ãã¡ã¤ã«ã«è¨è¿°ãã¦ã ã¯ã©ã¦ãç°å¢ã«é©ç¨ã»ç®¡çãããã¼ã«ã§ãã Vagrantãªã©ãéçºãã¦ããHashiCorpã®ãã¼ã«ã«ãªãã¾ãã AWSã ãã§ã¯ãªãæ§ã ãªãããã¤ãã«å¯¾å¿ãã¦ãã¾ãããAWSã§ä½¿ç¨ãã¦ã¿ã¾ããã ã¤ã³ã¹ãã¼ã« Linuxãµã¼ãã«å ¥ãã¦ã¿ã¾ããã ãã¦ã³ãã¼ããã¦ãã¦å±éããã ãã§ä½¿ãã¾ãã cd /opt mkdir terraform cd terraform wget https://releases.hashicorp.com/terraform/0.6.16/terraform_0.6.16_linux_amd64.zip unzip terraform_0.6.16_linux_amd64.zip ãã¹ãéãã¨ä¾¿å©ã§ããã vi ~/.bashrc export PATH=/opt/terraform:
ã¯ããã« ããã«ã¡ã¯ãä¸å±±ã§ãã å ç¨Terraformã®v0.6.15ããªãªã¼ã¹ããã¾ãããï¼ CHANGELOGã¯ãã¡ãã§ãããã¾ãã¾ãªã¢ãããã¼ããå«ã¾ããã®ã§ããããã¯ãCloudFrontã¸ã®å¯¾å¿ã«ç®ãå¼ããã¾ããã aws_cloudfront_distribution ã¨aws_cloudfront_origin_access_identity ãCloudFrontç¨ã®ãªã½ã¼ã¹ã§ãã以åã®ãã¼ã¸ã§ã³ã§ãaws_cloudformation_stackãªã½ã¼ã¹ã使ç¨ããã°CloudFrontã®ä½æãå¯è½ã§ãããããã¯ããªã½ã¼ã¹ã¨ããå½¢ã§å¯¾å¿ãã¦ãããã¨ããããã§ããã ã¨ãã訳ã§ãæ©é使ã£ã¦ã¿ãã®ã§ã¬ãã¼ããã¦ã¿ã¾ãã ã¤ã³ã¹ãã¼ã« ã¾ãã¯Terraformãã¤ã³ã¹ãã¼ã«ãã¾ãããã $ brew update $ brew cask install terraform ãã¼
2017-06-17: ãã®è¨äºã¯ããå¤ãã§ããTerraform v0.8.x 以ä¸ã対象ã¨ãã¦ãã¾ãã 2017/03 ã«ãªãªã¼ã¹ããã Terraform v0.9.0 㧠remote config å¨ãã®ä»æ§ã大ããå¤ããã¾ããã S3 ã«ç½®ããã¡ã¤ã«å½¢å¼ã¯å¤ãã£ã¦ãªãã§ãããç¹ã« CLI å¨ãã§å¾æ¹äºææ§ã®ãªãå¤æ´ãå ¥ã£ã¦ãã¾ããä¾ãã° terraform remote ã³ãã³ããç¡ããªã£ã¦ãã¾ãã 詳ããã¯ä»¥ä¸ã®å ¬å¼ããã¥ã¡ã³ããèªãã§ä¸ããã Backends - Terraform by HashiCorp Backends: Migrating From 0.8.x and Earlier - Terraform by HashiCorp ã¨ããããã§ã以ä¸ã®è¨äºã¯ Terraform v0.8.x 以ä¸ã対象ã¨ãããã®ã«ãªãã¾ãã 2015-05-08 ã«ãªãªã¼ã¹ãã
About Terraformã§RDSãä½æã§ããã¨ãåææ§ç¯ãæ©ããªããããªã®ã§ãã£ã¦ã¿ã¾ãã åæ v0.6.14 VPCãªã©ã®ç°å¢ã¯äºåã«ä½ææ¸ã¿ RDS RDSãæ§ç¯ããã«ã¯4ã¤ã®ãªã½ã¼ã¹ãå¿ è¦ã§ãã aws_db_subnet_group aws_security_group aws_db_parameter_group aws_db_instance subnet dbç¨ã®subnetãå®ç¾©ãã¾ãããã resource "aws_db_subnet_group" "db-subnet" { name = "test-db-subnet" description = "test db subnet" subnet_ids = ["${aws_subnet.private.0.id}", "${aws_subnet.private.1.id}"] } security group
EC2ã§ãµã¼ãã¼ãæ§ç¯ããå ´åãè² è·åæ£ãå¯ç¨æ§ãèæ ®ãã¦è¤æ°å°æ§æã¨ããå ´åãå¤ããã¨æãã¾ãã å ¨ãåãæ§æã®EC2ã¤ã³ã¹ã¿ã³ã¹ãè¤æ°å°æ§ç¯ããããä»åã¯Terraformã§ããããè¡ãå ´åã®TIPSãããã¤ããç´¹ä»ãããã¾ãã åæ 以ä¸ã®EC2ã®ãªã½ã¼ã¹å®ç¾©ããã¼ã¹ã«ãå種TIPSãé©ç¨ãã¦ããã¾ãããµãããããã»ãã¥ãªãã£ã°ã«ã¼ãã¯æ¢åã®ãã®ãå©ç¨ããåæã§è©±ãé²ãã¾ãã variable aws_access_key {} variable aws_secret_key {} provider "aws" { access_key = "${var.aws_access_key}" secret_key = "${var.aws_secret_key}" region = "ap-northeast-1" } resource "aws_instance" "web" { am
ãä¹ ãã¶ãã§ããtjinjinã§ã(â¹â¡â¹) æè¿ãããããã¦ãã¾ãããæ¢ é¨ãããã¨å¤ã§ããï¼ï¼å¤ã¢ãã¡ãå§ã¾ãã¾ããï¼ï¼ ã¨ãããã¨ã§ãPVè¦ãæãã®ç§ã®ããããã¯å è±ã®åè ã§ãï¼âãã£ãâã§ã¯ãªãâãã£ãâã§ãï¼ AWSç°å¢ã®ã³ã¼ãå å¼ç¤¾ã§ã¯AWSç°å¢ã®æ§ç¯ã管çã³ã³ã½ã¼ã«ã§ã®æ¸©ãã¿ã®ããä½æ¥ãRakeTaskã§è¡ã£ã¦ãã¾ãããããµã¼ãã¹ãæ°è¦ã§ç«ã¦ãã®ã«æéããããã¨ãã課é¡ããããAWSç°å¢ãã³ã¼ãåãããã¨ããæããããã¾ãããã¤ã³ãã©ãã¼ã å ã§æ¤è¨ããçµæã ååããã£ããã ã³ã¼ããèªã¿ãããã¨ãããã¨ã§ä¸é¨ãµã¼ãã¹ã§terraformãæ¡ç¨ãå§ãã¦ãã¾ãã terraformã使ã£ã¦è¡ãä¸ã§ãä½ç¹ãå£ã«ã¶ã¡å½ãã£ãã®ã§æ å ±å ±æã§ããã°ã¨æãã¾ãã terraformã¨ã¯ï¼ ä¸è¨ã§è¡¨ãã¨ã¤ã³ãã©æ§æãã³ã¼ãåãããã¨ã®ã§ãããã¼ã«ã¨ããã¨ããã§ãããããã¿ããªå¤§å¥½ãHash
ããã¯ã¢ãã aws_cloudfront_dirstribution ã®attributeã« hosted_zone_id ã追å aws_s3_bucket ã aws_elb ãªã½ã¼ã¹ã«ã¯ALIASã¬ã³ã¼ããè¨å®ããéã«å©ç¨ãã hosted_zone_id ã¨ããattributeãããã¾ããä»åã®ã¢ãããã¼ã㧠aws_cloudfront_dirstribution ã«ããã®attributeã追å ããã¾ãããä»ã¾ã§ã§ãCloudFrontã®Hosted Zone Idããã¼ãã³ã¼ããã¦ãããã°ALIASã¬ã³ã¼ãã®ä½æã¯ã§ããã®ã§ãããattributeã¨ãã¦è¿½å ããããã¨ã§ããç°¡åã«å©ç¨ãããã¨ãã§ããããã«ãªãã¾ããã 以ä¸ã«CloudFrontã®ãã¡ã¤ã³ã«å¯¾ãã¦ALIASã¬ã³ã¼ããè¨å®ãããµã³ãã«ã³ã¼ããè¨è¼ãã¾ãããã¡ã¤ã³ã¯é©å½ãªãã®ã«èªã¿æ¿ãã¦ãã ããã variab
Eureka EngineeringLearn about Eurekaâs engineering efforts, product developments and more.
æ¦è¦ Terraformã®AWSã使ã£ã¦ãCLIãéãã¦ã¤ã³ã¹ã¿ã³ã¹ã®èµ·åâå¤æ´âåæ¢ãè¡ãããã®ãã¥ã¼ããªã¢ã«ãTerraform ã®åºæ¬æ¦å¿µã§ãã plan apply show ã®ãµã¤ã¯ã«ãç解ããããã®ãã®ã è¿½è¨ Terraformã®blogæ稿ãåè訳 - Qiita http://qiita.com/zembutsu/items/402e02950ce9d59fa0e6 Terraformå ¥é æ¥æ¬èªè¨³ - Qiita http://qiita.com/zembutsu/items/84f5478701c5391df537 Terraform ã¨ã¯ Hashicorp (Vagrant, Packer, Serf, Consul ãä½ã£ã¦ããä¼ç¤¾) ã«ãã£ã¦ 7/28 ã«å ¬éãããæ°ãããªã¼ãã³ã½ã¼ã¹ã®ãããã¯ãã Terraform http://www.terraform
OSãããã«ã¦ã§ã¢ã®æ©è½æ¤è¨¼ãå®æ½ããå ´åãªã©ããªã³ããã³ãã§ä¸æçãªæ¤è¨¼ç°å¢ãæ§ç¯ã§ããã®ãã¯ã©ã¦ããµã¼ãã¹ã®ééå³ã§ãã æ¤è¨¼å¯¾è±¡ã®OSãããã«ã¦ã§ã¢ã¯ç°ãªãã©ãæ¤è¨¼ã«å¿ è¦ãªç°å¢ã¯ããç¨åº¦å ±éã§ãããã¨ãå°ãªããªããã¾ãè²»ç¨ç¯ç´ã®ããã«ãæ¤è¨¼ãçµãã£ãå¾ã¯ããããã£ã±ãã¨ãã®ç°å¢ãåé¤ããããã®ã§ãã AWSã§ãããªä½¿ãæ¨ã¦ã®ç°å¢ãæ§ç¯ããå ´åã®æ¹æ³ã¨ãã¦ããã¡ã¼ã¹ããã§ã¤ã¹ã¨ãªãã®ã¯AWS CloudFormationãã¨æãã¾ããæ¤è¨¼ç°å¢ããã³ãã¬ã¼ãåãã¦ãããã¨ãã§ããã¾ãããã¼ã¸ã¡ã³ãã³ã³ã½ã¼ã«ãAWS CLIã使ã£ã¦ç°¡åã«ç°å¢ã®æ§ç¯ï¼åé¤ãã§ããã使ãæ¨ã¦ç°å¢ã®æ§ç¯ã«ã¯ã´ã£ããã®ãµã¼ãã¹ã§ãããããã¯AWS CLIãAWS SDKã使ã£ã¦èªåã®ç°å¢æ§ç¯ã¹ã¯ãªãããä½æããã®ãããããããã¾ããã AWSå ¬å¼ã®ãã¼ã«ã使ã以å¤ã§ã¯ãTerraformãæåãªé¸æè¢ã®1ã¤ã«ãªã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}