Skip to content

Commit fbc9cb4

Browse files
committed
Try to fix issue with docker compose file
1 parent 5139b61 commit fbc9cb4

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

docker/lnt.llvm.org/main.tf

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,22 @@ variable "lnt_auth_token" {
1818
sensitive = true
1919
}
2020

21-
resource "local_file" "docker-compose-file" {
22-
source = "../compose.yaml"
23-
filename = "${path.module}/compose.yaml"
21+
data "cloudinit_config" "startup_scripts" {
22+
base64_encode = true
23+
part {
24+
filename = "ec2-startup.sh"
25+
content_type = "text/x-shellscript"
26+
content = templatefile("${path.module}/ec2-startup.sh.tpl", {
27+
__db_password__ = var.lnt_db_password,
28+
__auth_token__ = var.lnt_auth_token,
29+
})
30+
}
31+
32+
part {
33+
filename = "compose.yaml"
34+
content_type = "text/cloud-config"
35+
content = file("${path.module}/../compose.yaml")
36+
}
2437
}
2538

2639
resource "aws_instance" "docker_server" {
@@ -31,8 +44,5 @@ resource "aws_instance" "docker_server" {
3144
Name = "lnt.llvm.org"
3245
}
3346

34-
user_data = templatefile("${path.module}/ec2-startup.sh.tpl", {
35-
__db_password__ = var.lnt_db_password,
36-
__auth_token__ = var.lnt_auth_token,
37-
})
47+
user_data_base64 = data.cloudinit_config.startup_scripts.rendered
3848
}

0 commit comments

Comments
 (0)