Skip to content

Commit

Permalink
[SCRIPTS][Terraform]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Feb 24, 2024
1 parent 094f51a commit af7bd86
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
37 changes: 37 additions & 0 deletions scripts/hive3.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
provider "aws" {
region = "us-west-2"
}

resource "aws_instance" "docker_vm" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
key_name = "your-ssh-key-name"

connection {
type = "ssh"
user = "ec2-user"
private_key = file("${path.module}/your-ssh-key.pem")
host = self.public_ip
}

provisioner "remote-exec" {
inline = [
"sudo yum update -y",
"sudo amazon-linux-extras install docker -y",
"sudo service docker start",
"sudo usermod -a -G docker ec2-user"
]
}

provisioner "remote-exec" {
inline = [
"cd /path/to/your/app",
"sudo docker build -t my-app .",
"sudo docker run -d -p 80:80 my-app"
]
}

tags = {
Name = "DockerVM"
}
}
39 changes: 39 additions & 0 deletions scripts/hive_cloud_hopping.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
provider "aws" {
region = "us-west-2"
# Additional configuration such as credentials
}

provider "google" {
credentials = file("<CREDENTIALS_FILE>.json")
project = "<GCP_PROJECT_ID>"
region = "us-central1"
# Additional configuration
}

module "aws_cluster_1" {
source = "./modules/aws_cluster"
cluster_name = "cluster-1"
region = "us-west-2"
# Additional variables
}

module "aws_cluster_2" {
source = "./modules/aws_cluster"
cluster_name = "cluster-2"
region = "eu-central-1"
# Additional variables
}

module "gcp_cluster_1" {
source = "./modules/gcp_cluster"
cluster_name = "cluster-1"
region = "us-central1"
# Additional variables
}

module "gcp_cluster_2" {
source = "./modules/gcp_cluster"
cluster_name = "cluster-2"
region = "europe-west1"
# Additional variables
}

0 comments on commit af7bd86

Please sign in to comment.