in redshift_benchmark/lib/cdkGlueStack.py [0:0]
def __init__(self, scope: core.Construct, id: str,
job_name:str,
checker_type:str,
script_path:str,
**kwargs) -> None:
super().__init__(scope, id, **kwargs)
policy_statement = iam.PolicyStatement(
actions=["logs:*","s3:*","ec2:*","iam:*","cloudwatch:*","dynamodb:*","glue:*","redshift:*","redshift-data:*"]
)
policy_statement.add_all_resources()
glue_job_role = iam.Role(
self,
"Glue-Job-Role-Demo",
assumed_by=iam.ServicePrincipal("glue.amazonaws.com")
)
glue_job_role.add_to_policy(policy_statement)
job = glue.CfnJob(
self,
"glue-checker-job",
role=glue_job_role.role_arn,
max_capacity=0.0625,
#glue_version = "2.0",
name = job_name,
default_arguments = {
'--type': checker_type,
},
command=glue.CfnJob.JobCommandProperty(
name="pythonshell",
script_location=script_path,
python_version = "3"
)
)