-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Showing
5 changed files
with
98 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
**.DS_Store | ||
*.zip | ||
**.terraform | ||
**terraform.auto.tfvars | ||
**.tfstate** | ||
**.backup | ||
**.rli | ||
|
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,47 @@ | ||
# Deploy HashiQube on AWS, GCP, Azure or All of them | ||
|
||
You simple need to configure your Cloud authentication, and this is done by exporting the following Environment variables, be sure to look at the helpful links | ||
|
||
## Authentication | ||
|
||
Azure: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret#creating-a-service-principal | ||
AWS: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#environment-variables | ||
GCP: https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference.html#authentication-configuration | ||
|
||
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret#creating-a-service-principal | ||
export AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID | ||
export AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY | ||
export AWS_REGION=YOUR_AWS_REGION | ||
|
||
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference.html#authentication-configuration | ||
export GOOGLE_CREDENTIALS='YOUR_GOOGLE_CREDENTIALS_FILE_JSON' | ||
|
||
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret#creating-a-service-principal | ||
export ARM_CLIENT_ID=YOUR_ARM_CLIENT_ID | ||
export ARM_CLIENT_SECRET=YOUR_ARM_CLIENT_SECRET | ||
export ARM_SUBSCRIPTION_ID=YOUR_ARM_SUBSCRIPTION_ID | ||
export ARM_TENANT_ID=YOUR_ARM_TENANT_ID | ||
|
||
## Terraform Auto TFVars | ||
|
||
Rename localstack/hashiqube/terraform.auto.tfvars.example to localstack/hashiqube/terraform.auto.tfvars | ||
|
||
Add your SSH Public Key and Private key in localstack/hashiqube/terraform.auto.tfvars | ||
|
||
You should already have Terraform installed, if you don't see this link: https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli | ||
|
||
## Run Terraform | ||
|
||
Now you can run: | ||
|
||
- terraform init | ||
- terraform plan | ||
- terraform apply | ||
|
||
You will see HashiQube launching and it will stream the User Data debug output, | ||
|
||
For further reading see: | ||
|
||
- https://hashiqube.com | ||
- https://registry.terraform.io/modules/star3am/hashiqube/hashicorp/latest | ||
|
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,42 @@ | ||
terraform { | ||
required_version = "~> 1.5" | ||
|
||
required_providers { | ||
# https://registry.terraform.io/providers/hashicorp/aws/latest | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.67" | ||
} | ||
external = { | ||
source = "hashicorp/external" | ||
version = "~> 2.3" | ||
} | ||
null = { | ||
source = "hashicorp/null" | ||
version = "~> 3.0" | ||
} | ||
} | ||
} | ||
|
||
data "external" "myipaddress" { | ||
program = ["bash", "-c", "curl -m 10 -sk 'https://api.ipify.org?format=json'"] | ||
} | ||
|
||
provider "aws" {} | ||
|
||
module "hashiqube" { | ||
source = "star3am/hashiqube/hashicorp//modules/aws-hashiqube" | ||
version = "1.1.6" | ||
|
||
deploy_to_aws = true | ||
aws_instance_type = "t2.large" | ||
use_packer_image = false | ||
deploy_to_azure = false | ||
deploy_to_gcp = false | ||
debug_user_data = true | ||
ssh_private_key = var.ssh_private_key | ||
ssh_public_key = var.ssh_public_key | ||
docker_version = "5:24.0.8-1~ubuntu.22.04~jammy" | ||
whitelist_cidrs = ["${data.external.myipaddress.result.ip}/32"] | ||
vagrant_provisioners = "basetools,docker,minikube,ansible-tower" | ||
} |
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,6 @@ | ||
ssh_public_key = "ssh-rsa AAAA... PASTE YOUR SSH PUBLIC KEY IN HERE" | ||
ssh_private_key = <<EOF | ||
-----BEGIN OPENSSH PRIVATE KEY----- | ||
PASTE YOUR SSH PRTIVATE KEY IN HERE | ||
-----END OPENSSH PRIVATE KEY----- | ||
EOF |
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,2 @@ | ||
variable "ssh_private_key" {} | ||
variable "ssh_public_key" {} |