aws-samples / amazon-mwaa-workflow-demo

MIT No Attribution
3 stars 2 forks source link

Python "TypeError: type of argument inline_policies [...] when running "cdk bootstrap"command #1

Open danielhidalg opened 1 year ago

danielhidalg commented 1 year ago

Hi,

I've just tried instructions at https://aws.amazon.com/es/blogs/aws-spanish/construyendo-pipelines-de-datos-con-amazon-managed-workflows-for-apache-airflow-amazon-emr-aws-glue-y-amazon-athena/, but as you can see on attachment, when I reach step 3 command "cdk bootstrap", it returns:

"[...] TypeError: type of argument inline_policies must be one of (Mapping[str, aws_cdk.aws_iam.PolicyDocument], NoneType); got list instead"

CDK_BOOTSTRAP_ERROR.txt

mirus2017 commented 7 months ago

I have the same problem: $ cdk bootstrap [WARNING] @aws-cdk/aws-ec2.SubnetType#PRIVATE is deprecated. use PRIVATE_WITH_NAT This API will be removed in the next major release. [WARNING] @aws-cdk/aws-ec2.SubnetType#PRIVATE is deprecated. use PRIVATE_WITH_NAT This API will be removed in the next major release. Traceback (most recent call last): File "app.py", line 14, in data_lake = DataLakeStack(app, 'cdk-mwaa-s3') File "/home/ec2-user/environment/amazon-mwaa-workflow-demo/.env/lib64/python3.8/site-packages/jsii/_runtime.py", line 118, in call inst = super(JSIIMeta, cast(JSIIMeta, cls)).call(*args, *kwargs) File "/home/ec2-user/environment/amazon-mwaa-workflow-demo/cdk_mwaa_blogpost/DataLakeStack.py", line 54, in init glue_role = iam.Role(self, id='AWSGlueServiceRole-mwaa-demo-crawler', File "/home/ec2-user/environment/amazon-mwaa-workflow-demo/.env/lib64/python3.8/site-packages/jsii/_runtime.py", line 118, in call inst = super(JSIIMeta, cast(JSIIMeta, cls)).call(args, **kwargs) File "/home/ec2-user/environment/amazon-mwaa-workflow-demo/.env/lib64/python3.8/site-packages/aws_cdk/aws_iam/init.py", line 11375, in init props = RoleProps( File "/home/ec2-user/environment/amazon-mwaa-workflow-demo/.env/lib64/python3.8/site-packages/aws_cdk/aws_iam/init.py", line 9183, in init check_type(argname="argument inline_policies", value=inline_policies, expected_type=type_hints["inline_policies"]) File "/home/ec2-user/environment/amazon-mwaa-workflow-demo/.env/lib64/python3.8/site-packages/typeguard/init.py", line 757, in check_type checker_func(argname, value, expected_type, memo) File "/home/ec2-user/environment/amazon-mwaa-workflow-demo/.env/lib64/python3.8/site-packages/typeguard/init.py", line 558, in check_union raise TypeError('type of {} must be one of ({}); got {} instead'. TypeError: type of argument inline_policies must be one of (Mapping[str, aws_cdk.aws_iam.PolicyDocument], NoneType); got list instead

Subprocess exited with error 1