mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-28 21:01:57 +03:00
updates to sh script and output
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
output "jenkins-ip" {
|
output "jenkins-ip" {
|
||||||
value = "${aws_instance.jenkins-instance.public_ip}"
|
value = "${aws_instance.jenkins-instance.*.public_ip}"
|
||||||
}
|
}
|
||||||
output "app-ip" {
|
output "app-ip" {
|
||||||
value = "${aws_instance.app-instance.public_ip}"
|
value = "${aws_instance.app-instance.*.public_ip}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# not necessary anymore in newer terraform versions, you can use a backend.tf file
|
|
||||||
if [ "`terraform --version |head -n1`" == "Terraform v0.7.7" ] ; then
|
echo "Newer terraform versions have a new way of defining a backend. Copy paste the following code in a backend.tf file, modify the region/s3 bucket, and execute 'terraform init' to initialize the backend. You'll be asked to copy the data from the local backend to the s3 backend, which you can answer yes.
|
||||||
terraform remote config -backend=s3 -backend-config="bucket=terraform-state-a2b621f" -backend-config="key=terraform/terraform.tfstate" -backend-config="region=eu-west-1"
|
"
|
||||||
fi
|
echo 'backend.tf
|
||||||
|
==========
|
||||||
|
terraform {
|
||||||
|
backend "s3" {
|
||||||
|
bucket = "terraform-state-a3c731f"
|
||||||
|
key = "terraform.tfstate"
|
||||||
|
region = "eu-west-1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|||||||
Reference in New Issue
Block a user