DevOps(Day-84): Terraform with AWS - Part2
TABLE OF CONTENTS
Task-01: Provision an AWS EC2 instance using Terraform
Task-01: Provision an AWS EC2 instance using Terraform
- Provision an AWS EC2 instance using Terraform.
Create a resource in terraform file to spin the servers in AWS.
Count: It specifies the number of EC2 instances to be created.
ami: Amazon Machine Image is the ami of the operating system that needs to be flavoured for the instances.
Instance_type: It specifies the CPU and storage configurations of EC2 instances.
VPC_security_group_ids: We can specify the security group our instances are in, otherwise this will assign by default by creating a new security group.
Connection: This block contains the type of connection to be made to the servers, which user to be allowed as a root user, and the private key having access to login to the servers.
tags: this will assign the new names to the AWS EC2 instance.
Initialise the terraform in the servers to download the required providers.
View the plan of Terraform to check the servers spin up with given configurations.
Now, apply the terraform file to create the servers.
Finally, let's check the console. We can see two servers Server-1 and Server-2 are created.
Thanks for reading my article. Have a nice day.
Comments
Post a Comment