dbt-platform-helper 10.11.0__py3-none-any.whl → 10.11.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ import subprocess
5
5
  import time
6
6
 
7
7
  import click
8
+ from botocore.exceptions import ClientError
8
9
  from cfn_tools import dump_yaml
9
10
  from cfn_tools import load_yaml
10
11
 
@@ -12,6 +13,7 @@ from dbt_platform_helper.utils.application import Application
12
13
  from dbt_platform_helper.utils.application import load_application
13
14
  from dbt_platform_helper.utils.aws import update_postgres_parameter_with_master_secret
14
15
  from dbt_platform_helper.utils.click import ClickDocOptCommand
16
+ from dbt_platform_helper.utils.messages import abort_with_error
15
17
  from dbt_platform_helper.utils.platform_config import is_terraform_project
16
18
  from dbt_platform_helper.utils.versioning import (
17
19
  check_platform_helper_version_needs_update,
@@ -207,15 +209,19 @@ def create_addon_client_task(
207
209
  elif addon_type == "redis" or addon_type == "opensearch":
208
210
  secret_name += "_ENDPOINT"
209
211
 
212
+ role_name = f"{addon_name}-{app.name}-{env}-conduitEcsTask"
213
+
210
214
  try:
211
- session.client("iam").get_role(
212
- RoleName=f"{app.name}-{addon_type}-{app.name}-{env}-conduitEcsTask"
213
- )
214
- execution_role = (
215
- f"--execution-role {app.name}-{addon_type}-{app.name}-{env}-conduitEcsTask "
216
- )
217
- except:
215
+ session.client("iam").get_role(RoleName=role_name)
216
+ execution_role = f"--execution-role {role_name} "
217
+ except ClientError as ex:
218
218
  execution_role = ""
219
+ # We cannot check for botocore.errorfactory.NoSuchEntityException as botocore generates that class on the fly as part of errorfactory.
220
+ # factory. Checking the error code is the recommended way of handling these exceptions.
221
+ if ex.response.get("Error", {}).get("Code", None) != "NoSuchEntity":
222
+ abort_with_error(
223
+ f"cannot obtain Role {role_name}: {ex.response.get('Error', {}).get('Message', '')}"
224
+ )
219
225
 
220
226
  subprocess.call(
221
227
  f"copilot task run --app {app.name} --env {env} "
@@ -84,7 +84,7 @@ export class TransformedStack extends cdk.Stack {
84
84
  envVars.push({name: 'ADDITIONAL_ECR_REPOSITORY', value: this.additionalEcrRepository()});
85
85
  }
86
86
 
87
- new cdk.aws_codebuild.CfnProject(this, 'ImageBuildProject', {
87
+ const imageBuildProject: cdk.aws_codebuild.CfnProject = new cdk.aws_codebuild.CfnProject(this, 'ImageBuildProject', {
88
88
  name: `codebuild-${this.appName}-${this.pipelineManifest.name}`,
89
89
  description: `Publish images on push to ${this.codebaseConfiguration.repository}`,
90
90
  badgeEnabled: true,
@@ -122,6 +122,9 @@ export class TransformedStack extends cdk.Stack {
122
122
  )),
123
123
  },
124
124
  });
125
+
126
+ imageBuildProject.node.addDependency(this.template.getResource("BuildProjectRole") as cdk.aws_iam.CfnRole);
127
+ imageBuildProject.node.addDependency(this.template.getResource("BuildProjectPolicy") as cdk.aws_iam.CfnPolicy);
125
128
  }
126
129
 
127
130
  private createECRRepository() {
@@ -403,7 +406,10 @@ export class TransformedStack extends cdk.Stack {
403
406
  const buildProjectPolicy = this.template.getResource("BuildProjectPolicy") as cdk.aws_iam.CfnPolicy;
404
407
  (buildProjectPolicy.policyDocument.Statement as Array<any>).push({
405
408
  Effect: 'Allow',
406
- Action: ['codestar-connections:UseConnection'],
409
+ Action: [
410
+ 'codestar-connections:GetConnectionToken',
411
+ 'codestar-connections:UseConnection',
412
+ ],
407
413
  Resource: [this.codestarConnection.arn],
408
414
  });
409
415
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbt-platform-helper
3
- Version: 10.11.0
3
+ Version: 10.11.2
4
4
  Summary: Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot.
5
5
  License: MIT
6
6
  Author: Department for Business and Trade Platform Team
@@ -7,7 +7,7 @@ dbt_platform_helper/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
7
7
  dbt_platform_helper/commands/application.py,sha256=1XTBfdZBDj1vOFkAWjTxxTNFtko4YB9Q0_tVdxavwAo,9957
8
8
  dbt_platform_helper/commands/check_cloudformation.py,sha256=aLif3yMHKuZO0uvdUjTH9FdRZNIpCqtWvE3aFQMozoc,3226
9
9
  dbt_platform_helper/commands/codebase.py,sha256=NchJzH-yxv5mXCe2rPyXVNHmXGEvjFUv0KhMKYsLNNQ,11380
10
- dbt_platform_helper/commands/conduit.py,sha256=M_-Lrcph4c4PFivfEzDEL2_PW_OzZaOtZXpgo_Ao3DU,14882
10
+ dbt_platform_helper/commands/conduit.py,sha256=SjuVhTcmyokCIF7OI8E5YxRgkyHc0C5lt72waCJfML0,15395
11
11
  dbt_platform_helper/commands/config.py,sha256=NOHea7OAjrl6XHlW6HMLn0m0T5lFPyNH3HXoyCOWsJk,12070
12
12
  dbt_platform_helper/commands/copilot.py,sha256=euid0FTlVtwKmBQ6vxt_HxtBdRYiVQvb-9CyrK1-MWc,16724
13
13
  dbt_platform_helper/commands/database.py,sha256=-DacXZ2LhwV3CRukG35urEU2TuNVZHppUA3EhbBNjUs,4840
@@ -68,7 +68,7 @@ dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.image.yml,s
68
68
  dbt_platform_helper/templates/pipelines/codebase/overrides/cdk.json,sha256=ZbvoQdcj_k9k1GAD9qHUQcDfQPbMcBPjJwt2mu_S6ho,339
69
69
  dbt_platform_helper/templates/pipelines/codebase/overrides/package-lock.json,sha256=Is83o58QXbeg2SkHmR79ATt91aFhVbO7kb1VF0qXpY8,152671
70
70
  dbt_platform_helper/templates/pipelines/codebase/overrides/package.json,sha256=XB0Pf63NSsGyowkPGTl1Nki167nRDXJdnxLSN3S_lQg,536
71
- dbt_platform_helper/templates/pipelines/codebase/overrides/stack.ts,sha256=ugImQjc15sBCvQSbciOeHX2lnoTY_dkepjwFn5ueNNo,21117
71
+ dbt_platform_helper/templates/pipelines/codebase/overrides/stack.ts,sha256=v9m6EziRgFnrhF7inbr1KtuOh75FeC054vaWMoAi-qg,21500
72
72
  dbt_platform_helper/templates/pipelines/codebase/overrides/tsconfig.json,sha256=k6KabP-WwhFNgA1AFHNuonTEAnES6eR74jUuYUJEGOM,651
73
73
  dbt_platform_helper/templates/pipelines/codebase/overrides/types.ts,sha256=8cp5xl_CIMH5TPvwlw9UBPKwfntcsu-lTAjbL5uylgw,1257
74
74
  dbt_platform_helper/templates/pipelines/environments/buildspec.yml,sha256=hTCUhSfrnTUMOpUo8EjQmvit2aX7J0cKNeqV2DChaA0,3365
@@ -96,8 +96,8 @@ dbt_platform_helper/utils/template.py,sha256=raRx4QUCVJtKfvJK08Egg6gwWcs3r3V4nPW
96
96
  dbt_platform_helper/utils/validation.py,sha256=2XMizmCGk4oTVU67q72cdc8eyOzL0wxhe7DframhQ8Q,23699
97
97
  dbt_platform_helper/utils/versioning.py,sha256=h3veQpFoiOjYY9dRVppcBDzVfgZerT0lXuE9QCTo5-c,10710
98
98
  platform_helper.py,sha256=zjsZKcbyrEQbKfERi0JG8JEL-MgG6EjxIMiWT66kCVg,2299
99
- dbt_platform_helper-10.11.0.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
100
- dbt_platform_helper-10.11.0.dist-info/METADATA,sha256=R2rfcAwazxqT20_XZoW-CZeaGjBLSuHIJSchxQJ4Kh4,3127
101
- dbt_platform_helper-10.11.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
102
- dbt_platform_helper-10.11.0.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
103
- dbt_platform_helper-10.11.0.dist-info/RECORD,,
99
+ dbt_platform_helper-10.11.2.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
100
+ dbt_platform_helper-10.11.2.dist-info/METADATA,sha256=lA9wUd7Bp-AE9Xj3bjVp0xzTYQgSBnjcUNawTnj9bfk,3127
101
+ dbt_platform_helper-10.11.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
102
+ dbt_platform_helper-10.11.2.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
103
+ dbt_platform_helper-10.11.2.dist-info/RECORD,,