Skip to content

Commit

Permalink
Fix parameter lookups to be compatible with v3.2
Browse files Browse the repository at this point in the history
**Why?**

In the next v4 release, the parameters automatically add the required prefixes.
With v3.2, this was not the case yet. Since we are porting changes back into
a new release of v3.2 we need to make sure they are compatible.

**What?**

Fixing the lookup and put path references as required to install and bootstrap
ADF.
  • Loading branch information
sbkok committed May 23, 2024
1 parent d8005c0 commit 0d3a7b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lambda_codebase/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def create_output_object(self, account_path):
'full_path': "ROOT" if self.moved_to_root else account_path,
'destination_ou_id': self.destination_ou_id,
'source_ou_id': self.source_ou_id,
'deployment_account_parameters' : {
'deployment_account_parameters': {
'organization_id': organization_information.get(
"organization_id"
),
Expand All @@ -142,9 +142,9 @@ def create_output_object(self, account_path):
'deployment_account_bucket': DEPLOYMENT_ACCOUNT_S3_BUCKET,
'adf_version': ADF_VERSION,
'adf_log_level': ADF_LOG_LEVEL,
'extensions/terraform/enabled': (
'/adf/extensions/terraform/enabled': (
self._read_parameter(
'extensions/terraform/enabled',
'/adf/extensions/terraform/enabled',
'False',
)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def _store_extension_parameters(parameter_store, config):

def worker_thread(
account_id,
deployment_account_id,
sts,
config,
s3,
Expand Down Expand Up @@ -248,6 +249,10 @@ def worker_thread(
'bucket_name',
updated_kms_bucket_dict[region]['s3_regional_bucket'],
)
parameter_store.put_parameter(
'deployment_account_id',
deployment_account_id,
)
cloudformation = CloudFormation(
region=region,
deployment_account_region=config.deployment_account_region,
Expand Down Expand Up @@ -483,6 +488,7 @@ def main(): # pylint: disable=R0915
for account_id in non_deployment_account_ids:
thread = PropagatingThread(target=worker_thread, args=(
account_id,
deployment_account_id,
sts,
config,
s3,
Expand Down

0 comments on commit 0d3a7b2

Please sign in to comment.