-
Notifications
You must be signed in to change notification settings - Fork 13
Assignment 8
Dan Carr edited this page Feb 22, 2017
·
9 revisions
- Student has Github account
- Student has an AWS account
- Student has completed Assignment 7
- Infrastructure as Code
- CloudFormation
- AWS Relational Database Service
Go to:
- https://calculator.s3.amazonaws.com/index.html
- Look at the diagram in and estimate the monthly cost of running our infrastructure assuming t1.micro ec2 instances and t1.db.micro RDS instance in a Multi-AZ deployment
- What are the key cost drivers? How could we decrease costs? What are the tradeoffs?
In the master.yaml
change the following lines denoted with ##
marks:
HomelessRDS:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/cfn-templates-hacko-infra/infrastructure/rds.yaml
Parameters:
EnvironmentName: !Ref AWS::StackName
VPC: !GetAtt VPC.Outputs.VPC
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
TheDBIdentifier: '' # Your database Identifier
TheDBName: '' ## Leave it blank for now
TheDBUser: '' ## master admin user. Will use <postgres>
TheDBPassword: '' ## <PASSWORD>
TheDBAllocatedStorage: '5'
TheDBInstanceClass: 'db.t2.micro'
IsMultiAZDatabase: 'false' # Change this if you want a multi-az deploy
- Save the file
- Go to the Cloudformation console on AWS
- Click on
Create Stack
button - Choose
Upload a template to S3
and uploadmaster.yaml
to temporary bucket - Click the
Next
button - Enter a name for your stack
- Click the
Next
button - Select the
I acknowledge that AWS CloudFormation might create IAM resources with custom names
checkbox - Click the
Create
button - Watch your stack startup Note: This fails on purpose.
- Click on the line with Rollback In Progress Status
- Look for the error message. Why do you think it failed? Tip Look in the
rds.yaml
file - Fix the error and delete the stack and run through Step 2 again
- Make sure everything completes
- Explore your AWS console now:
- VPC
- Subnets
- Route Tables
- Application Load Balancers
- Relational Database Services (RDS)
- EC2 Container Services
- In the Output section of your master stack, look for the service endpoints
Next Step is important in order to avoid excess AWS charges
- Go to the Cloudformation Console
- Find and your master stack name. Hint: it's the one that does not have an infrastructure suffix attached.
- Select the check box
- Click the
Action
button and selectDelete Stack