50%

🚀

AWS Terraform

Terraform + AWS

5

, AWS (Amazon Web Services) IaaS, Terraform. , , AWS ( ) Terraform, Atom + Terraform.

Merion Academy


. CentOS. .

, .

sudo mkdir terraform	

. , sudo touch myterr.tf. , . , .

: , , , , .

, AWS, , access key secret key, . Terraform AWS .

AWS IAM. . . Programmatic ccess. . AWS . Tag, , . .

Add User

.

, Terraform.

- Secret key !

AWS.

.

provider aws {
}	

. YAML, . access key secret key. . eu-central-1 . , , .

provider aws {
	access_key =   
	secret key =   
	region = eu-central-1
}	

Ctrl+S, , .

. , . :

resource aws_instance my_ {
	ami = 
	instance_type = 
}	

2 . ami image id instance_type. , EC2 ami .

ami t2.micro. . .

. Terraform :

provider aws {
	access_key =   
	secret key =   
	region = eu-central-1
}
resource aws_instance TestUbuntu {
	ami = ami-0767046d1677be5a0
	instance_type = t2.micro
}	

, Terraform.

, access_key secret_key, , . . export.

export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=	

2 .

Terraform. , terraform init, tf , , . Terraform , , .

terraform init

, terraform plan, , Terraform . . Whatif. . , , . , .

terraform plan

, . . , deploy, Terraform 1 instance, . 1 , .

deploy, terraform apply, Terraform , yes .

. .

.

.


>