@@ -410,7 +410,7 @@ def create_batch_compute_environment(self) -> batch.FargateComputeEnvironment:
410410 compute_environment_name = "workbench-compute-env" ,
411411 vpc = vpc ,
412412 vpc_subnets = vpc_subnets ,
413- # replace_compute_environment=True,
413+ # replace_compute_environment=True, (Fixme: This is a circle back issue)
414414 )
415415
416416 def create_batch_job_queue (self ) -> batch .JobQueue :
@@ -484,11 +484,13 @@ def dataframe_store_full(self) -> iam.PolicyStatement:
484484 #####################
485485 # Inference Store #
486486 #####################
487- def inference_store_read (self ) -> iam .PolicyStatement :
487+ def glue_database_read_just_inference_store (self ) -> iam .PolicyStatement :
488488 """Create a policy statement for reading from the Parameter Store.
489489
490+ Note: This is basically glue_databases_read but scoped to just the inference_store database.
491+
490492 Returns:
491- iam.PolicyStatement: The policy statement for reading from the Parameter Store.
493+ iam.PolicyStatement: The policy statement for reading from the Inference Store.
492494 """
493495 return iam .PolicyStatement (
494496 actions = [
@@ -501,13 +503,15 @@ def inference_store_read(self) -> iam.PolicyStatement:
501503 resources = self ._inference_database_arns (),
502504 )
503505
504- def inference_store_full (self ) -> iam .PolicyStatement :
506+ def glue_database_full_just_inference_store (self ) -> iam .PolicyStatement :
505507 """Create a policy statement for full access to the Inference Store.
506508
509+ Note: This is basically glue_databases_full but scoped to just the inference_store database.
510+
507511 Returns:
508512 iam.PolicyStatement: The policy statement for full access to the Inference Store.
509513 """
510- read_statement = self .inference_store_read ()
514+ read_statement = self .glue_database_read_just_inference_store ()
511515 return iam .PolicyStatement (
512516 actions = read_statement .actions
513517 + [
@@ -1300,7 +1304,11 @@ def workbench_parameter_store_full_policy(self) -> iam.ManagedPolicy:
13001304 def workbench_inference_store_read_policy (self ) -> iam .ManagedPolicy :
13011305 """Create a managed policy for the Workbench Inference Store (READ-ONLY)"""
13021306 policy_statements = [
1303- self .inference_store_read (),
1307+ self .s3_read (),
1308+ self .glue_job_logs (),
1309+ self .glue_catalog_read (),
1310+ self .glue_database_read_just_inference_store (),
1311+ self .athena_read (),
13041312 ]
13051313
13061314 return iam .ManagedPolicy (
@@ -1313,7 +1321,11 @@ def workbench_inference_store_read_policy(self) -> iam.ManagedPolicy:
13131321 def workbench_inference_store_full_policy (self ) -> iam .ManagedPolicy :
13141322 """Create a managed policy for the Workbench Inference Store (FULL)"""
13151323 policy_statements = [
1316- self .inference_store_full (),
1324+ self .s3_full (),
1325+ self .glue_job_logs (),
1326+ self .glue_catalog_read (),
1327+ self .glue_database_full_just_inference_store (),
1328+ self .athena_read (),
13171329 ]
13181330
13191331 return iam .ManagedPolicy (
@@ -1352,6 +1364,7 @@ def create_execution_role(self) -> iam.Role:
13521364 api_execution_role .add_to_policy (self .batch_pass_role ())
13531365 api_execution_role .add_to_policy (self .parameter_store_discover ())
13541366 api_execution_role .add_to_policy (self .parameter_store_full ())
1367+ api_execution_role .add_to_policy (self .cloudwatch_logs ())
13551368 api_execution_role .add_to_policy (self .cloudwatch_monitor ())
13561369 api_execution_role .add_managed_policy (self .datasource_policy )
13571370 api_execution_role .add_managed_policy (self .featureset_policy )
@@ -1382,6 +1395,7 @@ def create_readonly_role(self) -> iam.Role:
13821395 readonly_role .add_to_policy (self .glue_jobs_read ())
13831396 readonly_role .add_to_policy (self .parameter_store_discover ())
13841397 readonly_role .add_to_policy (self .parameter_store_read ())
1398+ readonly_role .add_to_policy (self .cloudwatch_logs ())
13851399 readonly_role .add_managed_policy (self .datasource_read_policy )
13861400 readonly_role .add_managed_policy (self .featureset_read_policy )
13871401 readonly_role .add_managed_policy (self .model_read_policy )
@@ -1400,6 +1414,7 @@ def create_lambda_role(self) -> iam.Role:
14001414
14011415 # Add a subset of policies for the Lambda Role
14021416 lambda_role .add_to_policy (self .parameter_store_full ())
1417+ lambda_role .add_to_policy (self .cloudwatch_logs ())
14031418 lambda_role .add_managed_policy (self .datasource_policy )
14041419 lambda_role .add_managed_policy (self .featureset_policy )
14051420 lambda_role .add_managed_policy (self .model_policy )
@@ -1420,6 +1435,7 @@ def create_glue_role(self) -> iam.Role:
14201435 # Add a subset of policies for the Glue Role
14211436 glue_role .add_to_policy (self .glue_job_logs ())
14221437 glue_role .add_to_policy (self .glue_connections ())
1438+ glue_role .add_to_policy (self .cloudwatch_logs ())
14231439 glue_role .add_to_policy (self .vpc_discovery ())
14241440 glue_role .add_to_policy (self .vpc_network_interface_management ())
14251441 glue_role .add_to_policy (self .parameter_store_full ())
@@ -1442,6 +1458,7 @@ def create_batch_role(self) -> iam.Role:
14421458
14431459 # Add policies for the Batch Role
14441460 batch_role .add_to_policy (self .batch_job_logs ())
1461+ batch_role .add_to_policy (self .cloudwatch_logs ())
14451462 batch_role .add_to_policy (self .parameter_store_full ())
14461463 batch_role .add_to_policy (self .dataframe_store_full ())
14471464 batch_role .add_managed_policy (self .datasource_policy )
0 commit comments