diff --git a/lib/flame_ec2/ec2_api.ex b/lib/flame_ec2/ec2_api.ex index a92cd4f..2a24002 100644 --- a/lib/flame_ec2/ec2_api.ex +++ b/lib/flame_ec2/ec2_api.ex @@ -43,7 +43,7 @@ defmodule FlameEC2.EC2Api do def build_params_from_state(%BackendState{} = state) do state.config - |> params_from_config() + |> params_from_config(state.runner_env) |> Map.merge(instance_tags(state)) |> Map.put("Action", "RunInstances") |> flatten_json_object() @@ -70,9 +70,9 @@ defmodule FlameEC2.EC2Api do } end - defp params_from_config(%Config{} = config) do + defp params_from_config(%Config{} = config, env) do systemd_service = Templates.systemd_service(app: config.app) - env = Templates.env(vars: config.env) + env = Templates.env(vars: env) start_script = Templates.start_script( diff --git a/test/flame_ec2/ec2_api_test.exs b/test/flame_ec2/ec2_api_test.exs index 94c6a64..81f517d 100644 --- a/test/flame_ec2/ec2_api_test.exs +++ b/test/flame_ec2/ec2_api_test.exs @@ -47,7 +47,7 @@ defmodule FlameEC2.EC2ApiTest do {:ok, decoded} = Base.decode64(parsed["UserData"]) systemd_service = FlameEC2.Templates.systemd_service(app: state.config.app) - env = FlameEC2.Templates.env(vars: state.config.env) + env = FlameEC2.Templates.env(vars: state.runner_env) start_script = FlameEC2.Templates.start_script(