id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
ef60ae834a3f-0
Security groups act as a firewall for associated instances, controlling both inbound and outbound traffic at the instance level\. You must add rules to a security group that enable you to connect to your Linux instance from your IP address using SSH\. **To add a rule to a security group for inbound SSH traffic over IPv4 \(console\)** 1. In the navigation pane of the Amazon EC2 console, choose **Instances**\. Select your instance and look at the **Description** tab; **Security groups** lists the security groups that are associated with the instance\. Choose **view inbound rules** to display a list of the rules that are in effect for the instance\. 1. In the navigation pane, choose **Security Groups**\. Select one of the security groups associated with your instance\. 1. In the details pane, on the **Inbound** tab, choose **Edit**\. In the dialog, choose **Add Rule**, and then choose **SSH** from the **Type** list\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/authorizing-access-to-an-instance.md
ef60ae834a3f-1
1. In the **Source** field, choose **My IP** to automatically populate the field with the public IPv4 address of your local computer\. Alternatively, choose **Custom** and specify the public IPv4 address of your computer or network in CIDR notation\. For example, if your IPv4 address is `203.0.113.25`, specify `203.0.113.25/32` to list this single IPv4 address in CIDR notation\. If your company allocates addresses from a range, specify the entire range, such as `203.0.113.0/24`\. For information about finding your IP address, see [Before you start](#authorizing-access-prereqs)\. 1. Choose **Save**\. If you launched an instance with an IPv6 address and want to connect to your instance using its IPv6 address, you must add rules that allow inbound IPv6 traffic over SSH\. **To add a rule to a security group for inbound SSH traffic over IPv6 \(console\)** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, choose **Security Groups**\. Select the security group for your instance\. 1. Choose **Inbound**, **Edit**, **Add Rule**\. 1. For **Type**, choose **SSH**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/authorizing-access-to-an-instance.md
ef60ae834a3f-2
1. For **Type**, choose **SSH**\. 1. In the **Source** field, specify the IPv6 address of your computer in CIDR notation\. For example, if your IPv6 address is `2001:db8:1234:1a00:9691:9503:25ad:1761`, specify `2001:db8:1234:1a00:9691:9503:25ad:1761/128` to list the single IP address in CIDR notation\. If your company allocates addresses from a range, specify the entire range, such as `2001:db8:1234:1a00::/64`\. 1. Choose **Save**\. **Note** Be sure to run the following commands on your local system, not on the instance itself\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\. **To add a rule to a security group using the command line** 1. Find the security group that is associated with your instance using one of the following commands: + [describe\-instance\-attribute](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-attribute.html) \(AWS CLI\) ``` aws ec2 describe-instance-attribute --instance-id instance_id --attribute groupSet ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/authorizing-access-to-an-instance.md
ef60ae834a3f-3
``` aws ec2 describe-instance-attribute --instance-id instance_id --attribute groupSet ``` + [Get\-EC2InstanceAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceAttribute.html) \(AWS Tools for Windows PowerShell\) ``` PS C:\> (Get-EC2InstanceAttribute -InstanceId instance_id -Attribute groupSet).Groups ``` Both commands return a security group ID, which you use in the next step\. 1. Add the rule to the security group using one of the following commands: + [authorize\-security\-group\-ingress](https://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html) \(AWS CLI\) ``` aws ec2 authorize-security-group-ingress --group-id security_group_id --protocol tcp --port 22 --cidr cidr_ip_range ``` + [Grant\-EC2SecurityGroupIngress](https://docs.aws.amazon.com/powershell/latest/reference/items/Grant-EC2SecurityGroupIngress.html) \(AWS Tools for Windows PowerShell\)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/authorizing-access-to-an-instance.md
ef60ae834a3f-4
The `Grant-EC2SecurityGroupIngress` command needs an `IpPermission` parameter, which describes the protocol, port range, and IP address range to be used for the security group rule\. The following command creates the `IpPermission` parameter: ``` PS C:\> $ip1 = @{ IpProtocol="tcp"; FromPort="22"; ToPort="22"; IpRanges="cidr_ip_range" } ``` ``` PS C:\> Grant-EC2SecurityGroupIngress -GroupId security_group_id -IpPermission @($ip1) ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/authorizing-access-to-an-instance.md
6860ead8e356-0
You can assign a security group to an instance when you launch the instance\. When you add or remove rules, those changes are automatically applied to all instances to which you've assigned the security group\. After you launch an instance, you can change its security groups\. For more information, see [Changing an instance's security groups](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#SG_Changing_Group_Membership) in the *Amazon VPC User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/authorizing-access-to-an-instance.md
73b5bd4bbff8-0
A burstable performance instance configured as `unlimited` can sustain high CPU utilization for any period of time whenever required\. The hourly instance price automatically covers all CPU usage spikes if the average CPU utilization of the instance is at or below the baseline over a rolling 24\-hour period or the instance lifetime, whichever is shorter\. For the vast majority of general\-purpose workloads, instances configured as `unlimited` provide ample performance without any additional charges\. If the instance runs at higher CPU utilization for a prolonged period, it can do so for a flat additional rate per vCPU\-hour\. For information about instance pricing, see [Amazon EC2 Pricing](https://aws.amazon.com/ec2/pricing/) and the section for Unlimited Mode Pricing on the [Amazon EC2 On\-Demand Pricing page](https://aws.amazon.com/ec2/pricing/on-demand/#T2.2FT3_Unlimited_Mode_Pricing)\. If you use a `t2.micro` or `t3.micro` instance under the [AWS Free Tier](https://aws.amazon.com/free/) offer and use it in `unlimited` mode, charges might apply if your average utilization over a rolling 24\-hour period exceeds the [baseline utilization](burstable-credits-baseline-concepts.md#baseline_performance) of the instance\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/burstable-performance-instances-unlimited-mode.md
73b5bd4bbff8-1
T3 and T4g instances launch as `unlimited` by default\. If the average CPU usage over a 24\-hour period exceeds the baseline, you incur charges for surplus credits\. If you launch Spot Instances as `unlimited` and plan to use them immediately and for a short duration, with no idle time for accruing CPU credits, you incur charges for surplus credits\. We recommend that you launch your Spot Instances in [standard](burstable-performance-instances-standard-mode.md) mode to avoid paying higher costs\. For more information, see [Surplus credits can incur charges](burstable-performance-instances-unlimited-mode-concepts.md#unlimited-mode-surplus-credits) and [Burstable performance instances](using-spot-limits.md#t3-spot-instances)\. **Contents** + [Unlimited mode concepts](burstable-performance-instances-unlimited-mode-concepts.md) + [How Unlimited burstable performance instances work](burstable-performance-instances-unlimited-mode-concepts.md#how-burstable-performance-instances-unlimited-works) + [When to use unlimited mode versus fixed CPU](burstable-performance-instances-unlimited-mode-concepts.md#when-to-use-unlimited-mode) + [Surplus credits can incur charges](burstable-performance-instances-unlimited-mode-concepts.md#unlimited-mode-surplus-credits) + [No launch credits for T2 Unlimited instances](burstable-performance-instances-unlimited-mode-concepts.md#unlimited-mode-no-launch-credits)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/burstable-performance-instances-unlimited-mode.md
73b5bd4bbff8-2
+ [No launch credits for T2 Unlimited instances](burstable-performance-instances-unlimited-mode-concepts.md#unlimited-mode-no-launch-credits) + [Enabling unlimited mode](burstable-performance-instances-unlimited-mode-concepts.md#unlimited-mode-enabling) + [What happens to credits when switching between Unlimited and Standard](burstable-performance-instances-unlimited-mode-concepts.md#unlimited-mode-switching-and-credits) + [Monitoring credit usage](burstable-performance-instances-unlimited-mode-concepts.md#unlimited-mode-monitoring-credit-usage) + [Unlimited mode examples](unlimited-mode-examples.md) + [Example 1: Explaining credit use with T3 Unlimited](unlimited-mode-examples.md#t3_unlimited_example) + [Example 2: Explaining credit use with T2 Unlimited](unlimited-mode-examples.md#t2_unlimited_example)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/burstable-performance-instances-unlimited-mode.md
3068b88ad697-0
The following procedures will help you install, configure, and secure a WordPress blog on your Amazon Linux instance\. This tutorial is a good introduction to using Amazon EC2 in that you have full control over a web server that hosts your WordPress blog, which is not typical with a traditional hosting service\. You are responsible for updating the software packages and maintaining security patches for your server\. For a more automated WordPress installation that does not require direct interaction with the web server configuration, the AWS CloudFormation service provides a WordPress template that can also get you started quickly\. For more information, see [Get started](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/GettingStarted.Walkthrough.html) in the *AWS CloudFormation User Guide*\. If you'd prefer to host your WordPress blog on a Windows instance, see [Deploying a WordPress blog on your Amazon EC2 Windows instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_CreateWordPressBlog.html) in the *Amazon EC2 User Guide for Windows Instances*\. If you need a high\-availability solution with a decoupled database, see [Deploying a high\-availability WordPress website](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html) in the *AWS Elastic Beanstalk Developer Guide*\. **Important**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
3068b88ad697-1
**Important** These procedures are intended for use with Amazon Linux\. For more information about other distributions, see their specific documentation\. Many steps in this tutorial do not work on Ubuntu instances\. For help installing WordPress on an Ubuntu instance, see [WordPress](https://help.ubuntu.com/community/WordPress) in the Ubuntu documentation\. **Option: Complete this tutorial using automation** To complete this tutorial using AWS Systems Manager Automation instead of the following tasks, run one of the following Automation documents: [AWSDocs\-HostingAWordPressBlog\-AL](https://console.aws.amazon.com/systems-manager/automation/execute/AWSDocs-HostingAWordPressBlog-AL) \(Amazon Linux\) or [AWSDocs\-HostingAWordPressBlog\-AL2](https://console.aws.amazon.com/systems-manager/automation/execute/AWSDocs-HostingAWordPressBlog-AL2) \(Amazon Linux 2\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
05d69386af6e-0
This tutorial assumes that you have launched an Amazon Linux instance with a functional web server with PHP and database \(either MySQL or MariaDB\) support by following all of the steps in [Tutorial: Install a LAMP web server with the Amazon Linux AMI](install-LAMP.md) for Amazon Linux AMI or [Tutorial: Install a LAMP web server on Amazon Linux 2](ec2-lamp-amazon-linux-2.md) for Amazon Linux 2\. This tutorial also has steps for configuring a security group to allow `HTTP` and `HTTPS` traffic, as well as several steps to ensure that file permissions are set properly for your web server\. For information about adding rules to your security group, see [Adding rules to a security group](working-with-security-groups.md#adding-security-group-rule)\. We strongly recommend that you associate an Elastic IP address \(EIP\) to the instance you are using to host a WordPress blog\. This prevents the public DNS address for your instance from changing and breaking your installation\. If you own a domain name and you want to use it for your blog, you can update the DNS record for the domain name to point to your EIP address \(for help with this, contact your domain name registrar\)\. You can have one EIP address associated with a running instance at no charge\. For more information, see [Elastic IP addresses](elastic-ip-addresses-eip.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
05d69386af6e-1
If you don't already have a domain name for your blog, you can register a domain name with Route 53 and associate your instance's EIP address with your domain name\. For more information, see [Registering domain names using Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar.html) in the *Amazon Route 53 Developer Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-0
Connect to your instance, and download the WordPress installation package\. **To download and unzip the WordPress installation package** 1. Download the latest WordPress installation package with the wget command\. The following command should always download the latest release\. ``` [ec2-user ~]$ wget https://wordpress.org/latest.tar.gz ``` 1. Unzip and unarchive the installation package\. The installation folder is unzipped to a folder called `wordpress`\. ``` [ec2-user ~]$ tar -xzf latest.tar.gz ```<a name="create_user_and_database"></a> **To create a database user and database for your WordPress installation** Your WordPress installation needs to store information, such as blog posts and user comments, in a database\. This procedure helps you create your blog's database and a user that is authorized to read and save information to it\. 1. Start the database server\. + Amazon Linux 2 ``` [ec2-user ~]$ sudo systemctl start mariadb ``` + Amazon Linux AMI ``` [ec2-user ~]$ sudo service mysqld start ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-1
+ Amazon Linux AMI ``` [ec2-user ~]$ sudo service mysqld start ``` 1. Log in to the database server as the `root` user\. Enter your database `root` password when prompted; this may be different than your `root` system password, or it may even be empty if you have not secured your database server\. If you have not secured your database server yet, it is important that you do so\. For more information, see [To secure the MariaDB server](ec2-lamp-amazon-linux-2.md#securing-maria-db) \(Amazon Linux 2\) or [To secure the database server](install-LAMP.md#SecuringMySQLProcedure) \(Amazon Linux AMI\)\. ``` [ec2-user ~]$ mysql -u root -p ``` 1. <a name="create_database_user"></a>Create a user and password for your MySQL database\. Your WordPress installation uses these values to communicate with your MySQL database\. Enter the following command, substituting a unique user name and password\. ``` CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'your_strong_password'; ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-2
``` CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'your_strong_password'; ``` Make sure that you create a strong password for your user\. Do not use the single quote character \( ' \) in your password, because this will break the preceding command\. For more information about creating a secure password, go to [http://www\.pctools\.com/guides/password/](http://www.pctools.com/guides/password/)\. Do not reuse an existing password, and make sure to store this password in a safe place\. 1. <a name="create_database"></a>Create your database\. Give your database a descriptive, meaningful name, such as `wordpress-db`\. **Note** The punctuation marks surrounding the database name in the command below are called backticks\. The backtick \(```\) key is usually located above the `Tab` key on a standard keyboard\. Backticks are not always required, but they allow you to use otherwise illegal characters, such as hyphens, in database names\. ``` CREATE DATABASE `wordpress-db`; ``` 1. Grant full privileges for your database to the WordPress user that you created earlier\. ``` GRANT ALL PRIVILEGES ON `wordpress-db`.* TO "wordpress-user"@"localhost"; ``` 1. Flush the database privileges to pick up all of your changes\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-3
``` 1. Flush the database privileges to pick up all of your changes\. ``` FLUSH PRIVILEGES; ``` 1. Exit the `mysql` client\. ``` exit ``` **To create and edit the wp\-config\.php file** The WordPress installation folder contains a sample configuration file called `wp-config-sample.php`\. In this procedure, you copy this file and edit it to fit your specific configuration\. 1. Copy the `wp-config-sample.php` file to a file called `wp-config.php`\. This creates a new configuration file and keeps the original sample file intact as a backup\. ``` [ec2-user ~]$ cp wordpress/wp-config-sample.php wordpress/wp-config.php ``` 1. Edit the `wp-config.php` file with your favorite text editor \(such as nano or vim\) and enter values for your installation\. If you do not have a favorite text editor, `nano` is suitable for beginners\. ``` [ec2-user ~]$ nano wordpress/wp-config.php ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-4
``` [ec2-user ~]$ nano wordpress/wp-config.php ``` 1. Find the line that defines `DB_NAME` and change `database_name_here` to the database name that you created in [Step 4](#create_database) of [To create a database user and database for your WordPress installation](#create_user_and_database)\. ``` define('DB_NAME', 'wordpress-db'); ``` 1. Find the line that defines `DB_USER` and change `username_here` to the database user that you created in [Step 3](#create_database_user) of [To create a database user and database for your WordPress installation](#create_user_and_database)\. ``` define('DB_USER', 'wordpress-user'); ``` 1. Find the line that defines `DB_PASSWORD` and change `password_here` to the strong password that you created in [Step 3](#create_database_user) of [To create a database user and database for your WordPress installation](#create_user_and_database)\. ``` define('DB_PASSWORD', 'your_strong_password'); ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-5
``` define('DB_PASSWORD', 'your_strong_password'); ``` 1. Find the section called `Authentication Unique Keys and Salts`\. These `KEY` and `SALT` values provide a layer of encryption to the browser cookies that WordPress users store on their local machines\. Basically, adding long, random values here makes your site more secure\. Visit [https://api\.wordpress\.org/secret\-key/1\.1/salt/](https://api.wordpress.org/secret-key/1.1/salt/) to randomly generate a set of key values that you can copy and paste into your `wp-config.php` file\. To paste text into a PuTTY terminal, place the cursor where you want to paste the text and right\-click your mouse inside the PuTTY terminal\. For more information about security keys, go to [https://wordpress\.org/support/article/editing\-wp\-config\-php/\#security\-keys](https://wordpress.org/support/article/editing-wp-config-php/#security-keys)\. **Note** The values below are for example purposes only; do not use these values for your installation\. ``` define('AUTH_KEY', ' #U$$+[RXN8:b^-L 0(WU_+ c+WFkI~c]o]-bHw+)/Aj[wTwSiZ<Qb[mghEXcRh-');
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-6
define('SECURE_AUTH_KEY', 'Zsz._P=l/|y.Lq)XjlkwS1y5NJ76E6EJ.AV0pCKZZB,*~*r ?6OP$eJT@;+(ndLg'); define('LOGGED_IN_KEY', 'ju}qwre3V*+8f_zOWf?{LlGsQ]Ye@2Jh^,8x>)Y |;(^[Iw]Pi+LG#A4R?7N`YB3'); define('NONCE_KEY', 'P(g62HeZxEes|LnI^i=H,[XwK9I&[2s|:?0N}VJM%?;v2v]v+;+^9eXUahg@::Cj'); define('AUTH_SALT', 'C$DpB4Hj[JK:?{ql`sRVa:{:7yShy(9A@5wg+`JJVb1fk%_-Bx*M4(qc[Qg%JT!h'); define('SECURE_AUTH_SALT', 'd!uRu#}+q#{f$Z?Z9uFPG.${+S{n~1M&%@~gL>U>NV<zpD-@2-Es7Q1O-bp28EKv');
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-7
define('LOGGED_IN_SALT', ';j{00P*owZf)kVD+FVLn-~ >.|Y%Ug4#I^*LVd9QeZ^&XmK|e(76miC+&W&+^0P/'); define('NONCE_SALT', '-97r*V/cgxLmp?Zy4zUU4r99QQ_rGs2LTd%P;|_e1tS)8_B/,.6[=UK<J_y9?JWG'); ``` 1. Save the file and exit your text editor\. **To install your WordPress files under the Apache document root** + Now that you've unzipped the installation folder, created a MySQL database and user, and customized the WordPress configuration file, you are ready to copy your installation files to your web server document root so you can run the installation script that completes your installation\. The location of these files depends on whether you want your WordPress blog to be available at the actual root of your web server \(for example, `my.public.dns.amazonaws.com`\) or in a subdirectory or folder under the root \(for example, `my.public.dns.amazonaws.com/blog`\)\. + If you want WordPress to run at your document root, copy the contents of the wordpress installation directory \(but not the directory itself\) as follows: ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-8
``` [ec2-user ~]$ cp -r wordpress/* /var/www/html/ ``` + If you want WordPress to run in an alternative directory under the document root, first create that directory, and then copy the files to it\. In this example, WordPress will run from the directory `blog`: ``` [ec2-user ~]$ mkdir /var/www/html/blog [ec2-user ~]$ cp -r wordpress/* /var/www/html/blog/ ``` **Important** For security purposes, if you are not moving on to the next procedure immediately, stop the Apache web server \(`httpd`\) now\. After you move your installation under the Apache document root, the WordPress installation script is unprotected and an attacker could gain access to your blog if the Apache web server were running\. To stop the Apache web server, enter the command sudo service httpd stop\. If you are moving on to the next procedure, you do not need to stop the Apache web server\. **To allow WordPress to use permalinks** WordPress permalinks need to use Apache `.htaccess` files to work properly, but this is not enabled by default on Amazon Linux\. Use this procedure to allow all overrides in the Apache document root\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
2b10c9fbdb5a-9
1. Open the `httpd.conf` file with your favorite text editor \(such as nano or vim\)\. If you do not have a favorite text editor, `nano` is suitable for beginners\. ``` [ec2-user ~]$ sudo vim /etc/httpd/conf/httpd.conf ``` 1. Find the section that starts with `<Directory "/var/www/html">`\. ``` <Directory "/var/www/html">
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
8a51e42ac317-0
Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> ``` 1. Change the `AllowOverride None` line in the above section to read `AllowOverride All`\. **Note** There are multiple `AllowOverride` lines in this file; be sure you change the line in the `<Directory "/var/www/html">` section\. ``` AllowOverride All ``` 1. Save the file and exit your text editor\. **To install the PHP graphics drawing library on Amazon Linux 2** The GD library for PHP enables you to modify images\. Install this library if you need to crop the header image for your blog\. The version of phpMyAdmin that you install might require a specific minimum version of this library \(for example, version 7\.2\)\. Use the following command to install the PHP graphics drawing library on Amazon Linux 2\. For example, if you installed php7\.2 from amazon\-linux\-extras as part of installing the LAMP stack, this command installs version 7\.2 of the PHP graphics drawing library\. ``` [ec2-user ~]$ sudo yum install php-gd ``` To verify the installed version, use the following command: ``` [ec2-user ~]$ sudo yum list installed | grep php ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
8a51e42ac317-1
``` [ec2-user ~]$ sudo yum list installed | grep php ``` The following is example output: ``` php-cli.x86_64 7.2.30-1.amzn2 @amzn2extra-php7.2 php-common.x86_64 7.2.30-1.amzn2 @amzn2extra-php7.2 php-fpm.x86_64 7.2.30-1.amzn2 @amzn2extra-php7.2 php-gd.x86_64 7.2.30-1.amzn2 @amzn2extra-php7.2 php-json.x86_64 7.2.30-1.amzn2 @amzn2extra-php7.2 php-mysqlnd.x86_64 7.2.30-1.amzn2 @amzn2extra-php7.2 php-pdo.x86_64 7.2.30-1.amzn2 @amzn2extra-php7.2 ``` **To install the PHP graphics drawing library on the Amazon Linux AMI**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
8a51e42ac317-2
``` **To install the PHP graphics drawing library on the Amazon Linux AMI** The GD library for PHP enables you to modify images\. Install this library if you need to crop the header image for your blog\. The version of phpMyAdmin that you install might require a specific minimum version of this library \(for example, version 7\.2\)\. To verify which versions are available, use the following command: ``` [ec2-user ~]$ yum list | grep php ``` The following is an example line from the output for the PHP graphics drawing library \(version 7\.2\): ``` php72-gd.x86_64 7.2.30-1.22.amzn1 amzn-updates ``` Use the following command to install a specific version of the PHP graphics drawing library \(for example, version 7\.2\) on the Amazon Linux AMI: ``` [ec2-user ~]$ sudo yum install php72-gd ``` **To fix file permissions for the Apache web server** Some of the available features in WordPress require write access to the Apache document root \(such as uploading media though the Administration screens\)\. If you have not already done so, apply the following group memberships and permissions \(as described in greater detail in the [LAMP web server tutorial](install-LAMP.md)\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
8a51e42ac317-3
1. Grant file ownership of `/var/www` and its contents to the `apache` user\. ``` [ec2-user ~]$ sudo chown -R apache /var/www ``` 1. Grant group ownership of `/var/www` and its contents to the `apache` group\. ``` [ec2-user ~]$ sudo chgrp -R apache /var/www ``` 1. Change the directory permissions of `/var/www` and its subdirectories to add group write permissions and to set the group ID on future subdirectories\. ``` [ec2-user ~]$ sudo chmod 2775 /var/www [ec2-user ~]$ find /var/www -type d -exec sudo chmod 2775 {} \; ``` 1. Recursively change the file permissions of `/var/www` and its subdirectories to add group write permissions\. ``` [ec2-user ~]$ find /var/www -type f -exec sudo chmod 0664 {} \; ``` 1. Restart the Apache web server to pick up the new group and permissions\. + Amazon Linux 2 ``` [ec2-user ~]$ sudo systemctl restart httpd ``` + Amazon Linux AMI
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
8a51e42ac317-4
``` [ec2-user ~]$ sudo systemctl restart httpd ``` + Amazon Linux AMI ``` [ec2-user ~]$ sudo service httpd restart ``` **To run the WordPress installation script with Amazon Linux 2** You are ready to install WordPress\. The commands that you use depend on the operating system\. The commands in this procedure are for use with Amazon Linux 2\. Use the procedure that follows this one with Amazon Linux AMI\. 1. Use the systemctl command to ensure that the `httpd` and database services start at every system boot\. ``` [ec2-user ~]$ sudo systemctl enable httpd && sudo systemctl enable mariadb ``` 1. Verify that the database server is running\. ``` [ec2-user ~]$ sudo systemctl status mariadb ``` If the database service is not running, start it\. ``` [ec2-user ~]$ sudo systemctl start mariadb ``` 1. Verify that your Apache web server \(`httpd`\) is running\. ``` [ec2-user ~]$ sudo systemctl status httpd ``` If the `httpd` service is not running, start it\. ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
8a51e42ac317-5
``` If the `httpd` service is not running, start it\. ``` [ec2-user ~]$ sudo systemctl start httpd ``` 1. In a web browser, type the URL of your WordPress blog \(either the public DNS address for your instance, or that address followed by the `blog` folder\)\. You should see the WordPress installation script\. Provide the information required by the WordPress installation\. Choose **Install WordPress** to complete the installation\. For more information, see [Step 5: Run the Install Script](https://wordpress.org/support/article/how-to-install-wordpress/#step-5-run-the-install-script) on the WordPress website\. **To run the WordPress installation script with Amazon Linux AMI** 1. Use the chkconfig command to ensure that the `httpd` and database services start at every system boot\. ``` [ec2-user ~]$ sudo chkconfig httpd on && sudo chkconfig mysqld on ``` 1. Verify that the database server is running\. ``` [ec2-user ~]$ sudo service mysqld status ``` If the database service is not running, start it\. ``` [ec2-user ~]$ sudo service mysqld start ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
8a51e42ac317-6
``` [ec2-user ~]$ sudo service mysqld start ``` 1. Verify that your Apache web server \(`httpd`\) is running\. ``` [ec2-user ~]$ sudo service httpd status ``` If the `httpd` service is not running, start it\. ``` [ec2-user ~]$ sudo service httpd start ``` 1. In a web browser, type the URL of your WordPress blog \(either the public DNS address for your instance, or that address followed by the `blog` folder\)\. You should see the WordPress installation script\. Provide the information required by the WordPress installation\. Choose **Install WordPress** to complete the installation\. For more information, see [Step 5: Run the Install Script](https://wordpress.org/support/article/how-to-install-wordpress/#step-5-run-the-install-script) on the WordPress website\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
30d46b0ba7d7-0
After you have tested your WordPress blog, consider updating its configuration\. **Use a custom domain name** If you have a domain name associated with your EC2 instance's EIP address, you can configure your blog to use that name instead of the EC2 public DNS address\. For more information, see [Changing The Site URL](https://wordpress.org/support/article/changing-the-site-url/) on the WordPress website\. **Configure your blog** You can configure your blog to use different [themes](https://wordpress.org/themes/) and [plugins](https://wordpress.org/plugins/) to offer a more personalized experience for your readers\. However, sometimes the installation process can backfire, causing you to lose your entire blog\. We strongly recommend that you create a backup Amazon Machine Image \(AMI\) of your instance before attempting to install any themes or plugins so you can restore your blog if anything goes wrong during installation\. For more information, see [Creating your own AMI](AMIs.md#creating-an-ami)\. **Increase capacity** If your WordPress blog becomes popular and you need more compute power or storage, consider the following steps: + Expand the storage space on your instance\. For more information, see [Amazon EBS Elastic Volumes](ebs-modify-volume.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
30d46b0ba7d7-1
+ Expand the storage space on your instance\. For more information, see [Amazon EBS Elastic Volumes](ebs-modify-volume.md)\. + Move your MySQL database to [Amazon RDS](https://aws.amazon.com/rds) to take advantage of the service's ability to scale easily\. + Migrate to a larger instance type\. For more information, see [Changing the instance type](ec2-instance-resize.md)\. + Add additional instances\. For more information, see [Tutorial: Increase the availability of your application on Amazon EC2](ec2-increase-availability.md)\. **Learn more about WordPress**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
30d46b0ba7d7-2
**Learn more about WordPress** For information about WordPress, see the WordPress Codex help documentation at [http://codex\.wordpress\.org/](http://codex.wordpress.org/)\. For more information about troubleshooting your installation, go to [https://wordpress\.org/support/article/how\-to\-install\-wordpress/\#common\-installation\-problems](https://wordpress.org/support/article/how-to-install-wordpress/#common-installation-problems)\. For information about making your WordPress blog more secure, go to [https://wordpress\.org/support/article/hardening\-wordpress/](https://wordpress.org/support/article/hardening-wordpress/)\. For information about keeping your WordPress blog up\-to\-date, go to [https://wordpress\.org/support/article/updating\-wordpress/](https://wordpress.org/support/article/updating-wordpress/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
dbd8977d3a7f-0
Your WordPress installation is automatically configured using the public DNS address for your EC2 instance\. If you stop and restart the instance, the public DNS address changes \(unless it is associated with an Elastic IP address\) and your blog will not work anymore because it references resources at an address that no longer exists \(or is assigned to another EC2 instance\)\. A more detailed description of the problem and several possible solutions are outlined in [https://wordpress\.org/support/article/changing\-the\-site\-url/](https://wordpress.org/support/article/changing-the-site-url/)\. If this has happened to your WordPress installation, you may be able to recover your blog with the procedure below, which uses the wp\-cli command line interface for WordPress\. **To change your WordPress site URL with the wp\-cli** 1. Connect to your EC2 instance with SSH\. 1. Note the old site URL and the new site URL for your instance\. The old site URL is likely the public DNS name for your EC2 instance when you installed WordPress\. The new site URL is the current public DNS name for your EC2 instance\. If you are not sure of your old site URL, you can use curl to find it with the following command\. ``` [ec2-user ~]$ curl localhost | grep wp-content ``` You should see references to your old public DNS name in the output, which will look like this \(old site URL in red\):
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
dbd8977d3a7f-1
``` You should see references to your old public DNS name in the output, which will look like this \(old site URL in red\): ``` <script type='text/javascript' src='http://ec2-52-8-139-223.us-west-1.compute.amazonaws.com/wp-content/themes/twentyfifteen/js/functions.js?ver=20150330'></script> ``` 1. Download the wp\-cli with the following command\. ``` [ec2-user ~]$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` 1. Search and replace the old site URL in your WordPress installation with the following command\. Substitute the old and new site URLs for your EC2 instance and the path to your WordPress installation \(usually `/var/www/html` or `/var/www/html/blog`\)\. ``` [ec2-user ~]$ php wp-cli.phar search-replace 'old_site_url' 'new_site_url' --path=/path/to/wordpress/installation --skip-columns=guid ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
dbd8977d3a7f-2
``` 1. In a web browser, enter the new site URL of your WordPress blog to verify that the site is working properly again\. If it is not, see [https://wordpress\.org/support/article/changing\-the\-site\-url/](https://wordpress.org/support/article/changing-the-site-url/) and [https://wordpress\.org/support/article/how\-to\-install\-wordpress/\#common\-installation\-problems](https://wordpress.org/support/article/how-to-install-wordpress/#common-installation-problems) for more information\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/hosting-wordpress.md
ce9b9af58d82-0
When you launch an instance, it is assigned a hostname that is a form of the private, internal IPv4 address\. A typical Amazon EC2 private DNS name looks something like this: `ip-12-34-56-78.us-west-2.compute.internal`, where the name consists of the internal domain, the service \(in this case, `compute`\), the region, and a form of the private IPv4 address\. Part of this hostname is displayed at the shell prompt when you log into your instance \(for example, `ip-12-34-56-78`\)\. Each time you stop and restart your Amazon EC2 instance \(unless you are using an Elastic IP address\), the public IPv4 address changes, and so does your public DNS name, system hostname, and shell prompt\. **Important** This information applies to Amazon Linux\. For information about other distributions, see their specific documentation\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
97fc108d5abe-0
If you have a public DNS name registered for the IP address of your instance \(such as `webserver.mydomain.com`\), you can set the system hostname so your instance identifies itself as a part of that domain\. This also changes the shell prompt so that it displays the first portion of this name instead of the hostname supplied by AWS \(for example, `ip-12-34-56-78`\)\. If you do not have a public DNS name registered, you can still change the hostname, but the process is a little different\. **To change the system hostname to a public DNS name** Follow this procedure if you already have a public DNS name registered\. 1. + For Amazon Linux 2: Use the hostnamectl command to set your hostname to reflect the fully qualified domain name \(such as **webserver\.mydomain\.com**\)\. ``` [ec2-user ~]$ sudo hostnamectl set-hostname webserver.mydomain.com ``` + For Amazon Linux AMI: On your instance, open the `/etc/sysconfig/network` configuration file in your favorite text editor and change the `HOSTNAME` entry to reflect the fully qualified domain name \(such as **webserver\.mydomain\.com**\)\. ``` HOSTNAME=webserver.mydomain.com ``` 1. Reboot the instance to pick up the new hostname\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
97fc108d5abe-1
HOSTNAME=webserver.mydomain.com ``` 1. Reboot the instance to pick up the new hostname\. ``` [ec2-user ~]$ sudo reboot ``` Alternatively, you can reboot using the Amazon EC2 console \(on the **Instances** page, choose **Actions**, **Instance State**, **Reboot**\)\. 1. Log into your instance and verify that the hostname has been updated\. Your prompt should show the new hostname \(up to the first "\."\) and the hostname command should show the fully\-qualified domain name\. ``` [ec2-user@webserver ~]$ hostname webserver.mydomain.com ``` **To change the system hostname without a public DNS name** 1. + For Amazon Linux 2: Use the hostnamectl command to set your hostname to reflect the desired system hostname \(such as **webserver**\)\. ``` [ec2-user ~]$ sudo hostnamectl set-hostname webserver.localdomain ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
97fc108d5abe-2
[ec2-user ~]$ sudo hostnamectl set-hostname webserver.localdomain ``` + For Amazon Linux AMI: On your instance, open the `/etc/sysconfig/network` configuration file in your favorite text editor and change the `HOSTNAME` entry to reflect the desired system hostname \(such as **webserver**\)\. ``` HOSTNAME=webserver.localdomain ``` 1. Open the `/etc/hosts` file in your favorite text editor and change the entry beginning with **127\.0\.0\.1** to match the example below, substituting your own hostname\. ``` 127.0.0.1 webserver.localdomain webserver localhost4 localhost4.localdomain4 ``` 1. Reboot the instance to pick up the new hostname\. ``` [ec2-user ~]$ sudo reboot ``` Alternatively, you can reboot using the Amazon EC2 console \(on the **Instances** page, choose **Actions**, **Instance State**, **Reboot**\)\. 1. Log into your instance and verify that the hostname has been updated\. Your prompt should show the new hostname \(up to the first "\."\) and the hostname command should show the fully\-qualified domain name\. ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
97fc108d5abe-3
``` [ec2-user@webserver ~]$ hostname webserver.localdomain ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
cb809c5fce35-0
If you do not want to modify the hostname for your instance, but you would like to have a more useful system name \(such as **webserver**\) displayed than the private name supplied by AWS \(for example, `ip-12-34-56-78`\), you can edit the shell prompt configuration files to display your system nickname instead of the hostname\. **To change the shell prompt to a host nickname** 1. Create a file in `/etc/profile.d` that sets the environment variable called `NICKNAME` to the value you want in the shell prompt\. For example, to set the system nickname to **webserver**, run the following command\. ``` [ec2-user ~]$ sudo sh -c 'echo "export NICKNAME=webserver" > /etc/profile.d/prompt.sh' ``` 1. Open the `/etc/bashrc` \(Red Hat\) or `/etc/bash.bashrc` \(Debian/Ubuntu\) file in your favorite text editor \(such as vim or nano\)\. You need to use sudo with the editor command because `/etc/bashrc` and `/etc/bash.bashrc` are owned by `root`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
cb809c5fce35-1
1. Edit the file and change the shell prompt variable \(`PS1`\) to display your nickname instead of the hostname\. Find the following line that sets the shell prompt in `/etc/bashrc` or `/etc/bash.bashrc` \(several surrounding lines are shown below for context; look for the line that starts with `[ "$PS1"`\): ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
10ffc170f7c1-0
shopt -s checkwinsize [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
210da4aad1ee-0
``` Change the `\h` \(the symbol for `hostname`\) in that line to the value of the `NICKNAME` variable\. ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
884758341f93-0
shopt -s checkwinsize [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@$NICKNAME \W]\\$ "
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
40387f5ee22b-0
``` 1. \(Optional\) To set the title on shell windows to the new nickname, complete the following steps\. 1. Create a file named `/etc/sysconfig/bash-prompt-xterm`\. ``` [ec2-user ~]$ sudo touch /etc/sysconfig/bash-prompt-xterm ``` 1. Make the file executable using the following command\. ``` [ec2-user ~]$ sudo chmod +x /etc/sysconfig/bash-prompt-xterm ``` 1. Open the `/etc/sysconfig/bash-prompt-xterm` file in your favorite text editor \(such as vim or nano\)\. You need to use sudo with the editor command because `/etc/sysconfig/bash-prompt-xterm` is owned by `root`\. 1. Add the following line to the file\. ``` echo -ne "\033]0;${USER}@${NICKNAME}:${PWD/#$HOME/~}\007" ``` 1. Log out and then log back in to pick up the new nickname value\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
0bc78673eef2-0
The procedures on this page are intended for use with Amazon Linux only\. For more information about other Linux distributions, see their specific documentation and the following articles: + [How do I assign a static hostname to a private Amazon EC2 instance running RHEL 7 or Centos 7?](https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname-rhel7-centos7/)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-hostname.md
1ee962c1d579-0
You can determine the platform details and billing information associated with an Amazon Machine Image \(AMI\) before you launch an On\-Demand Instance or Spot Instance, or purchase a Reserved Instance\. For Spot Instances, you can use the platform details to confirm that the AMI is supported for Spot Instances\. When purchasing a Reserved Instance, you can make sure that, for **Platform**, you select the correct value that maps to **Platform details** on the AMI\. By knowing the billing information before launching an instance or purchasing a Reserved Instance, you reduce the chance of erroneously launching instances from incorrect AMIs and incurring unplanned costs\. For more information about instance pricing, see [Amazon EC2 pricing](http://aws.amazon.com/ec2/pricing/)\. **Topics** + [AMI billing information fields](#billing-info-fields) + [Platform details and usage operation values](#billing-info) + [Viewing platform details and usage operation values](#view-billing-info) + [Confirm billing information on your bill](#compare-billing-info-on-bill)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
cc15feb85d80-0
The following fields provide billing information associated with an AMI: Platform details The platform details associated with the billing code of the AMI\. For example, `Red Hat Enterprise Linux`\. Usage operation The operation of the Amazon EC2 instance and the billing code that is associated with the AMI\. For example, `RunInstances:0010`\. **Usage operation** corresponds to the [lineitem/Operation](https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation) column on your AWS Cost and Usage Report \(CUR\) and in the [AWS Price List API](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html)\. For the list of **Usage operation** codes, see [Platform details and usage operation values](#billing-info) in the following section\. You can view these fields on the **Instances** or **AMIs** page in the Amazon EC2 console, or in the response that is returned by the [describe\-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) command\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
4832aabcec2a-0
The following table lists the platform details and usage operation values that can be displayed on the **Instances** or **AMIs** page in the Amazon EC2 console, or in the response that is returned by the [describe\-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) command\. **** | Platform details | Usage operation \*\* | | --- | --- | | Linux/UNIX | RunInstances | | Red Hat BYOL Linux | RunInstances:00g0 | | Red Hat Enterprise Linux | RunInstances:0010 | | SQL Server Enterprise | RunInstances:0100 | | SQL Server Standard | RunInstances:0004 | | SQL Server Web | RunInstances:0200 | | SUSE Linux | RunInstances:000g | | Windows | RunInstances:0002 | | Windows BYOL | RunInstances:0800 | | Windows with SQL Server Enterprise \* | RunInstances:0102 | | Windows with SQL Server Standard \* | RunInstances:0006 | | Windows with SQL Server Web \* | RunInstances:0202 | \* If two software licenses are associated with an AMI, the **Platform details** field shows both\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
4832aabcec2a-1
\* If two software licenses are associated with an AMI, the **Platform details** field shows both\. \*\* If you are running Spot Instances, the `[lineitem/Operation](https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation)` on your AWS Cost and Usage Report might be different from the **Usage operation** value that is listed here\. For example, if `[lineitem/Operation](https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation)` displays `RunInstances:0010:SV006`, it means that Amazon EC2 is running Red Hat Enterprise Linux Spot Instance\-hour in US East \(Virginia\) in VPC Zone \#6\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
d4c251dca835-0
You can view the platform details and usage operation values associated with an AMI from the AMI or from the instance\. You can view these values in the Amazon EC2 console or by using the AWS CLI\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
8b320b59e386-0
**To view the platform details and usage operation associated with an AMI \(console\)** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, choose **AMIs**, and then select an AMI\. 1. On the **Details** tab, check the values for **Platform details** and **Usage operation**\. **To view the platform details and usage operation associated with an AMI \(AWS CLI\)** Use the [describe\-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) command\. ``` $ aws ec2 describe-images --image-ids ami-0123456789EXAMPLE ``` The following example output shows the `PlatformDetails` and `UsageOperation` fields\. In this example, the ami\-0123456789EXAMPLE platform is `Red Hat Enterprise Linux` and the usage operation and billing code is `RunInstances:0010`\. ``` { "Images": [ { "VirtualizationType": "hvm", "Description": "Provided by Red Hat, Inc.", "Hypervisor": "xen",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
8b320b59e386-1
"Description": "Provided by Red Hat, Inc.", "Hypervisor": "xen", "EnaSupport": true, "SriovNetSupport": "simple", "ImageId": "ami-0123456789EXAMPLE", "State": "available", "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "SnapshotId": "snap-111222333444aaabb", "DeleteOnTermination": true, "VolumeType": "gp2", "VolumeSize": 10, "Encrypted": false } } ], "Architecture": "x86_64", "ImageLocation": "123456789012/RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2", "RootDeviceType": "ebs", "OwnerId": "123456789012", "PlatformDetails": "Red Hat Enterprise Linux", "UsageOperation": "RunInstances:0010", "RootDeviceName": "/dev/sda1",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
8b320b59e386-2
"UsageOperation": "RunInstances:0010", "RootDeviceName": "/dev/sda1", "CreationDate": "2019-05-10T13:17:12.000Z", "Public": true, "ImageType": "machine", "Name": "RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2" } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
a57a6a261651-0
**To view the platform details and usage operation associated with an AMI \(console\)** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, choose **Instances**, and then select an instance\. 1. On the **Details** tab, check the values for **Platform details** and **Usage operation**\. **To view the platform details and usage operation associated with an AMI \(console\)** After you have launched an instance, you can find the billing information by inspecting the `billingProducts` field in the instance metadata\. For more information, see [Instance identity documents](instance-identity-documents.md)\. Alternatively, you can use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command to obtain the AMI ID for the instance, and then use the [describe\-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) command, as described in the preceding procedure, to obtain the billing information from the `PlatformDetails` and `UsageOperation` fields in the response\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
386edfe58895-0
To ensure that you're not incurring unplanned costs, you can confirm that the billing information for an instance in your AWS Cost and Usage Report \(CUR\) matches the billing information associated with the AMI that you used to launch the instance\. To confirm the billing information, find the instance ID in your CUR and check the corresponding value in the `[lineitem/Operation](https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation)` column\. The value should match the value for **Usage operation** associated with the AMI\. For example, the AMI, `ami-0123456789EXAMPLE`, has the following billing information: **Platform details** = `Red Hat Enterprise Linux` and **Usage operation** = `RunInstances:0010`\. If you launched an instance using this AMI, you can find the instance ID in your CUR and check the corresponding value in the `[lineitem/Operation](https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation)` column\. In this example, the value should be `RunInstances:0010`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ami-billing-info.md
71c029c9c306-0
The EBS direct APIs service is integrated with AWS CloudTrail\. CloudTrail is a service that provides a record of actions taken by a user, role, or an AWS service in the EBS direct APIs\. CloudTrail captures [StartSnapshot](https://docs.aws.amazon.com/ebs/latest/APIReference/API_StartSnapshot.html) and [ CompleteSnapshot](https://docs.aws.amazon.com/ebs/latest/APIReference/API_CompleteSnapshot.html) API calls for the EBS direct APIs as events\. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon Simple Storage Service \(Amazon S3\) bucket, including events for the EBS direct APIs\. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**\. You can use the information collected by CloudTrail to determine the request that was made to the EBS direct APIs, the IP address from which the request was made, who made the request, when it was made, and additional details\. For more information about CloudTrail, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
2ac2b5077d32-0
CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in the EBS direct APIs, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing Events with CloudTrail Event History](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)\. For an ongoing record of events in your AWS account, including events for the EBS direct APIs, create a trail\. A *trail* enables CloudTrail to deliver log files to an S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. For more information, see the following: + [Overview for Creating a Trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) + [CloudTrail Supported Services and Integrations](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
2ac2b5077d32-1
+ [Configuring Amazon SNS Notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html) + [Receiving CloudTrail Log Files from Multiple Regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail Log Files from Multiple Accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
41fb922139a0-0
The following API actions support logging as events in CloudTrail log files: + [StartSnapshot](https://docs.aws.amazon.com/ebs/latest/APIReference/API_StartSnapshot.html) + [CompleteSnapshot](https://docs.aws.amazon.com/ebs/latest/APIReference/API_CompleteSnapshot.html)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
7e7b064d6f22-0
Every event or log entry contains information about who generated the request\. The identity information helps you determine the following: + Whether the request was made with root or AWS Identity and Access Management \(IAM\) user credentials\. + Whether the request was made with temporary security credentials for a role or federated user\. + Whether the request was made by another AWS service\. For more information, see the [ CloudTrail userIdentityElement](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
da0c351b72d7-0
A trail is a configuration that enables delivery of events as log files to an S3 bucket that you specify\. CloudTrail log files contain one or more log entries\. An event represents a single request from any source and includes information about the requested action, the date and time of the action, request parameters, and so on\. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order\. The following examples show CloudTrail log entries that demonstrates the `StartSnapshot` and `CompleteSnapshot` actions\. StartSnapshot example: ``` { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "userName": "user" }, "eventTime": "2020-07-03T23:27:26Z", "eventSource": "ebs.amazonaws.com", "eventName": "StartSnapshot", "awsRegion": "eu-west-1",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
da0c351b72d7-1
"eventName": "StartSnapshot", "awsRegion": "eu-west-1", "sourceIPAddress": "192.0.2.0", "userAgent": "PostmanRuntime/7.25.0", "requestParameters": { "volumeSize": 8, "clientToken": "token", "encrypted": true }, "responseElements": { "snapshotId": "snap-123456789012", "ownerId": "123456789012", "status": "pending", "startTime": "Jul 3, 2020 11:27:26 PM", "volumeSize": 8, "blockSize": 524288, "kmsKeyArn": "HIDDEN_DUE_TO_SECURITY_REASONS" }, "requestID": "be112233-1ba5-4ae0-8e2b-1c302EXAMPLE", "eventID": "6e12345-2a4e-417c-aa78-7594fEXAMPLE", "eventType": "AwsApiCall", "recipientAccountId": "123456789012" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
da0c351b72d7-2
"recipientAccountId": "123456789012" } ``` CompleteSnapshot example: ``` { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "userName": "user" }, "eventTime": "2020-07-03T23:28:24Z", "eventSource": "ebs.amazonaws.com", "eventName": "CompleteSnapshot", "awsRegion": "eu-west-1", "sourceIPAddress": "192.0.2.0", "userAgent": "PostmanRuntime/7.25.0", "requestParameters": { "snapshotId": "snap-123456789012", "changedBlocksCount": 5 }, "responseElements": {
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
da0c351b72d7-3
"changedBlocksCount": 5 }, "responseElements": { "status": "completed" }, "requestID": "be112233-1ba5-4ae0-8e2b-1c302EXAMPLE", "eventID": "6e12345-2a4e-417c-aa78-7594fEXAMPLE", "eventType": "AwsApiCall", "recipientAccountId": "123456789012" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/logging-ebs-apis-using-cloudtrail.md
2a52b107aa13-0
To disable EC2 Instance Connect, connect to your instance and uninstall the `ec2-instance-connect` package that you installed on the OS\. If the `sshd` configuration matches what it was set to when you installed EC2 Instance Connect, uninstalling `ec2-instance-connect` also removes the `sshd` configuration\. If you modified the `sshd` configuration after installing EC2 Instance Connect, you must update it manually\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-connect-uninstall.md
4cf90256c71a-0
You can uninstall EC2 Instance Connect on Amazon Linux 2 2\.0\.20190618 or later, where EC2 Instance Connect is preconfigured\. **To uninstall EC2 Instance Connect on an instance launched with Amazon Linux 2** 1. Connect to your instance using SSH\. Specify the SSH key pair you used for your instance when you launched it and the default user name for the Amazon Linux 2 AMI, which is `ec2-user`\. For example, the following ssh command connects to the instance with the public DNS name `ec2-a-b-c-d.us-west-2.compute.amazonaws.com`, using the key pair `my_ec2_private_key.pem`\. ``` $ ssh -i my_ec2_private_key.pem [email protected] ``` 1. Uninstall the `ec2-instance-connect` package using the yum command\. ``` [ec2-user ~]$ sudo yum remove ec2-instance-connect ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-connect-uninstall.md
9326fad9be7c-0
**To uninstall EC2 Instance Connect on an instance launched with an Ubuntu AMI** 1. Connect to your instance using SSH\. Specify the SSH key pair you used for your instance when you launched it and the default user name for the Ubuntu AMI, which is `ubuntu`\. For example, the following ssh command connects to the instance with the public DNS name `ec2-a-b-c-d.us-west-2.compute.amazonaws.com`, using the key pair `my_ec2_private_key.pem`\. ``` $ ssh -i my_ec2_private_key.pem [email protected] ``` 1. Uninstall the `ec2-instance-connect` package using the apt\-get command\. ``` ubuntu:~$ sudo apt-get remove ec2-instance-connect ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-connect-uninstall.md
197f967d0c18-0
**Topics** + [Get information about your instance](#connection-prereqs-get-info-about-instance) + [Enable inbound traffic to your instance](#connection-prereqs-enable-inbound-traffic) + [Locate the private key](#connection-prereqs-private-key) + [\(Optional\) Get the instance fingerprint](#connection-prereqs-fingerprint)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
6b6080e0ca30-0
+ **Get the ID of the instance\.** You can get the ID of your instance using the Amazon EC2 console \(from the **Instance ID** column\)\. If you prefer, you can use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) \(AWS CLI\) or [Get\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) \(AWS Tools for Windows PowerShell\) command\. + **Get the public DNS name of the instance\.** You can get the public DNS for your instance using the Amazon EC2 console\. Check the **Public DNS \(IPv4\)** column\. If this column is hidden, choose the **Show/Hide Columns** icon in the top\-right corner of the screen and select **Public DNS \(IPv4\)**\. If you prefer, you can use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) \(AWS CLI\) or [Get\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) \(AWS Tools for Windows PowerShell\) command\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
6b6080e0ca30-1
+ **\(IPv6 only\) Get the IPv6 address of the instance\.** If you've assigned an IPv6 address to your instance, you can optionally connect to the instance using its IPv6 address instead of a public IPv4 address or public IPv4 DNS hostname\. Your local computer must have an IPv6 address and must be configured to use IPv6\. You can get the IPv6 address of your instance using the Amazon EC2 console\. Check the **IPv6 IPs** field\. If you prefer, you can use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) \(AWS CLI\) or [Get\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) \(AWS Tools for Windows PowerShell\) command\. For more information about IPv6, see [IPv6 addresses](using-instance-addressing.md#ipv6-addressing)\. + **Get the user name for your instance\.** You can connect to your instance using the user name for your user account or the default user name for the AMI that you used to launch your instance\. + **Get the user name for your user account\.** For more information about how to create a user account, see [Managing user accounts on your Amazon Linux instance](managing-users.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
6b6080e0ca30-2
For more information about how to create a user account, see [Managing user accounts on your Amazon Linux instance](managing-users.md)\. + **Get the default user name for the AMI that you used to launch your instance:** + For Amazon Linux 2 or the Amazon Linux AMI, the user name is `ec2-user`\. + For a CentOS AMI, the user name is `centos`\. + For a Debian AMI, the user name is `admin`\. + For a Fedora AMI, the user name is `ec2-user` or `fedora`\. + For a RHEL AMI, the user name is `ec2-user` or `root`\. + For a SUSE AMI, the user name is `ec2-user` or `root`\. + For an Ubuntu AMI, the user name is `ubuntu`\. + Otherwise, if `ec2-user` and `root` don't work, check with the AMI provider\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
9ba0dec8dbf2-0
+ **Enable inbound SSH traffic from your IP address to your instance\.** Ensure that the security group associated with your instance allows incoming SSH traffic from your IP address\. The default security group for the VPC does not allow incoming SSH traffic by default\. The security group created by the launch instance wizard enables SSH traffic by default\. For more information, see [Authorizing inbound traffic for your Linux instances](authorizing-access-to-an-instance.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
829b238423f0-0
+ **Locate the private key** Get the fully\-qualified path to the location on your computer of the `.pem` file for the key pair that you specified when you launched the instance\. For more information about how you created your key pair, see [Creating a Key Pair Using Amazon EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#having-ec2-create-your-key-pair)\. + **Set the permissions of your private key** If you will use an SSH client on a macOS or Linux computer to connect to your Linux instance, use the following command to set the permissions of your private key file so that only you can read it\. ``` chmod 400 my-key-pair.pem ``` If you do not set these permissions, then you cannot connect to your instance using this key pair\. For more information, see [Error: Unprotected private key file](TroubleshootingInstancesConnecting.md#troubleshoot-unprotected-key)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
b3cbfdd88569-0
To protect yourself from man\-in\-the\-middle attacks, you can verify the RSA key fingerprint when you connect to your instance\. Verifying the fingerprint is useful if you've launched your instance from a public AMI from a third party\. First you get the instance fingerprint\. Then, when you connect to the instance, you are prompted to verify the fingerprint\. You can compare the fingerprint you obtained with the fingerprint displayed for verification\. If these fingerprints don't match, someone might be attempting a "man\-in\-the\-middle" attack\. If they match, you can confidently connect to your instance\. **Prerequisites for getting the instance fingerprint:** + To get the instance fingerprint, you must use the AWS CLI\. For information about installing the AWS CLI, see [Installing the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html) in the *AWS Command Line Interface User Guide*\. + The instance must not be in the `pending` state\. The fingerprint is available only after the first boot of the instance is complete\. **To get the instance fingerprint** 1. On your local computer \(not on the instance\), use the [get\-console\-output](https://docs.aws.amazon.com/cli/latest/reference/ec2/get-console-output.html) \(AWS CLI\) command as follows to obtain the fingerprint: ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
b3cbfdd88569-1
``` aws ec2 get-console-output --instance-id instance_id --output text ``` 1. Here is an example of what you should look for in the output\. The exact output can vary by the operating system, AMI version, and whether you had AWS create the key\. ``` ec2: ############################################################# ec2: -----BEGIN SSH HOST KEY FINGERPRINTS----- ec2: 1024 SHA256:7HItIgTONZ/b0CH9c5Dq1ijgqQ6kFn86uQhQ5E/F9pU root@ip-10-0-2-182 (DSA) ec2: 256 SHA256:l4UB/neBad9tvkgJf1QZWxheQmR59WgrgzEimCG6kZY root@ip-10-0-2-182 (ECDSA) ec2: 256 SHA256:kpEa+rw/Uq3zxaYZN8KT501iBtJOIdHG52dFi66EEfQ no comment (ED25519)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
b3cbfdd88569-2
ec2: 2048 SHA256:L8l6pepcA7iqW/jBecQjVZClUrKY+o2cHLI0iHerbVc root@ip-10-0-2-182 (RSA) ec2: -----END SSH HOST KEY FINGERPRINTS----- ec2: ############################################################# ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/connection-prereqs.md
eb45db1bfb46-0
Empty EBS volumes receive their maximum performance the moment that they are created and do not require initialization \(formerly known as pre\-warming\)\. For volumes that were created from snapshots, the storage blocks must be pulled down from Amazon S3 and written to the volume before you can access them\. This preliminary action takes time and can cause a significant increase in the latency of I/O operations the first time each block is accessed\. Volume performance is achieved after all blocks have been downloaded and written to the volume\. **Important** While initializing `io1` and `io2` volumes that were created from snapshots, the performance of the volume may drop below 50 percent of its expected level, which causes the volume to display a `warning` state in the **I/O Performance** status check\. This is expected, and you can ignore the `warning` state on `io1` and `io2` volumes while you are initializing them\. For more information, see [EBS volume status checks](monitoring-volume-status.md#monitoring-volume-checks)\. For most applications, amortizing the initialization cost over the lifetime of the volume is acceptable\. To avoid this initial performance hit in a production environment, you can use one of the following options: + Force the immediate initialization of the entire volume\. For more information, see [Initializing Amazon EBS volumes on Linux](#ebs-initialize-linux)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-initialize.md
eb45db1bfb46-1
+ Enable fast snapshot restore on a snapshot to ensure that the EBS volumes created from it are fully\-initialized at creation and instantly deliver all of their provisioned performance\. For more information, see [Amazon EBS fast snapshot restore](ebs-fast-snapshot-restore.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-initialize.md
51b9222ab4a2-0
Empty EBS volumes receive their maximum performance the moment that they are available and do not require initialization \(formerly known as pre\-warming\)\. For volumes that have been created from snapshots, use the dd or fio utilities to read from all of the blocks on a volume\. All existing data on the volume will be preserved\. For information about initializing Amazon EBS volumes on Windows, see [Initializing Amazon EBS volumes on Windows](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-initialize.html#ebs-initialize-windows)\. **To initialize a volume created from a snapshot on Linux** 1. Attach the newly\-restored volume to your Linux instance\. 1. Use the lsblk command to list the block devices on your instance\. ``` [ec2-user ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvdf 202:80 0 30G 0 disk xvda1 202:1 0 8G 0 disk / ``` Here you can see that the new volume, `/dev/xvdf`, is attached, but not mounted \(because there is no path listed under the `MOUNTPOINT` column\)\. 1. <a name="initialize-snapshot-step"></a>Use the dd or fio utilities to read all of the blocks on the device\. The dd command is installed by default on Linux systems, but fio is considerably faster because it allows multi\-threaded reads\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-initialize.md
51b9222ab4a2-1
**Note** This step may take several minutes up to several hours, depending on your EC2 instance bandwidth, the IOPS provisioned for the volume, and the size of the volume\. \[dd\] The `if` \(input file\) parameter should be set to the drive you wish to initialize\. The `of` \(output file\) parameter should be set to the Linux null virtual device, `/dev/null`\. The `bs` parameter sets the block size of the read operation; for optimal performance, this should be set to 1 MB\. **Important** Incorrect use of dd can easily destroy a volume's data\. Be sure to follow precisely the example command below\. Only the `if=/dev/xvdf` parameter will vary depending on the name of the device you are reading\. ``` [ec2-user ~]$ sudo dd if=/dev/xvdf of=/dev/null bs=1M ``` \[fio\] If you have fio installed on your system, use the following command to initialize your volume\. The `--filename` \(input file\) parameter should be set to the drive you wish to initialize\. ``` [ec2-user ~]$ sudo fio --filename=/dev/xvdf --rw=read --bs=128k --iodepth=32 --ioengine=libaio --direct=1 --name=volume-initialize ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-initialize.md
51b9222ab4a2-2
``` To install fio on Amazon Linux, use the following command: ``` sudo yum install -y fio ``` To install fio on Ubuntu, use the following command: ``` sudo apt-get install -y fio ``` When the operation is finished, you will see a report of the read operation\. Your volume is now ready for use\. For more information, see [Making an Amazon EBS volume available for use on Linux](ebs-using-volumes.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-initialize.md
c4a2b659b67e-0
You can create a *launch template* that contains the configuration information to launch an instance\. Launch templates enable you to store launch parameters so that you do not have to specify them every time you launch an instance\. For example, a launch template can contain the AMI ID, instance type, and network settings that you typically use to launch instances\. When you launch an instance using the Amazon EC2 console, an AWS SDK, or a command line tool, you can specify the launch template to use\. For each launch template, you can create one or more numbered *launch template versions*\. Each version can have different launch parameters\. When you launch an instance from a launch template, you can use any version of the launch template\. If you do not specify a version, the default version is used\. You can set any version of the launch template as the default version—by default, it's the first version of the launch template\. The following diagram shows a launch template with three versions\. The first version specifies the instance type, AMI ID, subnet, and key pair to use to launch the instance\. The second version is based on the first version and also specifies a security group for the instance\. The third version uses different values for some of the parameters\. Version 2 is set as the default version\. If you launched an instance from this launch template, the launch parameters from version 2 would be used if no other version were specified\. ![\[Launch template\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/launch-template-diagram.png) **Topics** + [Launch template restrictions](#launch-template-restrictions)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
c4a2b659b67e-1
**Topics** + [Launch template restrictions](#launch-template-restrictions) + [Using launch templates to control launch parameters](#launch-templates-authorization) + [Controlling the use of launch templates](#launch-template-permissions) + [Creating a launch template](#create-launch-template) + [Managing launch template versions](#manage-launch-template-versions) + [Launching an instance from a launch template](#launch-instance-from-launch-template) + [Using launch templates with Amazon EC2 Auto Scaling](#launch-templates-as) + [Using launch templates with EC2 Fleet](#launch-templates-ec2-fleet) + [Using launch templates with Spot Fleet](#launch-templates-spot-fleet) + [Deleting a launch template](#delete-launch-template)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
81fc2e25f52c-0
The following rules apply to launch templates and launch template versions: + You are limited to creating 5,000 launch templates per Region and 10,000 versions per launch template\. + Launch template parameters are optional\. However, you must ensure that your request to launch an instance includes all required parameters\. For example, if your launch template does not include an AMI ID, you must specify both the launch template and an AMI ID when you launch an instance\. + Launch template parameters are not fully validated when you create the launch template\. If you specify incorrect values for parameters, or if you do not use supported parameter combinations, no instances can launch using this launch template\. Ensure that you specify the correct values for the parameters and that you use supported parameter combinations\. For example, to launch an instance in a placement group, you must specify a supported instance type\. + You can tag a launch template, but you cannot tag a launch template version\. + Launch template versions are numbered in the order in which they are created\. When you create a launch template version, you cannot specify the version number yourself\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
b8dd64034e2b-0
A launch template can contain all or some of the parameters to launch an instance\. When you launch an instance using a launch template, you can override parameters that are specified in the launch template\. Or, you can specify additional parameters that are not in the launch template\. **Note** You cannot remove launch template parameters during launch \(for example, you cannot specify a null value for the parameter\)\. To remove a parameter, create a new version of the launch template without the parameter and use that version to launch the instance\. To launch instances, IAM users must have permissions to use the `ec2:RunInstances` action\. You must also have permissions to create or use the resources that are created or associated with the instance\. You can use resource\-level permissions for the `ec2:RunInstances` action to control the launch parameters that users can specify\. Alternatively, you can grant users permissions to launch an instance using a launch template\. This enables you to manage launch parameters in a launch template rather than in an IAM policy, and to use a launch template as an authorization vehicle for launching instances\. For example, you can specify that users can only launch instances using a launch template, and that they can only use a specific launch template\. You can also control the launch parameters that users can override in the launch template\. For example policies, see [Launch templates](ExamplePolicies_EC2.md#iam-example-runinstances-launch-templates)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
11c1c2521383-0
By default, IAM users do not have permissions to work with launch templates\. You can create an IAM user policy that grants users permissions to create, modify, describe, and delete launch templates and launch template versions\. You can also apply resource\-level permissions to some launch template actions to control a user's ability to use specific resources for those actions\. For more information, see the following example policies: [Example: Working with launch templates](ExamplePolicies_EC2.md#iam-example-launch-templates)\. Take care when granting users permissions to use the `ec2:CreateLaunchTemplate` and `ec2:CreateLaunchTemplateVersion` actions\. You cannot use resource\-level permissions to control which resources users can specify in the launch template\. To restrict the resources that are used to launch an instance, ensure that you grant permissions to create launch templates and launch template versions only to appropriate administrators\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
d8df923ce3fc-0
Create a new launch template using parameters that you define, or use an existing launch template or an instance as the basis for a new launch template\. **Topics** + [Creating a new launch template using parameters you define](#create-launch-template-define-parameters) + [Creating a launch template from an existing launch template](#create-launch-template-from-existing-launch-template) + [Creating a launch template from an instance](#create-launch-template-from-instance)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
bce155633b5b-0
------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-0
**To create a new launch template using defined parameters using the console** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, choose **Launch Templates**, and then choose **Create launch template**\. 1. For **Launch template name**, enter a descriptive name for the launch template\. 1. For **Template version description**, provide a brief description of the launch template version\. 1. To tag the launch template on creation, expand **Template tags**, choose **Add tag**, and then enter a tag key and value pair\. 1. For **Launch template contents**, provide the following information: + **AMI**: An AMI from which to launch the instance\. To search through all available AMIs, choose **Search for AMI**\. To select a commonly used AMI, choose **Quick Start**\. Or, choose **AWS Marketplace** or **Community AMIs**\. You can use an AMI that you own or [find a suitable AMI](finding-an-ami.md)\. + **Instance type**: Ensure that the instance type is compatible with the AMI that you've specified\. For more information, see [Instance types](instance-types.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-1
+ **Key pair name**: The key pair for the instance\. For more information, see [Amazon EC2 key pairs and Linux instances](ec2-key-pairs.md)\. + **Network platform**: If applicable, whether to launch the instance into a VPC or EC2\-Classic\. If you choose **VPC**, specify the subnet in the **Network interfaces** section\. If you choose **Classic**, ensure that the specified instance type is supported in EC2\-Classic and specify the Availability Zone for the instance\. + **Security groups**: One or more security groups to associate with the instance\. If you add a network interface to the launch template, omit this setting and specify the security groups as part of the network interface specification\. You cannot launch an instance from a launch template that specifies security groups and a network interface\. For more information, see [Amazon EC2 security groups for Linux instances](ec2-security-groups.md)\. 1. For **Storage \(volumes\)**, specify volumes to attach to the instance besides the volumes specified by the AMI \(**Volume 1 \(AMI Root\)**\)\. To add a new volume, choose **Add new volume**\. + **Volume type**: The instance store or Amazon EBS volumes with which to associate your instance\. The type of volume depends on the instance type that you've chosen\. For more information, see [Amazon EC2 instance store](InstanceStorage.md) and [Amazon EBS volumes](ebs-volumes.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-2
+ **Device name**: A device name for the volume\. + **Snapshot**: The ID of the snapshot from which to create the volume\. + **Size**: For Amazon EBS volumes, the storage size\. + **Volume type**: For Amazon EBS volumes, the volume type\. For more information, see [Amazon EBS volume types](ebs-volume-types.md)\. + **IOPS**: For the Provisioned IOPS SSD volume type, the number of I/O operations per second \(IOPS\) that the volume can support\. + **Delete on termination**: For Amazon EBS volumes, whether to delete the volume when the instance is terminated\. For more information, see [Preserving Amazon EBS volumes on instance termination](terminating-instances.md#preserving-volumes-on-termination)\. + **Encrypted**: If the instance type supports EBS encryption, you can enable encryption for the volume\. If you have enabled encryption by default in this Region, encryption is enabled for you\. For more information, see [Amazon EBS encryption](EBSEncryption.md)\. + **Key**: The CMK to use for EBS encryption\. You can specify the ARN of any customer master key \(CMK\) that you created using the AWS Key Management Service\. If you specify a CMK, you must also use **Encrypted** to enable encryption\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-3
1. For **Resource tags**, specify [tags](Using_Tags.md) by providing key and value combinations\. You can tag the instance, the volumes, Spot Instance requests, or all three\. 1. For **Network interfaces**, you can specify up to two [network interfaces](using-eni.md) for the instance\. + **Device index**: The device number for the network interface, for example, `eth0` for the primary network interface\. If you leave the field blank, AWS creates the primary network interface\. + **Network interface**: The ID of the network interface, or leave blank to let AWS create a new network interface\. + **Description**: \(Optional\) A description for the new network interface\. + **Subnet**: The subnet in which to create a new network interface\. For the primary network interface \(`eth0`\), this is the subnet in which the instance is launched\. If you've entered an existing network interface for `eth0`, the instance is launched in the subnet in which the network interface is located\. + **Auto\-assign public IP**: Whether to automatically assign a public IP address to the network interface with the device index of `eth0`\. This setting can only be enabled for a single, new network interface\. + **Primary IP**: A private IPv4 address from the range of your subnet\. Leave blank to let AWS choose a private IPv4 address for you\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-4
+ **Secondary IP**: A secondary private IPv4 address from the range of your subnet\. Leave blank to let AWS choose one for you\. + \(IPv6\-only\) **IPv6 IPs**: An IPv6 address from the range of the subnet\. + **Security groups**: One or more security groups in your VPC with which to associate the network interface\. + **Delete on termination**: Whether the network interface is deleted when the instance is deleted\. + **Elastic Fabric Adapter**: Indicates whether the network interface is an Elastic Fabric Adapter\. For more information, see [ Elastic Fabric Adapter](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html)\. 1. For **Advanced details**, expand the section to view the fields and specify any additional parameters for the instance\. + **Purchasing option**: The purchasing model\. Choose **Request Spot Instances** to request Spot Instances at the Spot price, capped at the On\-Demand price, and choose **Customize** to change the default Spot Instance settings\. If you do not request a Spot Instance, EC2 launches an On\-Demand Instance by default\. For more information, see [Spot Instances](using-spot-instances.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-5
+ **IAM instance profile**: An AWS Identity and Access Management \(IAM\) instance profile to associate with the instance\. For more information, see [IAM roles for Amazon EC2](iam-roles-for-amazon-ec2.md)\. + **Shutdown behavior**: Whether the instance should stop or terminate when shut down\. For more information, see [Changing the instance initiated shutdown behavior](terminating-instances.md#Using_ChangingInstanceInitiatedShutdownBehavior)\. + **Stop \- Hibernate behavior**: Whether the instance is enabled for hibernation\. This field is only valid for instances that meet the hibernation prerequisites\. For more information, see [Hibernate your Linux instance](Hibernate.md)\. + **Termination protection**: Whether to prevent accidental termination\. For more information, see [Enabling termination protection](terminating-instances.md#Using_ChangingDisableAPITermination)\. + **Detailed CloudWatch monitoring**: Whether to enable detailed monitoring of the instance using Amazon CloudWatch\. Additional charges apply\. For more information, see [Monitoring your instances using CloudWatch](using-cloudwatch.md)\. + **Elastic inference**: An elastic inference accelerator to attach to your EC2 CPU instance\. For more information, see [Working with Amazon Elastic Inference](https://docs.aws.amazon.com/elastic-inference/latest/developerguide/working-with-ei.html) in the *Amazon Elastic Inference Developer Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-6
+ **T2/T3 Unlimited**: Whether to enable applications to burst beyond the baseline for as long as needed\. This field is only valid for T2, T3, and T3a instances\. Additional charges may apply\. For more information, see [Burstable performance instances](burstable-performance-instances.md)\. + **Placement group name**: Specify a placement group in which to launch the instance\. Not all instance types can be launched in a placement group\. For more information, see [Placement groups](placement-groups.md)\. + **EBS\-optimized instance**: Provides additional, dedicated capacity for Amazon EBS I/O\. Not all instance types support this feature, and additional charges apply\. For more information, see [Amazon EBS–optimized instances](ebs-optimized.md)\. + **Capacity Reservation**: Specify whether to launch the instance into shared capacity, any `open` Capacity Reservation, a specific Capacity Reservation, or a Capacity Reservation group\. For more information, see [Launching instances into an existing Capacity Reservation](capacity-reservations-using.md#capacity-reservations-launch)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-7
+ **Tenancy**: Choose whether to run your instance on shared hardware \(**Shared**\), isolated, dedicated hardware \(**Dedicated**\), or on a Dedicated Host \(**Dedicated host**\)\. If you choose to launch the instance onto a Dedicated Host, you can specify whether to launch the instance into a host resource group or you can target a specific Dedicated Host\. Additional charges may apply\. For more information, see [Dedicated Instances](dedicated-instance.md) and [Dedicated Hosts](dedicated-hosts-overview.md)\. + **RAM disk ID**: \(Only valid for paravirtual \(PV\) AMIs\) A RAM disk for the instance\. If you have specified a kernel, you may need to specify a specific RAM disk with the drivers to support it\. + **Kernel ID**: \(Only valid for paravirtual \(PV\) AMIs\) A kernel for the instance\. + **License configurations**: You can launch instances against the specified license configuration to track your license usage\. For more information, see [Create a License Configuration](https://docs.aws.amazon.com/license-manager/latest/userguide/create-license-configuration.html) in the *AWS License Manager User Guide*\. + **Metadata accessible**: Whether to enable or disable access to the instance metadata\. For more information, see [Configuring the instance metadata service](configuring-instance-metadata-service.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md
612365599d19-8
+ **Metadata version**: If you enable access to the instance metadata, you can choose to require the use of Instance Metadata Service Version 2 when requesting instance metadata\. For more information, see [Configuring instance metadata options for new instances](configuring-instance-metadata-service.md#configuring-IMDS-new-instances)\. + **Metadata response hop limit**: If you enable instance metadata, you can set the allowable number of network hops for the metadata token\. For more information, see [Configuring the instance metadata service](configuring-instance-metadata-service.md)\. + **User data**: You can specify user data to configure an instance during launch, or to run a configuration script\. For more information, see [Running commands on your Linux instance at launch](user-data.md)\. 1. Choose **Create launch template**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-launch-templates.md