Terraform
A tool that enables infrastructure as code to set up servers in AWS EC2.
Last updated
Was this helpful?
Was this helpful?
terraform initPUBLIC_KEY_PATH - path to the user's public key file that gets injected into the servers created
PROJECT_NAME - unique project name that is used to identify each VPC and its resources
HOSTED_ZONE_ID - (only if you are creating domains, which by default you are) the hosted zone to use, this must be created in the AWS console
DOMAIN_NAME - the base domain name to use
SUBNET_ID - the subnet id to use, copy this from the previous step
VPC_ID - the subnet id to use, copy this from the previous stepPUBLIC_KEY_PATH = "/home/{user}/.ssh/id_rsa.pub"
PROJECT_NAME = "jembi_platform_dev_{user}"
HOSTED_ZONE_ID = "Z00782582NSP6D0VHBCMI"
DOMAIN_NAME = "{user}.jembi.cloud"
SUBNET_ID = "subnet-0004b0dacb5862d59"
VPC_ID = "vpc-067ab69f374ac9f47"cat ~/.aws/credentials[default]
aws_access_key_id = AKIA6FOPGN5TYHXXXXX
aws_secret_access_key = Qf7E+qcXXXXXXQh4XznN4MM8qR/VP/SXgXXXXX
[jembi-sandbox]
aws_access_key_id = AKIASOHFAV527JCXXXXX
aws_secret_access_key = YXFu3XxXXXXXTeNXdUtIg0gb9Ro7gJ89XXXXX
[jembi-icap]
aws_access_key_id = AKIAVFN7GJJFS6LXXXXX
aws_secret_access_key = b2I6jhwXXXXX4YehBCx/7rKl1JZjYdbtXXXXXterraform apply -var-file my.tfvarsApply complete! Resources: 13 added, 0 changed, 0 destroyed.
Outputs:
domains = {
"domain_name" = "{user}.jembi.cloud"
"node_domain_names" = [
"node-0.{user}.jembi.cloud",
"node-1.{user}.jembi.cloud",
"node-2.{user}.jembi.cloud",
]
"subdomain" = [
"*.{user}.jembi.cloud",
]
}
public_ips = [
"13.245.143.121",
"13.246.39.101",
"13.246.39.92",
]terraform destroy -var-file my.tfvars