aws-containers / ecsdemo-frontend

MIT License
18 stars 358 forks source link

Error when deploying ecsdemo-frontend CDK #7

Closed yinuochen closed 1 year ago

yinuochen commented 2 years ago

When deploying ecsdemo-frontend CDK, it gives the following error:

Traceback (most recent call last):
  File "app.py", line 354, in <module>
    FrontendService(app, stack_name, env=_env)
  File "/home/ec2-user/.local/lib/python3.7/site-packages/jsii/_runtime.py", line 86, in __call__
    inst = super().__call__(*args, **kwargs)
  File "app.py", line 78, in __init__
    task_image_options=self.fargate_task_image
  File "/home/ec2-user/.local/lib/python3.7/site-packages/jsii/_runtime.py", line 86, in __call__
    inst = super().__call__(*args, **kwargs)
  File "/home/ec2-user/.local/lib/python3.7/site-packages/aws_cdk/aws_ecs_patterns/__init__.py", line 7324, in __init__
    vpc=vpc,
  File "/home/ec2-user/.local/lib/python3.7/site-packages/aws_cdk/aws_ecs_patterns/__init__.py", line 7509, in __init__
    check_type(argname="argument cloud_map_options", value=cloud_map_options, expected_type=type_hints["cloud_map_options"])
  File "/home/ec2-user/.local/lib/python3.7/site-packages/typeguard/__init__.py", line 757, in check_type
    checker_func(argname, value, expected_type, memo)
  File "/home/ec2-user/.local/lib/python3.7/site-packages/typeguard/__init__.py", line 559, in check_union
    format(argname, typelist, qualified_name(value)))
TypeError: type of argument cloud_map_options must be one of (aws_cdk.aws_ecs.CloudMapOptions, Dict[str, Any], NoneType); got jsii._reference_map.InterfaceDynamicProxy instead

Line 77 of cdk/app.py is

cloud_map_options=self.base_platform.sd_namespace,

Please update to match a dictionary like in the documentation. Below is a recommendation

cloud_map_options=aws_ecs.CloudMapOptions(cloud_map_namespace=self.base_platform.sd_namespace),

maishsk commented 1 year ago

Fixed in #11