From a8366e7754e84af1f4591d4bc7333ece9499bf31 Mon Sep 17 00:00:00 2001 From: Gabe Naughton Date: Thu, 29 Feb 2024 08:32:58 +0000 Subject: [PATCH] fix: ensure opensearch domain is created before param (#342) --- dbt_copilot_helper/templates/addons/env/opensearch.yml | 2 ++ .../expected/environments/addons/my-opensearch-longer.yml | 2 ++ .../make_addons/expected/environments/addons/my-opensearch.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/dbt_copilot_helper/templates/addons/env/opensearch.yml b/dbt_copilot_helper/templates/addons/env/opensearch.yml index 024401c8c..108a74525 100644 --- a/dbt_copilot_helper/templates/addons/env/opensearch.yml +++ b/dbt_copilot_helper/templates/addons/env/opensearch.yml @@ -170,6 +170,8 @@ Resources: {{ addon_config.prefix }}OpenSearchEndpointConfigParam: Type: AWS::SSM::Parameter + DependsOn: + - {{ addon_config.prefix }}OpenSearchDomain Properties: Name: !Sub "/copilot/${App}/${Env}/secrets/{{ addon_config.secret_name }}" Type: String diff --git a/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch-longer.yml b/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch-longer.yml index fc0e7dfdc..25af7a7e2 100644 --- a/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch-longer.yml +++ b/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch-longer.yml @@ -168,6 +168,8 @@ Resources: myOpensearchLongerOpenSearchEndpointConfigParam: Type: AWS::SSM::Parameter + DependsOn: + - myOpensearchLongerOpenSearchDomain Properties: Name: !Sub "/copilot/${App}/${Env}/secrets/MY_OPENSEARCH_LONGER" Type: String diff --git a/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch.yml b/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch.yml index c32403ca0..212588c02 100644 --- a/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch.yml +++ b/tests/copilot_helper/fixtures/make_addons/expected/environments/addons/my-opensearch.yml @@ -168,6 +168,8 @@ Resources: myOpensearchOpenSearchEndpointConfigParam: Type: AWS::SSM::Parameter + DependsOn: + - myOpensearchOpenSearchDomain Properties: Name: !Sub "/copilot/${App}/${Env}/secrets/MY_OPENSEARCH" Type: String