Skip to content

Commit f829d2c

Browse files
committed
fixes for latest changes
1 parent 9952277 commit f829d2c

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

lib/idp_common_pkg/idp_common/bda/bda_blueprint_creator.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ def update_data_automation_project(self, projectArn: str, blueprint):
7474
logger.error(f"Failed to update data automation project: {e}")
7575
return None
7676

77-
def update_data_automation_project_with_custom_configurations(
78-
self, projectArn: str, customConfiguration
79-
):
77+
def update_project_with_custom_configurations(self, projectArn: str, customConfiguration):
8078
"""
8179
Update an existing Bedrock Data Automation project with the provided blueprint.
8280
@@ -93,7 +91,7 @@ def update_data_automation_project_with_custom_configurations(
9391
)
9492
project = project.get("project", None)
9593
logger.info(f"Updating project: {project}")
96-
94+
9795
logger.info(f"Updating updated data automation project: {projectArn}")
9896
response = self.bedrock_client.update_data_automation_project(
9997
projectArn=projectArn,
@@ -354,27 +352,26 @@ def get_blueprint(self, blueprint_arn, stage):
354352
logger.error(f"Error updating blueprint: {e}")
355353
raise e
356354

357-
def list_blueprints(self, projectArn, projectStage):
355+
356+
def list_blueprints(self, projectArn, projectStage ):
358357
try:
359358
project = self.bedrock_client.get_data_automation_project(
360359
projectArn=projectArn, projectStage="LIVE"
361360
)
362361
project = project.get("project", None)
363362
logger.info(f"Updating project: {project}")
364363
customOutputConfiguration = project.get("customOutputConfiguration", None)
365-
364+
366365
return customOutputConfiguration
367366

368367
except Exception as e:
369368
logger.error(f"Error updating blueprint: {e}")
370369
raise e
371-
372-
def delete_blueprint(self, blueprint_arn, blueprint_version):
370+
371+
def delete_blueprint(self, blueprint_arn, blueprint_version ):
373372
try:
374-
return self.bedrock_client.delete_blueprint(
375-
blueprintArn=blueprint_arn, blueprintVersion=blueprint_version
376-
)
377-
373+
return self.bedrock_client.delete_blueprint(blueprintArn=blueprint_arn, blueprintVersion=blueprint_version )
374+
378375
except Exception as e:
379376
logger.error(f"Error delete_blueprint: {e}")
380377
raise e

lib/idp_common_pkg/idp_common/bda/bda_blueprint_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _check_for_updates(self, custom_class: dict, blueprint: dict):
149149
# blueprint = self.blueprint_creator.get_blueprint(blueprint_arn, stage="LIVE")
150150
# print(f"blueprint retrieved {blueprint}")
151151
# get the schema
152-
schema = blueprint["blueprint"]["schema"]
152+
schema = blueprint["schema"]
153153
schema = json.loads(schema)
154154
# get the document class
155155
definitions = schema["definitions"]
@@ -262,6 +262,7 @@ def create_blueprints_from_custom_configuration(self):
262262
logger.info(
263263
f"Found existing blueprint for class {docu_class}: {blueprint_name}"
264264
)
265+
blueprints_updated.append(blueprint_arn)
265266

266267
# Check for updates on existing blueprint
267268
if self._check_for_updates(
@@ -293,7 +294,7 @@ def create_blueprints_from_custom_configuration(self):
293294
logger.info(
294295
f"No updates needed for existing blueprint {blueprint_name}"
295296
)
296-
blueprints_updated.append(blueprint_arn)
297+
297298
else:
298299
# create new blueprint
299300
# Call the create_blueprint method
@@ -329,6 +330,7 @@ def create_blueprints_from_custom_configuration(self):
329330
custom_class["blueprint_version"] = result.get("blueprint").get(
330331
"blueprint_version"
331332
)
333+
blueprints_updated.append(blueprint_arn)
332334
logger.info(
333335
f"Created new blueprint for class {docu_class}: {blueprint_name}"
334336
)

patterns/pattern-1/src/bda_discovery_function/index.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def handler(event, context):
3232

3333
batch_item_failures = []
3434
sqs_batch_response = {}
35-
status = 'SUCCESS'
36-
3735
try:
3836
bda_project_arn = os.environ.get("BDA_PROJECT_ARN")
3937
bdaBlueprintService = BdaBlueprintService( dataAutomationProjectArn=bda_project_arn )

patterns/pattern-1/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ Resources:
776776
- bedrock:CreateBlueprint
777777
- bedrock:CreateBlueprintVersion
778778
- bedrock:ListBlueprints
779-
- bedrock:DeletBlueprint
779+
- bedrock:DeleteBlueprint
780780
Resource:
781781
- !Ref BDAProjectArn
782782
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:blueprint/*"

0 commit comments

Comments
 (0)