File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -70,4 +70,15 @@ resource "aws_instance" "server" {
70
70
http_endpoint = " enabled"
71
71
instance_metadata_tags = " enabled"
72
72
}
73
- }
73
+
74
+ lifecycle {
75
+ create_before_destroy = true
76
+ }
77
+ }
78
+
79
+
80
+ resource "aws_eip" "nomad_consul" {
81
+ domain = " vpc"
82
+ instance = aws_instance. server [0 ]. id
83
+ }
84
+
Original file line number Diff line number Diff line change @@ -62,4 +62,8 @@ resource "aws_instance" "public_client" {
62
62
http_endpoint = " enabled"
63
63
instance_metadata_tags = " enabled"
64
64
}
65
+
66
+ lifecycle {
67
+ create_before_destroy = true
68
+ }
65
69
}
Original file line number Diff line number Diff line change @@ -30,15 +30,17 @@ provider "aws" {
30
30
31
31
provider "consul" {
32
32
datacenter = var. datacenter
33
- address = " ${ aws_instance . server [0 ]. public_ip } :8443"
33
+ # address = "${aws_instance.server[0].public_ip}:8443"
34
+ address = " ${ aws_eip . nomad_consul . public_ip } :8443"
34
35
token = random_uuid. consul_mgmt_token . result
35
36
ca_pem = tls_self_signed_cert. datacenter_ca . cert_pem
36
37
scheme = " https"
37
38
insecure_https = true
38
39
}
39
40
40
41
provider "nomad" {
41
- address = " https://${ aws_instance . server [0 ]. public_ip } :4646"
42
+ # address = "https://${aws_instance.server[0].public_ip}:4646"
43
+ address = " https://${ aws_eip . nomad_consul . public_ip } :4646"
42
44
region = var. domain
43
45
secret_id = random_uuid. nomad_mgmt_token . result
44
46
ca_pem = tls_self_signed_cert. datacenter_ca . cert_pem
You can’t perform that action at this time.
0 commit comments