ããã«ã¡ã¯ã
ç§ã¯ãããä¸ã§ãããã£ã¹ãããã¦ããSIerã®å ¸åã®ãããªä¼ç¤¾ã«å¤ãã¦ããã¾ããä¸å¿æå°ã¨ãã©ã¤ããæã£ã¦åãçµãã§ã¯ãããã®ã®ã¯ã©ã¦ãç°å¢ã§ããªããªéçºï¼ã¨ã¯ç¡ç¸ãªãä»äºã§ãã
ãæ¥ããããªããAWSã«ãã»ã¨ãã©è§¦ãããã¨ã¯ãªããä»å趣å³ã®ä¸ç°ã¨ãã¦è±AWSç«¥è²ã«åãçµã¿ã¾ããã
å®ç¾ãããã£ããã¨ã¯ãããªæãã®ãã¨ã
- Gitï¼ããã³GitHubï¼ã§ç®¡çãã¦ããWebã¢ããªã±ã¼ã·ã§ã³ãEC2ã¸ãããã¤ããã
- HTTPSã«å¯¾å¿ããã
- EC2ã«ç§»è¡å¾ãåããµã¼ãã»ãã¡ã¤ã³åã§ç¨¼åãããã
ã¨ãããã¨ã§ä»åAWSã§æ¬¡ã®ä½æ¥ãå®æ½ãã¾ããã
- Elastic Beanstalkã§EC2ã«ãããã¤
- Certificate Managerãããµã¼ãã¼è¨¼ææ¸ã®çºè¡
- Route 53ã§ãã¡ã¤ã³ã®ç®¡ç
ãã§ãæçµçãªå§¿ã¯ãããªæãã«ãªãã¾ããã
ãã¼ãããã¶ã¤ã³ã»ã³ã¹ç¡ãããã¦ã¡ãã£ã¨ããåããã¾ããããï¼èªç»èªè³ï¼
ããã¯ãã¦ããä»å¾AWSã¸ã®ç§»è¡ãèãã¦ããæ¹ã«åãã¦å°ãã§ããã³ãã«ãªãã°ã¨æããããã®æé ããç´¹ä»ãããã¨æãã¾ããåºæ¬çã«ç§ã®ãããªAWSç«¥è²åãã®è¶ åºç¤çãªå 容ã§ãã
- åæã®ç°å¢ãªã©
- Elastic Beanstalkã«ããã¢ããªã±ã¼ã·ã§ã³ãããã¤
- AWS Certificate Managerã«ãããµã¼ãã¼è¨¼ææ¸ã®åå¾
- Route53ã«ãããã¡ã¤ã³ã®è¨å®
åæã®ç°å¢ãªã©
AWSæ§ç¯åã®åæã«ãªãç°å¢ã示ãã¾ãã
- Webã¢ããªã®ãã©ãããã©ã¼ã ï¼Rails4.2ãRuby2.1ãDBç¡ã
- ãã¡ã¤ã³ï¼wackwack.netï¼ãåå.comã§ç®¡çï¼
- Webã¢ããªã®URLï¼hatenablog.wackwack.net
- ãã¼ã¸ã§ã³ç®¡çï¼Gitï¼GitHubã§ãã¹ãã£ã³ã°ï¼
- éçºã¯ã©ã¤ã¢ã³ãï¼macOS Sierra
移è¡ããã¢ããªã±ã¼ã·ã§ã³ã¯èªåã§éçºããChromeæ¡å¼µæ©è½ãã¯ã¦ãªãã©ãã©ã¤ãã¢ãããã¼ãã¼ãã§ãã
blog.wackwack.net
Elastic Beanstalkã«ããã¢ããªã±ã¼ã·ã§ã³ãããã¤
ã¾ãã¯ä»åã®è©±ã®ä¸»å½¹Elastic Beanstalkã使ã£ã¦æ¢åã®Webã¢ããªã±ã¼ã·ã§ã³ãEC2ã¸ãããã¤ãã¦ã¿ã¾ãã
é©ãã»ã©ç°¡åã«ã§ãã¾ããã
Elastic Beanstalkã¨ã¯
AWSä¸ã§EC2ã«ã¢ããªã±ã¼ã·ã§ã³ããããã¤ããã³ãã®å¾ã®ç®¡çãç°¡åã«è¡ãããã®ãµã¼ãã¹ã docs.aws.amazon.com
ã¤ã³ãã©æ§ç¯ãèªåã§ãã£ã¦ããã
Elastic Beanstalkã使ããã¨ã§ããµã¼ãã¼å ¥ãã¦ï¼EC2æ§ç¯ãã¦ï¼ãNginxã¨Railså ¥ãã¦è¨å®ãã¦â¦â¦ãã¨ãã£ãä¸é£ã®ã¤ã³ãã©ã®æºåãå ¨ã¦ä¸è¦ã«ãªãã¾ãã
ããä¸åº¦è¨ãã¾ãã
DBç¡ãã®è¶ ã·ã³ãã«æ§æã¨ã¯è¨ãããã¤ã¯ãããã
æéã¯ä¸è¦
Elastic Beanstalkã使ãã«å½ãã£ã¦ã¯ç¹ã«è¿½å æéã¯å¿ è¦ããã¾ãããã¢ããªã±ã¼ã·ã§ã³ãããããããã¤ãããã¨ç¡æã§ãã
EC2ã®ãéã¯å¿ è¦ã§ã
ãElastic Beanstalkã§ã¢ããªã®ãããã¤ç°å¢ãä½ããã¨ãããã¨ã¯ãEC2ç°å¢ãæ°ãã«ä½ãããã¨ã«ãªãã¾ãã
ã¤ã¾ããElastic Beanstalkã¯ç¡æãã¨è¨ã£ã¦ãå¿ ãEC2ãä»ãã¦åãã®ã§EC2ã®æéã¯ç¢ºå®ã«çºçãã¾ããâ¦â¦ãï¼è©æ¬ºãããªããï¼
EB CLIã®å°å ¥
Elastic Beanstalkã§ã¢ããªã±ã¼ã·ã§ã³ããããã¤ããããã«ã¯éçºã¯ã©ã¤ã¢ã³ãã«EB CLIã¨å¼ã°ããã³ãã³ãã©ã¤ã³ãã¼ã«ã使ãã¾ãã
docs.aws.amazon.com
EB CLIã¯åãã©ãããã©ã¼ã ãã¨ã«æä¾ããã¦ããå°å ¥æ¹æ³ã¯ããããç°ãªãã¾ããä»åã®macOS Serriaç°å¢ã«ããã¦ã¯HomeBrewã§å°å ¥ãã¾ããã
以ä¸ã®ã³ãã³ããå©ãè¾¼ãã°OKã§ãï¼
$ brew install awsebcli ==> Downloading https://homebrew.bintray.com/bottles/aws-elasticbeanstalk-3.9.0.sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring aws-elasticbeanstalk-3.9.0.sierra.bottle.tar.gz ==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d ==> Summary /usr/local/Cellar/aws-elasticbeanstalk/3.9.0: 1,540 files, 31M
ããã§ã¿ã¼ããã«ããebã³ãã³ããå©ç¨ã§ããããã«ãªãã¾ãã
ããã¸ã§ã¯ããElastic Beanstalkç¨ã«ã»ããã¢ãããã
EB CLIãå°å ¥ãããéçºã¯ã©ã¤ã¢ã³ãä¸ã®ããã¸ã§ã¯ããã©ã«ããã»ããã¢ãããã¾ãã
Gitããã¸ã§ã¯ãã®ä½æ
Gitããã¸ã§ã¯ãã¯æ°ãã«ä½æãããè¯ããGitHubãªã©ããcloneãã¦ãããè¯ãã§ããä»åã¯GitHubã«ãã¹ãã£ã³ã°ãã¦ããããã¸ã§ã¯ããéçºã¯ã©ã¤ã¢ã³ãã«ãã¦ã³ãã¼ããã¾ãã
$ git clone https://github.com/quotto/HatenaBlog.git Cloning into 'HatenaBlog'... remote: Counting objects: 6219, done. remote: Total 6219 (delta 0), reused 0 (delta 0), pack-reused 6219 Receiving objects: 100% (6219/6219), 26.76 MiB | 4.83 MiB/s, done. Resolving deltas: 100% (681/681), done.
EB CLIã®è¨å®
ãã¦ã³ãã¼ãããGitããã¸ã§ã¯ããã©ã«ããElastic Beanstalkç°å¢ç¨ã«è¨å®ãã¾ããeb initãå®è¡ãã¦å¯¾è©±å½¢å¼ã§è¨å®ãè¡ãã¾ãã
$ eb init Select a default region 1) us-east-1 : US East (N. Virginia) 2) us-west-1 : US West (N. California) 3) us-west-2 : US West (Oregon) 4) eu-west-1 : EU (Ireland) 5) eu-central-1 : EU (Frankfurt) 6) ap-south-1 : Asia Pacific (Mumbai) 7) ap-southeast-1 : Asia Pacific (Singapore) 8) ap-southeast-2 : Asia Pacific (Sydney) 9) ap-northeast-1 : Asia Pacific (Tokyo) 10) ap-northeast-2 : Asia Pacific (Seoul) 11) sa-east-1 : South America (Sao Paulo) 12) cn-north-1 : China (Beijing) 13) us-east-2 : US East (Ohio) 14) ca-central-1 : Canada (Central) 15) eu-west-2 : EU (London) (default is 3): Select an application to use 1) HatenaBlog 2) [ Create new Application ] (default is 1): It appears you are using Ruby. Is this correct? (y/n): y Select a platform version. 1) Ruby 2.3 (Puma) 2) Ruby 2.2 (Puma) 3) Ruby 2.1 (Puma) 4) Ruby 2.0 (Puma) 5) Ruby 2.3 (Passenger Standalone) 6) Ruby 2.2 (Passenger Standalone) 7) Ruby 2.1 (Passenger Standalone) 8) Ruby 2.0 (Passenger Standalone) 9) Ruby 1.9.3 (default is 1): 7 Note: Elastic Beanstalk now supports AWS CodeCommit; a fully-managed source control service. To learn more, see Docs: https://aws.amazon.com/codecommit/ Do you wish to continue with CodeCommit? (y/n) (default is n): Do you want to set up SSH for your instances? (y/n): y Select a keypair. 1) HatenaInstance 2) [ Create new KeyPair ] (default is 2): 1
以ä¸ãè¨å®å¤ãç°¡åã«èª¬æãã¾ãã
- Select a default regionï¼ãããã¤å ã®ãªã¼ã¸ã§ã³ãé¸æãã¾ããEC2ãæ§ç¯ãããªã¼ã¸ã§ã³ãé¸ã³ã¾ãããã
- Select an application to useï¼ã¢ããªã±ã¼ã·ã§ã³åãå ¥åãã¾ããããã©ã«ãã§åæã«ååãä»ãã¦ããã¾ãã
- It appears you are using Ruby. Is this correct?ï¼ãã®ã¢ããªã±ã¼ã·ã§ã³ã®ãã©ãããã©ã¼ã ã確èªãã¦ããã¾ããæ£ãããã°yã§ãã
- Select a platform version.ï¼ãã©ãããã©ã¼ã ã®ãã¼ã¸ã§ã³ãé¸æãã¾ãããã
- Do you wish to continue with CodeCommit?ï¼AWSã®Gitãã¹ãã£ã³ã°ãµã¼ãã¹ãå©ç¨ã§ãã¾ãã詳ããã¯ãã¡ãã aws.amazon.com
- Select a keypair.ï¼~/.sshd ã®ä¸ã«AWSã®èªè¨¼ãã¼ãæ ¼ç´æ¸ã¿ã§ããã°ãããé¸æã§ãã¾ããç¡ãå ´åã¯æ°ãã«ï¼ã¾ãã¯ç»é²æ¸ã¿ã®ï¼ã¢ã¯ã»ã¹ãã¼IDã¨ã¢ã¯ã»ã¹ã·ã¼ã¯ã¬ããæ å ±ãå ¥åãã¾ãã
Elastic Beanstalkã§ä½¿ãEC2ç°å¢ã®æ§ç¯
ç¶ãã¦ã¯AWSä¸ã«ã¢ããªã±ã¼ã·ã§ã³ããããã¤ããããã®ç°å¢ãã¤ã¾ãEC2ãç«ã¡ä¸ãã¾ãã
ã¨è¨ã£ã¦ãã³ãã³ããä¸çºå©ãã ãã§ããã¿ã¼ããã«ããeb create ä»»æã®ååï¼ãµã¼ãåï¼ãå®è¡ããã ãã§Elastic Beanstalkç¨ã®EC2ãæ§ç¯ããèµ·åãã¾ãã
$ eb create hatenablog-env Creating application version archive "app-f2f7-170205_195724". Uploading HatenaBlog/app-f2f7-170205_195724.zip to S3. This may take a while. Upload Complete. Environment details for: hatenablog-env Application name: HatenaBlog Region: us-west-2 Deployed Version: app-f2f7-170205_195724 Environment ID: e-qqrbtvbfgt Platform: 64bit Amazon Linux 2016.09 v2.3.1 running Ruby 2.1 (Passenger Standalone) Tier: WebServer-Standard CNAME: UNKNOWN Updated: 2017-02-05 10:57:30.139000+00:00 Printing Status: INFO: createEnvironment is starting. INFO: Using elasticbeanstalk-us-west-2-188970983837 as Amazon S3 storage bucket for environment data. INFO: Environment health has transitioned to Pending. Initialization in progress (running for 3 seconds). There are no instances. INFO: Created security group named: sg-5eda4626 INFO: Created load balancer named: awseb-e-q-AWSEBLoa-5FOJ37VT5AIE INFO: Created security group named: awseb-e-qqrbtvbfgt-stack-AWSEBSecurityGroup-5W25EYNX3260 INFO: Created Auto Scaling launch configuration named: awseb-e-qqrbtvbfgt-stack-AWSEBAutoScalingLaunchConfiguration-1B3MQII3ESLUS INFO: Created Auto Scaling group named: awseb-e-qqrbtvbfgt-stack-AWSEBAutoScalingGroup-O5JRY2HPS2HO INFO: Waiting for EC2 instances to launch. This may take a few minutes. INFO: Added instance [i-009a59652a3bd1697] to your environment. INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:188970983837:scalingPolicy:7388e0ae-7614-4981-99fe-70053332553c:autoScalingGroupName/awseb-e-qqrbtvbfgt-stack-AWSEBAutoScalingGroup-O5JRY2HPS2HO:policyName/awseb-e-qqrbtvbfgt-stack-AWSEBAutoScalingScaleUpPolicy-DKND6FYLIJJV INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:188970983837:scalingPolicy:662f0597-28a0-4ac9-954a-0b204260e69c:autoScalingGroupName/awseb-e-qqrbtvbfgt-stack-AWSEBAutoScalingGroup-O5JRY2HPS2HO:policyName/awseb-e-qqrbtvbfgt-stack-AWSEBAutoScalingScaleDownPolicy-1X6WWI0UTKO2C INFO: Created CloudWatch alarm named: awseb-e-qqrbtvbfgt-stack-AWSEBCloudwatchAlarmHigh-1561J7HK5BGU2 INFO: Created CloudWatch alarm named: awseb-e-qqrbtvbfgt-stack-AWSEBCloudwatchAlarmLow-3GG2V375R04J INFO: Environment health has transitioned from Pending to Ok. Initialization completed 24 seconds ago and took 4 minutes. INFO: Successfully launched environment: hatenablog-env
ããã¾ã§å®äºããã¨AWSããã¸ã¡ã³ãã³ã³ã½ã¼ã«ããä½æããã¢ããªã±ã¼ã·ã§ã³ã¨EC2ãæ§ç¯ããã¦ãããã¨ã確èªã§ãã¾ãã
ã¾ãEC2ååæ§ç¯æã«èªåã§ãããã¤ãè¡ãããããããã®æç¹ã§ã¢ããªã±ã¼ã·ã§ã³ã稼åãã¦ãã¾ããã¿ã¼ããã«ããeb openãå®è¡ããã¨ãã©ã¦ã¶ãéããããã¤ããã¢ããªã±ã¼ã·ã§ã³ã«æ¥ç¶ãã¾ããURLãæåã®ã»ããã¢ããã§æå®ããç°å¢åï¼ãªã¼ã¸ã§ã³ãã¡ã¤ã³ã§ãããã¨ãåããã¾ãã
$ eb open
ã¨ã©ã¼ãçºçãã¦ãã¾ãããããªæã¯eb logsã§ã¨ã©ã¼ã確èªãã¾ãã
$ eb logs â¦â¦ 2017/02/05 11:08:34 [error] 18360#0: *90 upstream prematurely closed connection while reading response header from upstream, client: xxx.xx.xx.xx, server: _, request: "GET / HTTP/1.1", upstream: "passenger:/tmp/passenger.1.0.18340/generation-0/request:", host: "hatenablog-env.gyx3d27kiy.us-west-2.elasticbeanstalk.com" App 18408 stderr: [ 2017-02-05 11:08:47.5268 18423/0x0055920a42c768(Worker 1) utils.rb:84 ]: *** Exception RuntimeError in Rack application object (Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`) (process 18423, thread 0x0055920a42c768(Worker 1)): App 18408 stderr: from /opt/rubies/ruby-2.1.10/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:534:in `validate_secret_key_config!' App 18408 stderr: from /opt/rubies/ruby-2.1.10/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:246:in `env_config' App 18408 stderr: from /opt/rubies/ruby-2.1.10/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/engine.rb:514:in `call'
ããã¯Railsç¹æã®ã¨ã©ã¼ã§ãããã¡ãã®éå»è¨äºã§ãç´¹ä»ãããSECRET_KEY_BASEãç°å¢å¤æ°ã«è¨å®ããå¿
è¦ããããã¨ãããã®ã§ããã
blog.wackwack.net
ã¢ããªã±ã¼ã·ã§ã³ã®æ´æ°
ç°å¢å¤æ°ã®è¨å®
ã¨ãããã¨ã§ãããã¤å ã®EC2ã«ç°å¢å¤æ°SECRET_KEY_BASEãè¨å®ãã¾ãã EB CLIã®eb setenvã³ãã³ãã使ãã°ãªã¢ã¼ããã°ã¤ã³ãããã¨ãªãElastic Beanstalkã®EC2ãµã¼ãã¼ã«ç°å¢å¤æ°ãè¨å®ã§ãã¾ãã
$ eb setenv SECRET_KEY_BASE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx INFO: Environment update is starting. INFO: Updating environment hatenablog-env's configuration settings. INFO: Environment health has transitioned from Ok to Info. Configuration update in progress (running for 26 seconds). INFO: Successfully deployed new configuration to environment.
eb printenvã§è¨å®å 容ã確èªã§ãã¾ãã
printenv Environment Variables: RACK_ENV = production SECRET_KEY_BASE = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx RAILS_SKIP_MIGRATIONS = false RAILS_SKIP_ASSET_COMPILATION = false BUNDLE_WITHOUT = test:development
ããä¸åº¦eb openãå®è¡ããã¨â¦â¦
å ç¨ã®502ã¨ã©ã¼ã¯ã¯ãªã¢ãããã®ã®URLã®ã«ã¼ãï¼Welcomeãã¼ã¸ï¼ãç¡ãããã¨ã©ã¼ãåºåããã¾ãã
åãããã¤
ãã®ã¢ããªã±ã¼ã·ã§ã³ã¯æ©è½çã«Welcomeãã¼ã¸ã¯ä¸è¦ãªã®ã§ãããåãããã¤ã®æ¹æ³ã®ç¢ºèªãå ¼ãã¦æ´æ°ãã¦ã¿ã¾ãã
ã¨è¨ã£ã¦ããã¡ã¤ã«ãæ´æ°ãã¦Gitã«ã³ããããã¦eb deployãå®è¡ããã ãã§ããç°¡åï¼ï¼
$ git commit -m "Add Welcome Page" [ebtest 54cac0a] Add Welcome Page 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 app/views/hatena_blog/index.html.erb $ eb deploy Creating application version archive "app-54ca-170205_204743". Uploading HatenaBlog/app-54ca-170205_204743.zip to S3. This may take a while. Upload Complete. INFO: Environment update is starting. INFO: Deploying new version to instance(s). INFO: New application version was deployed to running EC2 instances. INFO: Environment update completed successfully.
å度eb openããã¨â¦â¦
ã§ããã¼ï¼
AWS Certificate Managerã«ãããµã¼ãã¼è¨¼ææ¸ã®åå¾
Webã¢ããªã±ã¼ã·ã§ã³ãéæ»ã§ãããã¤ã§ãã®ãã§HTTPS対å¿ã«åãã¦ãµã¼ãã¼è¨¼ææ¸ãåå¾ãã¾ãã
ããã«ã¯AWS Certificate Managerï¼ACMï¼ã使ãã¾ããACMã¯Amazonã®SSL/TLS証ææ¸ãçºè¡ãã¦ããã¾ãããããç¡æã§ãã
AWS Certificate Manager(SSL/TLS 証明書を無料で作成) | AWS
証ææ¸ã®çºè¡
ã¾ãã¯AWSããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã§ACMãéããä»ããå§ããããã証ææ¸ã®ä½æãéå§ãã¾ãã
ãã¡ã¤ã³ã®è¿½å ã§SSLãé©ç¨ãããã¡ã¤ã³ãæå®ãã¾ããå®å
¨ä¿®é£¾åã§ããã°å½è©²ã®URLã®ã¿ãã¯ã¤ã«ãã«ã¼ãã使ãã¨ãã¡ã¤ã³å
¨ä½ã«é©ç¨ã§ãã¾ãã
次ã®ç»é¢ã§ç»é²å 容ã確èªãããã確å®ã¨ãªã¯ã¨ã¹ãããå®è¡ãã¾ããããã§ãã¡ã¤ã³ã®ç®¡çè ã¸ã¡ã¼ã«ãéä¿¡ããã¾ãã
ãããªæãã®ã¡ã¼ã«ãå±ãã¾ãã
URLãã¯ãªãã¯ãã¦ãªã¯ã¨ã¹ããæ¿èªãã¾ãã
AWSã³ã³ã½ã¼ã«ããã¸ã¡ã³ãããACMãéãã¨ããªã¯ã¨ã¹ããããµã¼ã証ææ¸ãä½æããããã¨ã確èªã§ãã¾ãã
ã¢ããªã±ã¼ã·ã§ã³ã®è¨å®
ACMã®ãµã¼ã証ææ¸ãæå¹ã«ããã«ã¯ã¢ããªã±ã¼ã·ã§ã³å´ã§ãè¨å®ãå¿ è¦ã«ãªãã¾ãã
ã¢ããªã±ã¼ã·ã§ã³ãã£ã¬ã¯ããªã®ç´ä¸ã«ebextensions/securelistener.configã以ä¸ã®ã¨ããä½æãã¦ãããã¤ãã¾ãã
ãã®ã¨ããSSLCertificateIdãã«ã¯ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã«è¡¨ç¤ºããã¦ãããARNãã®å¤ãè¨å®ãã¾ãã
option_settings: aws:elb:listener:443: SSLCertificateId: arn:aws:acm:us-west-2:xxxxxxxxxxx:certificate/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ListenerProtocol: HTTPS InstancePort: 80
ç¶ãã¦Elastic Beanstalkã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ãéãããã¼ããã©ã³ã·ã³ã°ãã®ãSSL 証ææ¸ IDãã«å ç¨ä½æãã証ææ¸ã®ãã¡ã¤ã³åãè¨å®ãã¾ãã
ããã§ã¢ããªå´ã®è¨å®ã¯å®äºã§ãã
Route53ã«ãããã¡ã¤ã³ã®è¨å®
æå¾ã«SSLé©ç¨ãã¡ã¤ã³ï¼wackwack.netï¼ãæ§ç¯æ¸ã¿ã®Elastic Beanstalkã¢ããªã±ã¼ã·ã§ã³ã«é©ç¨ãã¾ãã
ããã«ã¯AWSã®Route53ã使ãã¾ãã
aws.amazon.com
Route 53ã¯AWSä¸ã§åãDNSã®ç·æ¬çãªãµã¼ãã¹ã§ãããã¡ã¤ã³ã®åå¾ãããã¼ã ãµã¼ãã®æ§ç¯ã¾ã§ä½ã§ããããï¼
ãã ãããããã¯ãå¾é課éå¶ï¼æ10åã¯ã¨ãªã¾ã§ã§0.01$ï¼ã§ããããã¤ç¡ææéã«ä½¿ãããµã¼ãã¹ã®å¯¾è±¡å¤ã§ããå©ç¨ã«ã¯æ³¨æãã¾ãããã
ãã¼ã ãµã¼ãã®ä½æ
åãã«Route 53ãããã¡ã¤ã³ã®ãã¼ã ãµã¼ããä½æãã¾ãã
Route 53ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ãéããHosted Zonesããé¸æãã¾ãã
ãCreateHostedZonesããã¯ãªãã¯ãç»é²ãããã¡ã¤ã³åãå ¥åãã¾ãã
ãNSãã¬ã³ã¼ãã¨ãSOAãã¬ã³ã¼ãã表示ããã¦ããã°ãã¼ã ãµã¼ãã®ä½æã¯å®äºã§ãã
ãã¡ã¤ã³ã®ãã¼ã ãµã¼ããå¤æ´ãã
ä»åã¯æ¢åã®ãã¡ã¤ã³ãAWSã§ä½¿ããããã¡ã¤ã³ã®ãã¼ã ãµã¼ãã¼ãå ã»ã©ä½æããRoute53ã®ãã¼ã ãµã¼ãã¼ã«å¤æ´ããå¿ è¦ãããã¾ãã
ãã¼ã ãµã¼ãã®å¤æ´ã¯åãã¡ã¤ã³éå¶ä¼ç¤¾ã®ãµã¤ãããå®æ½ãã¾ããä»åã¯ããåå.comãã®ä¾ã示ãã¾ãã
ãåå.comã®ãã¡ã¤ã³Naviããããã¡ã¤ã³è¨å®ãã¨é²ã¿å¯¾è±¡ã®ãã¤ã¡ã¤ã³ï¼wackwack.netï¼ã«ãã§ãã¯ãå
¥ããä»ã®ãã¼ã ãµã¼ããå©ç¨ããé¸æãã¾ãã
ããã¼ã ãµã¼ãã¼æ å ±ã®å ¥åãæ¬ã«ãRoute 53ããä½æããNSã¬ã³ã¼ãã®ã¢ãã¬ã¹ãå ¨ã¦å ¥åãã¦ç»é²ã¯å®äºã§ãã
ããã§ãwackwack.netããã¡ã¤ã³ã«ã¢ã¯ã»ã¹ãçºçããã¨Route 53ã®ãã¼ã ãµã¼ãã¼ã«ãªã¯ã¨ã¹ããéä¿¡ãããããããåå解決ãè¡ããã¾ãã
â»ãã¼ã ãµã¼ãã¼ã®è¨å®å¤æ´ã¯ç°å¢ã«ãã£ã¦24æéã72æéãããå¯è½æ§ãããã¾ãã
ã¨ã¤ãªã¢ã¹ã¬ã³ã¼ãã®ç»é²
æå¾ã«ã¨ã¤ãªã¢ã¹ã¬ã³ã¼ããç»é²ãã¾ããããã«ããç¹å®ã®wackwack.netãã¡ã¤ã³ã¸ã®ãªã¯ã¨ã¹ããElastic Beanstalkã§æ§ç¯ããEC2ã¸è»¢éããã¾ãã
Route 53ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ããå ã»ã©ç»é²ãããã¡ã¤ã³ã®ã¬ã³ã¼ãä¸è¦§ãéãã¾ãã
ãããããCreate Recordããã¯ãªãã¯ãã次ã®ã¨ããå ¥åããã¦ã¨ã¤ãªã¢ã¹ã¬ã³ã¼ããä½æãã¾ãã
- Nameï¼ä»»æã®ååï¼ãããæçµçãªå®å ¨ä¿®é£¾ãã¡ã¤ã³åã«ãªãã¾ãï¼
- Aliasï¼Yes
- Typeï¼A
- Alias Targetï¼Elastic Beanstalkã®URLï¼é¸æè¢ã«èªåã§è¡¨ç¤ºããã¾ãï¼
ããã§æºåã¯ãªã¼ã«ãªãã±ã¼ï¼
åä½ç¢ºèª
ç»é²ããå®å
¨ä¿®é£¾ãã¡ã¤ã³åã«HTTPSã§ã¢ã¯ã»ã¹ãã¦ã¿ãã¨â¦â¦
ãã¡ãã¨ã¢ã¯ã»ã¹ã§ãã¾ããããµã¼ãã¼è¨¼ææ¸ã®ãã§ã¼ã³ã確èªããã¨Amazonããçºè¡ããã証ææ¸ã使ããã¦ãããã¨ãåããã¾ãã
以ä¸ãElastic Beanstalkã§ã®ã¢ããªã±ã¼ã·ã§ã³ä½æããAWSCertificate Managerã§ã®ãµã¼ãã¼è¨¼ææ¸ä½æãRoute 53ã§ã®ãã¼ã ãµã¼ãã¼ã¨ã¨ã¤ãªã¢ã¹ã¬ã³ã¼ãã®è¨å®ã¾ã§ç´¹ä»ãã¾ããã
é·ã ã¨ããæé ã«è¦ãã¾ãããå®éã¯ãã£ã¨ããéã«ã§ãã¦ãã¾ãã¾ããAWSã便å©ããã¾ããã
ãã ãæ軽ãã¨å¯ç¨æ§ã»ã¹ã±ã¼ã©ããªãã£ã«åªãã¦ãããã®ã®ãå¾é課éå¶ã¨ãããã¨ããã£ã¦å人çã«ã³ã¹ãã¯ããé«ãããªã¨æãã®ã§ãå人ãå©ç¨ããã«ã¯ããèãã¦ã¿ã¾ãããã
Amazon Web Serviceså®è·µå ¥é (WEB+DB PRESS plus)
- ä½è : è岡å®,ä»äºæºæ,永淵æå,éç¬å²ä¹,ä¸æµ¦æ,æ³ç¬ä»»ç«
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2015/11/10
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- ãã®ååãå«ãããã° (1件) ãè¦ã