Proyek Membangun Web Server (Apache2, Nginx & Node.js) adalah submission akhir untuk kelas Belajar Jaringan Komputer untuk Pemula - Dicoding.
Otomatisasi deployment dan konfigurasi menggunakan tools IaC (Infrastucture as Code):
-
Clone repository
git clone https://github.com/andrijunaedi/basic-networking-submission.git cd basic-networking-submission
-
Copy
terraform.trfvars-example
keterraform.tfvars
dan sesuaikan valuenya.cp terraform.trfvars-example terraform.tfvars nano terraform.tfvars
Note:
profile
: profile AWS Credentialspublic_key
: path public key SSHprivate_key
: path private key SSH
-
Init Terraform
terraform init
-
Terraform plan
terraform plan
-
Apply terraform
terraform apply # Terraform apply auto approve terraform apply -auto-approve
terraform destroy
# Terraform destroy auto approve
terraform destroy -auto-approve
ansible_command
berikut ada pada outputs terraform:
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu -i '$PUBLIC_IP,' --private-key $PRIVATE_KEY -e 'pub_key=$PUBLIC_KEY' playbooks/setup-webserver.yml