Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views58 pages

DevOps Training AWS-part1

Uploaded by

atulmisal97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views58 pages

DevOps Training AWS-part1

Uploaded by

atulmisal97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

AWS

1. Cloud introduction

2. AWS Global Infrastructure

3. IAM

4. EC2

5. S3

6. Elastic Load balancer (ELB)

7. Autoscaling

8. Cloud Front

9. AWS CLI

10. RDS

11. Elastic Beanstalk

12. Cloud Formation

13. Cloud Watch

1
What is Cloud?
• Access computer on Internet
• Using somebody’s computer temporary

Things to be considered for physical computer

• Physical machine
• Electricity
• Internet
• Space, Size
• Memory constraints
• Elasticity

Cloud Computing

Cloud computing, often referred to as simply “the cloud”. It is the delivery of on-demand computing
resources — everything from applications to data centers — over the internet on a pay-for-use basis

Benefits

➢ Cost
➢ Speed
➢ Global scale
➢ Performance
➢ Security

Cloud Providers

2
Amazon

Azure (Microsoft)

Google

Alibaba

IBM

Adobe

VMware

Rackspace

Red Hat

Types of cloud deployments

First, you need to determine the type of cloud deployment, or cloud computing architecture, that your
cloud services will be implemented on. There are three different ways to deploy cloud services: on a
public cloud, private cloud, or hybrid cloud.

Public cloud

Public clouds are owned and operated by a third-party cloud service providers, which deliver their
computing resources like servers and storage over the Internet. Microsoft Azure is an example of a
public cloud. With a public cloud, all hardware, software, and other supporting infrastructure is owned
and managed by the cloud provider. You access these services and manage your account using a web
browser.

Private cloud

A private cloud refers to cloud computing resources used exclusively by a single business or
organization. A private cloud can be physically located on the company’s on-site datacenter. Some
companies also pay third-party service providers to host their private cloud. A private cloud is one in
which the services and infrastructure are maintained on a private network.

Hybrid cloud

Hybrid clouds combine public and private clouds, bound together by technology that allows data and
applications to be shared between them. By allowing data and applications to move between private
and public clouds, a hybrid cloud gives your business greater flexibility, more deployment options, and
helps optimize your existing infrastructure, security, and compliance.

3
Types of cloud services

Infrastructure as a service (IaaS)

The most basic category of cloud computing services. With IaaS, you rent IT infrastructure—servers and
virtual machines (VMs), storage, networks, operating systems—from a cloud provider on a pay-as-you-
go basis.

Platform as a service (PaaS)

Platform as a service refers to cloud computing services that supply an on-demand environment for
developing, testing, delivering, and managing software applications. PaaS is designed to make it easier
for developers to quickly create web or mobile apps, without worrying about setting up or managing the
underlying infrastructure of servers, storage, network, and databases needed for development.

Software as a service (SaaS)

4
Software as a service is a method for delivering software applications over the Internet, on demand and
typically on a subscription basis. With SaaS, cloud providers host and manage the software application
and underlying infrastructure, and handle any maintenance, like software upgrades and security
patching. Users connect to the application over the Internet, usually with a web browser on their phone,
tablet, or PC.

Why should learn AWS

Fastest growing platform

Largest Cloud computing platform

5
AWS Certifications

6
AWS Global Infrastructure

Regions and Availability Zones

Each region is a separate geographic area.

Each region has multiple, isolated locations known as Availability Zones

Availability Zone is simply a Data Center

7
Edge Locations

An edge location is where end users access services located at AWS. They are located in most of the
major cities around the world and are specifically used by CloudFront (CDN) to distribute content to
end user to reduce latency

An Edge location can be assumed to be a collection of physical servers within a data center to allow for
content distribution to reduce latency for end users. The higher the number of edge locations the better
the content is distributed all over the world / region.

In India: Mumbai, Chennai, Delhi

8
9
Availability Zone Code

Ex: Asia Pacific (Mumbai) contains to three AZ

Representation

ap-south-1a

ap-south-1b &

ap-south-1c

IAM (Identity Access Management)

use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.

Root Account is with your mail ID

The AWS Account Root User

When you first create an Amazon Web Services (AWS) account, you begin with a single sign-in
identity that has complete access to all AWS services and resources in the account. This identity
is called the AWS account root user and is accessed by signing in with the email address and
password that you used to create the account.

IAM Users

An IAM user is an entity that you create in AWS. The IAM user represents the person or service
who uses the IAM user to interact with AWS

IAM Groups

An IAM group is a collection of IAM users. You can use groups to specify permissions for a
collection of users, which can make those permissions easier to manage for those users. For
example, you could have a group called Admins and give that group the types of permissions
that administrators typically need

10
IAM Roles

An IAM role is very similar to a user, in that it is an identity with permission policies that
determine what the identity can and cannot do in AWS. However, a role does not have any
credentials (password or access keys) associated with it. Instead of being uniquely associated
with one person, a role is intended to be assumable by anyone who needs it.

Policy
A policy is an object in AWS that, when associated with an identity or resource, defines their
permissions. AWS evaluates these policies when a principal entity (user or role) makes a
request. Permissions in the policies determine whether the request is allowed or denied. Most
policies are stored in AWS as JSON documents

Example 1
The following identity-based policy allows the implied principal to list a single Amazon S3
bucket named example_bucket:

{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::example_bucket"
}
}

Activate MFA on your root account

Install Google Authenticator from play store

Manage MFA→Continue to Security Credentials→ Multi-factor authentication (MFA)→Activate MFA→


Virtual MFA device

11
EC2
What Is Amazon EC2?
Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the
Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your need to invest in
hardware up front, so you can develop and deploy applications faster. You can use Amazon EC2
to launch as many or as few virtual servers as you need, configure security and networking, and
manage storage
EC2 concepts
Instances: Virtual computing environments
Amazon Machine Images (AMIs):
Preconfigured templates for your instances, known as Amazon Machine Images (AMIs), that
package the bits you need for your server (including the operating system and additional
software)
Instance Types:
Various configurations of CPU, memory, storage, and networking capacity for your instances,
known as instance types
Key Pairs

12
Secure login information for your instances using key pairs (AWS stores the public key, and you
store the private key in a secure place)
instance store volumes
Storage volumes for temporary data that's deleted when you stop or terminate your instance,
known as instance store volumes
Amazon Elastic Block Store (EBS)
Persistent storage volumes for your data using Amazon Elastic Block Store (Amazon EBS),
known as Amazon EBS volumes
Regions and Availability Zones
Multiple physical locations for your resources, such as instances and Amazon EBS volumes,
known as regions and Availability Zones
Elastic IP addresses
An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic IP address
is associated with your AWS account. With an Elastic IP address, you can mask the failure of an instance
or software by rapidly remapping the address to another instance in your account.

An Elastic IP address is a public IPv4 address, which is reachable from the internet. If your
instance does not have a public IPv4 address, you can associate an Elastic IP address with your
instance to enable communication with the internet; for example, to connect to your instance
from your local computer.

Tags
Metadata, known as tags, that you can create and assign to your Amazon EC2 resources
VPC
Virtual networks you can create that are logically isolated from the rest of the AWS cloud, and
that you can optionally connect to your own network, known as virtual private clouds(VPCs)

Instance Metadata and User Data


Instance metadata is data about your instance that you can use to configure or manage the
running instance

Retrieving Instance Metadata

# curl http://169.254.169.254/latest/meta-data/

13
Retrieving Instance Metadata
# curl http://169.254.169.254/latest/user-data/

Instance Types
When you launch an instance, the instance type that you specify determines the hardware of
the host computer used for your instance. Each instance type offers different compute,
memory, and storage capabilities and are grouped in instance families based on these
capabilities

1. General Purpose – (T2, M4, M3)


2. Computer Optimized – (C5, C4, C3)
3. Memory Optimized – (X1, R4, R3)
4. Accelerated Computing (P3, P2, G3, F1)
5. Storage optimized-(I3)
6. Dense-storage Instances – (D2)
Instance Pricing
1. On Demand
With On-Demand instances, you pay for compute capacity by per hour or per second
depending on which instances you run. No longer-term commitments or upfront
payments are needed
2. Spot
Amazon EC2 Spot instances allow you to request spare Amazon EC2 computing capacity
for up to 90% off the On-Demand price
3. Reserved
Reserved Instances provide you with a significant discount (up to 75%) compared to On-
Demand instance pricing. In addition, when Reserved Instances are assigned to a
specific Availability Zone, they provide a capacity reservation, giving you additional
confidence in your ability to launch instances when you need them
4. Dedicated Hosts
A Dedicated Host is a physical EC2 server dedicated for your use. Dedicated Hosts can
help you reduce costs by allowing you to use your existing server-bound software
licenses, including Windows Server, SQL Server, and SUSE Linux Enterprise Server
(subject to your license terms)
5. Scheduled Reserved Instances
Scheduled Reserved Instances (Scheduled Instances) enable you to purchase capacity r
reservations that recur on a daily, weekly, or monthly basis, with a specified start time
and duration, for a one-year term.

14
Scheduled Instances are a good choice for workloads that do not run continuously but
do run on a regular schedule. For example, you can use Scheduled Instances for an
application that runs during business hours or for batch processing that runs at the end
of the week.

Storage
Amazon EC2 provides you with flexible, cost effective, and easy-to-use data storage options for
your instances.

These storage options include the following:


Amazon Elastic Block Store(EBS)
Amazon EC2 Instance Store
Amazon Elastic File System (Amazon EFS)
Amazon Simple Storage Service (Amazon S3)

15
Amazon Block Storage
Amazon EBS provides durable, block-level storage volumes that you can attach to a running
instance. An EBS volume behaves like a raw, unformatted, external block device that you can
attach to a single instance. After an EBS volume is attached to an instance, you can use it like
any other physical hard drive

Amazon EC2 Instance Store


An instance store provides temporary block-level storage for your instance.
Many instances can access storage from disks that are physically attached to the host
computer. This disk storage is referred to as instance store. he data on an instance store
volume persists only during the life of the associated instance; if you stop or terminate an
instance, any data on instance store volumes is lost
Amazon EFS
You can use an EFS file system as a common data source for workloads and applications running
on multiple instances. Network filesystem (that means it may have bigger latency, but it can be
shared across several instances; even between regions). It is expensive compared to EBS (~10x
more) but it gives extra features.
S3
An object store (not a file system). This means, by default you can't just mount S3 and use it as
your webserver. But it's perfect for storing your images and videos for your website. You can
use Amazon S3 to store backup copies of your data and applications. Amazon EC2 uses Amazon
S3 to store EBS snapshots and instance store-backed AMIs.

S3 (Simple Storage Service)

Amazon Simple Storage Service (Amazon S3) is storage for the Internet. You can use Amazon S3 to store
and retrieve any amount of data at any time, from anywhere on the web

Amazon S3 stores data as objects within buckets. An object consists of a file and optionally any
metadata that describes that file.

16
To store an object in Amazon S3, you upload the file you want to store to a bucket. When you upload a
file, you can set permissions on the object as well as any metadata.

Buckets are the containers for objects. You can have one or more buckets. For each bucket, you can
control access to it (who can create, delete, and list objects in the bucket), view access logs for it and its
objects, and choose the geographical region where Amazon S3 will store the bucket and its contents.

Key Points

Objects based storage eg. Includes images, videos, document and not for installing os or db

Files upload can be 0 bytes to 5 TB

Files stored in bucket (Folder)

Bucket name should be unique in global

Storage Classes

S3 Standard: (durable, immediately available, frequently accessed)

S3 Intelligent Tiering – for data with unknown or changing access patterns

S3 Standard Infrequently accessed (IA) : (durable, immediately available, infrequently accessed)

S3 One Zone – IA: (even cheaper than IA but only in one AZ)

Glacier: Archived data, retrieval time for 3-5 hours before accessing

17
Fundamentals of S3 objects

Key(name)

Value(data)

Version ID

Metadata (owner)

Subresources:

ACL

S3, IAM is in Global region while EC2 in region wise

18
Practical

Let’s Create Bucket

Create bucket

Upload file to bucket

View all options

Create Static Website on S3

Holds static website

Download Static Websites from https://github.com/remotesynth/Static-Site-Samples.git

Create Bucket

Enable Static Website Hosting from Properties tab (Give Index and error file name(optional))

Upload Static Website (including all folder,index.html etc) (We have uploaded POHTML project)

Then go to Properties→ Static Website Hosting copy website URL

19
20
Elastic Load Balancer

Why we need load balancer?

A load balancer distributes incoming application traffic across multiple EC2 instances in multiple
Availability Zones. This increases the fault tolerance of your applications. Elastic Load Balancing detects
unhealthy instances and routes traffic only to healthy instances.

You can configure health checks, which are used to monitor the health of the registered instances so
that the load balancer only sends requests to the healthy instances.

Note that you can create your load balancer for use with EC2-Classic or a VPC

21
Types of Load balancer

Application Load Balancer (HTTP, HTTPS)

Choose an Application Load Balancer when you need a flexible feature set for your web applications
with HTTP and HTTPS traffic. Operating at the request level

Application Load Balancer is best suited for load balancing of HTTP and HTTPS traffic and provides
advanced request routing targeted at the delivery of modern application architectures, including
microservices and containers. Operating at the individual request level (Layer 7), Application Load
Balancer routes traffic to targets within Amazon Virtual Private Cloud (Amazon VPC) based on the
content of the request.

Network Load Balancer (TCP)

Choose a Network Load Balancer when you need ultra-high performance and static IP addresses for your
application. Operating at the connection level, Network Load Balancers are capable of handling millions
of requests per second while maintaining ultra-low latencies.

Network Load Balancer is best suited for load balancing of TCP traffic where extreme performance is
required. Operating at the connection level (Layer 4), Network Load Balancer routes traffic to targets
within Amazon Virtual Private Cloud (Amazon VPC) and is capable of handling millions of requests per
second while maintaining ultra-low latencies. Network Load Balancer is also optimized to handle sudden
and volatile traffic patterns.

Classic Load Balancer

Classic Load Balancer provides basic load balancing across multiple Amazon EC2 instances and operates
at both the request level and connection level. Classic Load Balancer is intended for applications that
were built within the EC2-Classic network.

22
Practical

1. Click on Load balancer (service→EC2→Loadbalancer (Left hand side)


2. Create Load Balancer→Application Load balancer

23
Create Target Groups first

24
25
Register your instances inside the Target Group

26
Once the Target Group is created; use it to create the ALB

27
3. Load Balancer is created. Copy the DNS name of load balancer

28
4. Check on browser

29
Amazon EC2 Auto Scaling

Amazon EC2 Auto Scaling helps you ensure that you have the correct number of Amazon EC2
instances available to handle the load for your application. You create collections of EC2
instances, called Auto Scaling groups.

You can specify the minimum number of instances in each Auto Scaling group, and Amazon EC2
Auto Scaling ensures that your group never goes below this size. You can specify the maximum
number of instances in each Auto Scaling group, and Amazon EC2 Auto Scaling ensures that
your group never goes above this size

Auto Scaling Components

1. Groups
EC2 instances are organized in to groups so that they can be treated as a logical unit for
the purposes of scaling and management. When you create a group, you can specify its
minimum, maximum, and, desired number of EC2 instances
2. Configuration templates
Your group uses a launch template or a launch configuration as a configuration template
for its EC2 instances. You can specify information such as the AMI ID, instance type, key
pair, security groups
3. Scaling options
Amazon EC2 Auto Scaling provides several ways for you to scale your Auto Scaling
groups. For example, you can configure a group to scale based on the occurrence of
specified conditions (dynamic scaling) or on a schedule

30
Practical

Click on Create Launch Configurations under the Auto Scaling Tab in the left pane

Don’t forget to choose the correct AMI & instance type while creation the ASG Launch configuration

Once the Launch config is successfully created go for creating the ASG

31
32
33
Now go & check the EC2 dashboard console

Now Terminate any of the instances & you will see autoscale group create automated ec2 instances

34
Cloud Front

It is global CDN (Content Delivery Network)

Used for application acceleration and optimization

Amazon CloudFront is a content delivery service that works in conjunction with other Amazon Web
Services (AWS) to provide developers with a simple way to distribute content to end users.

Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content,
such as .html, .css, .js, and image files, to your users. CloudFront delivers your content through a
worldwide network of data centers called edge locations. When a user requests content that you're
serving with CloudFront, the user is routed to the edge location that provides the lowest latency (time
delay), so that content is delivered with the best possible performance.

• If the content is already in the edge location with the lowest latency, CloudFront delivers it
immediately.
• If the content is not in that edge location, CloudFront retrieves it from an origin that you've
defined—such as an Amazon S3 bucket, a MediaPackage channel, or an HTTP server (for
example, a web server) that you have identified as the source for the definitive version of your
content

Follow this video for detailed discussions on cloudfront

https://aws.amazon.com/cloudfront/

35
36
Edge Location:

Location where content will be cached (Separate from AZ)

Distributions Methods

Web

Create a web distribution if you want to:

• Speed up distribution of static and dynamic content, for example, .html, .css, .php, and graphics
files.
• Distribute media files using HTTP or HTTPS.
• Add, update, or delete objects, and submit data from web forms.

RTMP

Create an RTMP distribution to speed up distribution of your streaming media files using Adobe Flash
Media Server's RTMP protocol. An RTMP distribution allows an end user to begin playing a media file
before the file has finished downloading from a CloudFront edge location. Note the following:

37
• To create an RTMP distribution, you must store the media files in an Amazon S3 bucket.
• To use CloudFront live streaming, create a web distribution.

Practical

Create bucket and upload image file of greater size in different region

Download image
https://upload.wikimedia.org/wikipedia/commons/2/2d/Snake_River_%285mb%29.jpg

Go to CloudFront → Create Distribution(Web)

38
Copy Domain name and put into browser

http://d17u3mrhi311cl.cloudfront.net/Snake_River_(5mb).jpg

AWS Command Line

Install AWS cli on Ubuntu16

# apt install awscli

# aws –version

# aws help

# aws configure

# ls –la

# cd .aws

Install AWS cli on windows

https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html

Configuration and Credential Files

Linux, macOS, or Unix

# ls ~/.aws

39
Windows

> dir "%UserProfile%\.aws"

AWS CLI commands

# aws s3 ls

# aws ec2 describe-instances

# aws ec2 help

#aws s3 help

AWS Command Structure

# aws <command> <subcommand> [options and parameters]

Documentations

https://docs.aws.amazon.com/cli/latest/index.html

# aws ec2 start-instances --instance-ids i-1234567890abcdef0

# aws ec2 run-instances --image-id ami-0912f71e06545ad88 --count 1 --instance-type t2.micro --key-


name aws_key --security-group-ids launch-wizard-11

# aws ec2 terminate-instances --instance-ids i-1234567890abcdef0

# aws s3 ls

#aws s3 mb s3://mybucketfromserver

40
# vi hello.txt

#aws s3 cp hello.txt s3://mybucketfromserver

# aws s3 rb --force s3://mybucketfromserver

Security Issues with aws credentials issues (Access key and secret key)

# cd .aws

# rm –rf config credentials

#aws s3 ls
Unable to locate credentials. You can configure credentials by running "aws configure".

IAM Role

Now create IAM Role

41
42
You can also attach IAM role while launching new instance

43
Now check

# aws s3 ls

What are IAM roles?

IAM roles are a secure way to grant permissions to entities that you trust

An IAM role is an IAM entity that defines a set of permissions for making AWS service requests. IAM
roles are not associated with a specific user or group. Instead, trusted entities assume roles, such as IAM
users, applications, or AWS services such as EC2.

44
RDS (Relational Databases Services)
Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up,
operate, and scale a relational database in the cloud. It provides cost-efficient, resizable capacity for an
industry-standard relational database and manages common database administration tasks.

Why do you want a managed relational database service? Because Amazon RDS takes over many of the
difficult or tedious management tasks of a relational database:

• When you buy a server, you get CPU, memory, storage, and IOPS, all bundled together. With
Amazon RDS, these are split apart so that you can scale them independently. If you need more
CPU, less IOPS, or more storage, you can easily allocate them.
• Amazon RDS manages backups, software patching, automatic failure detection, and recovery.
• You can have automated backups performed when you need them, or manually create your
own backup snapshot. You can use these backups to restore a database. The Amazon RDS
restore process works reliably and efficiently.
• In addition to the security in your database package, you can help control who can access your
RDS databases by using AWS Identity and Access Management (IAM) to define users and
permissions. You can also help protect your databases by putting them in a virtual private cloud.

RDS has Multi AZ for Disaster Recovery

What is RDS

- Databases
- Tables
- Rows
- Columns

Sample Table

ID Name Class Gender

1 Ajit 8 M

45
Types of RDS in AWS

• SQL Server
• Oracle
• MySQL Server
• PostgreSQL
• Aurora (Amazon): Maintains 6 copies and 5 times more performance
• Maria DB

Practical

1. Create RDS → Database→Create database

46
47
2. Click on next and keep default value as it intact. Finally click on Create Database
3. Database creation will take 5 to 10 minutes.

4. Click on instance and find out details


Find Security Groups and edit it allow access any source.

48
5. List out endpoint of database for connection purpose

6. Install on mysql server on local machine to access remote

#apt-get update
#apt-get install mysql-server
#mysql_secure_installation

7. Connecting from the MySQL Utility

To connect to a DB instance using the MySQL utility, type the following command at a command
prompt to connect to a DB instance using the MySQL utility. For the -h parameter, substitute the DNS
name (endpoint) for your DB instance. For the -P parameter, substitute the port for your DB instance.
Enter the master user password when prompted.

mysql -h mydbinstance.ce45fxoim7q3.ap-south-1.rds.amazonaws.com -P 3306 -u devops –p

49
8. Enter some queries to test database
mysql>show databases;

mysql>create database cricket;

mysql>show databases;

mysql>use cricket;

mysql>Create table player(jno int, name varchar(20));

mysql>insert into player values (18,'Virat');

mysql>select * from player;

50
Elastic Beanstalk

With Elastic Beanstalk, you can deploy, monitor, and scale an application quickly and easily. Let us do
the heavy lifting so you can focus on your business.
To deploy your existing web application, create an application source bundle and then create a new
application. If you're using Git and would prefer to use it with our command line tool, please see Getting
Started with the EB CLI.

With Elastic Beanstalk, you can quickly deploy and manage applications in the AWS Cloud without
worrying about the infrastructure that runs those applications. AWS Elastic Beanstalk reduces
management complexity without restricting choice or control. You simply upload your application, and
Elastic Beanstalk automatically handles the details of capacity provisioning, load balancing, scaling, and
application health monitoring. Elastic Beanstalk uses highly reliable and scalable services that are
available in the AWS Free Tier.

To use Elastic Beanstalk, you create an application, upload an application version in the form of an
application source bundle (for example, a Java .war file) to Elastic Beanstalk, and then provide some
information about the application. Elastic Beanstalk automatically launches an environment and creates
and configures the AWS resources needed to run your code. After your environment is launched, you
can then manage your environment and deploy new application versions. The following diagram
illustrates the workflow of Elastic Beanstalk.

After you create and deploy your application, information about the application—including metrics,
events, and environment status—is available through the AWS Management Console, APIs, or
Command Line Interfaces, including the unified AWS CLI

51
52
Cloud Formation
What is AWS CloudFormation?

Infrastructure as code

AWS CloudFormation is a service that helps you model and set up your Amazon Web Services resources
so that you can spend less time managing those resources and more time focusing on your applications
that run in AWS. You create a template that describes all the AWS resources that you want (like Amazon
EC2 instances or Amazon RDS DB instances), and AWS CloudFormation takes care of provisioning and
configuring those resources for you. You don't need to individually create and configure AWS resources
and figure out what's dependent on what; AWS CloudFormation handles all of that

Template Anatomy

---
AWSTemplateFormatVersion: "version date"

Description:
String

Metadata:
template metadata

53
Parameters:
set of parameters

Mappings:
set of mappings

Conditions:
set of conditions

Transform:
set of transforms

Resources:
set of resources

Outputs:
set of outputs

Practical

Template for ec2 instance and s3 bucket creation

Mytemplate.yml

AWSTemplateFormatVersion: "2010-09-09"

Parameters:

MyImageID:

Description: "Specify image id"

Type: String

Resources:

MyEC2Instance:

Type: AWS::EC2::Instance

Properties:

ImageId: !Ref MyImageID

InstanceType: "t2.micro"

54
KeyName: "aws-26-01-19"

SecurityGroups:

- "launch-wizard-1"

MyBucket:

Type: AWS::S3::Bucket

Properties:

BucketName: "devopstemplatebucket" BucketName: "ajitdevops12345"

55
56
Cloud Watch

Better Observability of your VM

CloudWatch is a monitoring service

CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, providing
you with a unified view of AWS resources, applications and services that run on AWS

You can use CloudWatch to set high resolution alarms, visualize logs and metrics side by side

57
58

You might also like