generated from kyegomez/Python-Package-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye
committed
Feb 24, 2024
1 parent
094f51a
commit af7bd86
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |