Level Set: What is the cloud?
Getting Hands-on: Build Infrastructure to Host your Website.
Powerful Tools to Research Next
Passing the Interview
Feel comfortable exploring/developing in the Cloud!
https://aws.amazon.com/console/
https://932727539571.signin.aws.amazon.com/console
https://amzn.to/2IEhr4e
https://d0.awsstatic.com/whitepapers/aws-overview.pdf
Region
Separate geographical area
Ex: California & Oregon (US West Regions)
Availability Zone (AZ)
Isolated location within a region
All resources are deny by default
Security Groups open up our firewall
Allow access to our resources
Review the course-sg
Firewall controlling traffic around our database and web servers
RDS Instance: Relational Database Service
Automagically deploy a web application
Automagically deploy a web application
Scalable compute capacity in the cloud
AKA our servers
Variety of sizes and optimizations
Secured by our security group
Firewall controlling traffic around the application.
Distributes application traffic across multiple EC2s.
Also secured by our security group
Helps meet business requirements of:
Launch or terminate EC2 instances based off of policy.
download application from http://bit.ly/2FhRupO and deploy to beanstalk environment
<?php
require __DIR__ . '/../src/app.php';
<?php
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/db-connect.php';
<?php
define('DB_NAME', $_SERVER['RDS_DB_NAME']);
define('DB_USER', $_SERVER['RDS_USERNAME']);
define('DB_PASSWORD', $_SERVER['RDS_PASSWORD']);
define('DB_HOST', $_SERVER['RDS_HOSTNAME']);
define('DB_TABLE', 'urler');
?>
/ Setup the application
$app = new Application();
$app->register(new TwigServiceProvider, array(
'twig.path' => __DIR__ . '/templates',
));
// Setup the database
$app['db.table'] = DB_TABLE;
$app['db.dsn'] = 'mysql:dbname=' . DB_NAME . ';host=' . DB_HOST;
$app['db'] = $app->share(function ($app) {
return new PDO($app['db.dsn'], DB_USER, DB_PASSWORD);
});
// Handle the index page
$app->match('/', function () use ($app) {
$query = $app['db']->prepare("SELECT message, author FROM {$app['db.table']}");
$thoughts = $query->execute() ? $query->fetchAll(PDO::FETCH_ASSOC) : array();
return $app['twig']->render('index.twig', array(
'title' => 'Your Thoughts',
'thoughts' => $thoughts,
));
});
// Handle the add page
$app->match('/add', function (Request $request) use ($app) {
$alert = null;
// If the form was submitted, process the input
if ('POST' == $request->getMethod()) {
try {
// Make sure the photo was uploaded without error
$message = $request->request->get('thoughtMessage');
$author = $request->request->get('thoughtAuthor');
if ($message && $author && strlen($author) < 64) {
// Save the thought record to the database
$sql = "INSERT INTO {$app['db.table']} (message, author) VALUES (:message, :author)";
$query = $app['db']->prepare($sql);
$data = array(
':message' => $message,
':author' => $author,
);
if (!$query->execute($data)) {
throw new \RuntimeException('Saving your thought to the database failed.');
}
} else {
throw new \InvalidArgumentException('Sorry, The format of your thought was not valid.');
}
// Display a success message
$alert = array('type' => 'success', 'message' => 'Thank you for sharing your thought.');
} catch (Exception $e) {
// Display an error message
$alert = array('type' => 'error', 'message' => $e->getMessage());
}
}
return $app['twig']->render('add.twig', array(
'title' => 'Share Your Thought!',
'alert' => $alert,
));
});
$app->run();
The site collects user comments and uses a MySQL database to store the data.
Now delete it all :)
IaaS is the hardware and software that powers it all – servers, storage, networks, operating systems.
PaaS is the set of tools and services designed to make coding and deploying applications quick and efficient.
SaaS applications are designed for end-users, delivered over the web via third party vendors.
A) Capacity provisioning
B) Load balancing
C) Auto-scaling
D)Application deployment
E) All of the above
A region is a separate geographic area. A region has many isolated locations known as availability zones.
AWS offers several different certification you can take to show companies how awesome you are in the cloud!