File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff 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
2639resource "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}
You can’t perform that action at this time.
0 commit comments