Terraform: Difference between revisions
→Provision AWS EC2 Cloud Instance
(Page Created) |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1:
[[Category:Scripting]]
__TOC__
<br />
= Installation =
Install unzip
Line 16 ⟶ 19:
Run it
terraform --version
= Provision AWS EC2 Cloud Instance =
Source: [https://linoxide.com/devops/install-terraform-provision-aws-ec2-instance/ linoxide.com]
Create EC2 user under:
IAM > Users > Add User
click only "Programmatic access".
Create Group: filter by keyword AmazonEC2, Select AmazonEC2FullAccess.
Download .csv file
Initialise Terraform:
mkdir terraform
cd terraform/
terraform init
nano aws.tf
<pre>
provider "aws" {
access_key = "AKIAJTS6BwYereLDFVNWA"
secret_key = "lWjjHcTnadsEAmgh/fFYpQmSFUCUsy9Twvdd5122vY"
region = "us-west-2"
}
resource "aws_instance" "ubuntu-instance" {
ami = "ami-23b34343"
instance_type = "t2.micro"
tags {
Name = "my-terraform-ubuntu-instance"
}
}
</pre>
Provision the instance:
terraform plan
terraform apply
Check the instance:
terraform show
Remove the Instance:
terraform destroy
<br />
;References
<references/>
<br />
<br />
<br />
{{DISQUS}}
|