Table des matières

Elastic Compute Cloud


EC2 instance

AMI : Amazon Machine Images

Instances EC2 pré configurées. Différentes sources :

Instance Types

Paramétrage de la VM pour CPU, mémoire, stockage, performance réseau …

Purchase Options

On-demand instances

Spot Instances

Pour un besoin interruptible qui fonctionne quand le coût est optimal.

Reserved instances

Pour un besoin prévisible sur 1 à 3 ans pour un coût moindre

Scheduled instances

Pour une utilisation planifiée.

Capacity reservations

Tenancy

Shared tenancy

Le matériel est partagé avec d'autres clients.

Dedicated tenancy

Le matériel nous est dédié pour un coût plus élevé.

Dedicated host

Idem avec plus de possibilité de customisation.

User Data

Pour exécuter des commandes lors du premier démarrage de l'instance. Par exemple pour mettre à jour l'OS ou installer un logiciel depuis un dépôt.

Metadata

Rassemble les informations de l'instance qui s'exécute comme le hostname, security group, adresse MAC, adresse IP.
Accessible à l'adresse http://169.254.169.254/latest/meta-data.

curl -w "\n" http://169.254.169.254/latest/meta-data

@MAC

curl -w "\n" http://169.254.169.254/latest/meta-data/mac

@IP

curl -w "\n" http://169.254.169.254/latest/meta-data/local-ipv4

Clef publique

curl -w "\n" http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key

Storage

Ephemeral

EBS


Haut de page

Auto Scaling

Groups

Your EC2 instances are organized into 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. 

Launch configurations

Your group uses a launch configuration as a template for its EC2 instances. When you create a launch configuration, you can specify information such as the AMI ID, instance type, key pair, security groups, and block device mapping for your instances. 

Launch template

A launch template is similar to a launch configuration, in that it specifies instance configuration information. … However, defining a launch template instead of a launch configuration allows you to have multiple versions of a template. With versioning, you can create a subset of the full set of parameters and then reuse it to create other templates or template versions.

Utiliser de préférence Launch template plutôt que Launch configuration.

Scaling policies

On peut augmenter ou diminuer le nombre d'instances selon plusieurs critères :


Haut de page

Load Balancer

Application ELB

Network Load Balancer

Classic Load Balancer


Haut de page