180 likes | 205 Views
Infrastructure as Code - Why the Buzz ?. monikam@princeton.edu. Monika Mevenkamp. Infrastructure as Code. New Approach to Providing and Scaling Infrastructure for Applications. monikam@princeton.edu. Monika Mevenkamp. A Web Application Example. monikam@princeton.edu. Monika Mevenkamp.
E N D
Infrastructure as Code - Why the Buzz ? monikam@princeton.edu Monika Mevenkamp
Infrastructure as Code New Approach to Providing and Scaling Infrastructure for Applications monikam@princeton.edu Monika Mevenkamp
A Web Application Example monikam@princeton.edu Monika Mevenkamp
Iterative Development monikam@princeton.edu Monika Mevenkamp
Send in Ticket Deploy Application Get Server ~ 2 weeks later Install application dependencies monikam@princeton.edu Test Application Monika Mevenkamp
Deploy ‘Infrastructure as Code’ Approach monikam@princeton.edu 1 create a template file 2 upload file to cloud -> cloud services provision resources 3 run tests Monika Mevenkamp
"Parameters" : {"GitRepo": {}, "GitCommit": {}, "InstanceType" : {}},"Resources" : { "WebServerInstance": { "Type": "AWS::EC2::Instance","AWS::CloudFormation::Init": {"Install": {"packages": { "yum": { "git": [], "httpd": [], "php": []} },"files" : { "/tmp/custom_deploy_code" : [“git init . ","git remote add origin ", { "Ref" : "GitRepo" },"git pull origin ", { "Ref" : "GitCommit" }] },"services": {"httpd": {"enabled": "true", "ensureRunning": "true" },"cfn-hup": {"enabled": "true", "ensureRunning": "true" }, } },"Configure": {"custom_deploy_code": {"command": "/tmp/custom_deploy_code","cwd": "/var/www/html"} } Deploy ‘Infrastructure as Code’ Approach monikam@princeton.edu Monika Mevenkamp
"Parameters" : {"GitRepo": {}, "GitCommit": {}, "InstanceType" : {}},"Resources" : { "WebServerInstance": { "Type": "AWS::EC2::Instance","AWS::CloudFormation::Init": {"Install": {"packages": { "yum": { "git": [], "httpd": [], "php": []} },"files" : { "/tmp/custom_deploy_code" : [“git init . ","git remote add origin ", { "Ref" : "GitRepo" },"git pull origin ", { "Ref" : "GitCommit" }] },"services": {"httpd": {"enabled": "true", "ensureRunning": "true" },"cfn-hup": {"enabled": "true", "ensureRunning": "true" }, } },"Configure": {"custom_deploy_code": {"command": "/tmp/custom_deploy_code","cwd": "/var/www/html"} } Deploy ‘Infrastructure as Code’ Approach monikam@princeton.edu Monika Mevenkamp
"Parameters" : {"GitRepo": {}, "GitCommit": {}, "InstanceType" : {}},"Resources" : { "WebServerInstance": { "Type": "AWS::EC2::Instance","AWS::CloudFormation::Init": {"Install": {"packages": { "yum": { "git": [], "httpd": [], "php": []} },"files" : { "/tmp/custom_deploy_code" : [“git init . ","git remote add origin ", { "Ref" : "GitRepo" },"git pull origin ", { "Ref" : "GitCommit" }] },"services": {"httpd": {"enabled": "true", "ensureRunning": "true" },"cfn-hup": {"enabled": "true", "ensureRunning": "true" }, } },"Configure": {"custom_deploy_code": {"command": "/tmp/custom_deploy_code","cwd": "/var/www/html"} } Deploy ‘Infrastructure as Code’ Approach monikam@princeton.edu Monika Mevenkamp
"Parameters" : {"GitRepo": {}, "GitCommit": {}, "InstanceType" : {}},"Resources" : { "WebServerInstance": { "Type": "AWS::EC2::Instance","AWS::CloudFormation::Init": {"Install": {"packages": { "yum": { "git": [], "httpd": [], "php": []} },"files" : { "/tmp/custom_deploy_code" : [“git init . ","git remote add origin ", { "Ref" : "GitRepo" },"git pull origin ", { "Ref" : "GitCommit" }] },"services": {"httpd": {"enabled": "true", "ensureRunning": "true" },"cfn-hup": {"enabled": "true", "ensureRunning": "true" }, } },"Configure": {"custom_deploy_code": {"command": "/tmp/custom_deploy_code","cwd": "/var/www/html"} } Deploy ‘Infrastructure as Code’ Approach monikam@princeton.edu Monika Mevenkamp
"Parameters" : {"GitRepo": {}, "GitCommit": {}, "InstanceType" : {}},"Resources" : { "WebServerInstance": { "Type": "AWS::EC2::Instance","AWS::CloudFormation::Init": {"Install": {"packages": { "yum": { "git": [], "httpd": [], "php": []} },"files" : { "/tmp/custom_deploy_code" : [“git init . ","git remote add origin ", { "Ref" : "GitRepo" },"git pull origin ", { "Ref" : "GitCommit" }] },"services": {"httpd": {"enabled": "true", "ensureRunning": "true" },"cfn-hup": {"enabled": "true", "ensureRunning": "true" }, } },"Configure": {"custom_deploy_code": {"command": "/tmp/custom_deploy_code","cwd": "/var/www/html"} } Deploy ‘Infrastructure as Code’ Approach monikam@princeton.edu Monika Mevenkamp
Deploy ‘Infrastructure as Code’ Approach monikam@princeton.edu Run script to request server Monika Mevenkamp
Deploy from Bitbucket monikam@princeton.edu Monika Mevenkamp
Automated Fast Testable Versioned monikam@princeton.edu Monika Mevenkamp
Infrastructure = Configuration + Code And that is the Buzz software development best practices monikam@princeton.edu faster more flexible more reliable Monika Mevenkamp