Skip to content

Commit 0adaeb2

Browse files
committed
add terraform conf
1 parent a839a24 commit 0adaeb2

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
1. [KVM](#kvm)
1010
1. [AutoBackupMySQL](/autobackupmysql.sh)
1111
1. [Rsnapshot](rsnapshot.conf)
12+
1. [Terraform](#terraform)
1213
1. [Teleconsole](#teleconsole)
1314

1415

@@ -47,6 +48,12 @@
4748
* [Stop all running vms](/kvm/vms-stop.sh)
4849

4950

51+
#### <a name='terraform'>Terraform examples:</a>
52+
53+
* [Terraform test GCP](/terraform/googleStart.tf)
54+
* [Terraform test AWS](/terraform/awsStart.tf)
55+
56+
5057
#### [[]](#toc) <a name='teleconsole'>Teleconsole - terminal sharing:</a>
5158
```bash
5259
#install:

terraform/awsStart.tf

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = ""
5+
version = "~> 3.27"
6+
}
7+
}
8+
9+
required_version = ">= 0.14.9"
10+
}
11+
12+
provider "aws" {
13+
profile = "default"
14+
region = "us-west-2"
15+
}
16+
17+
resource "aws_instance" "app_server" {
18+
ami = "ami-03d5c68bab01f3496"
19+
instance_type = "t2.micro"
20+
21+
tags = {
22+
Name = "Ubuntu20Test"
23+
}
24+
}

terraform/googleStart.tf

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Configure the Google Cloud provider
2+
provider "google" {
3+
credentials = file("terraform2-sa.json")
4+
project = "terraform2-302514"
5+
region = "us-west1"
6+
zone = "us-west1-a"
7+
}
8+
9+
resource "google_compute_instance" "vm_instance" {
10+
name = "terraform2"
11+
machine_type = "f1-micro"
12+
13+
boot_disk {
14+
initialize_params {
15+
image = "debian-cloud/debian-9"
16+
}
17+
}
18+
19+
network_interface {
20+
# A default network is created for all GCP projects
21+
network = "default"
22+
}
23+
}

0 commit comments

Comments
 (0)