Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource inspection fails for ECS when Capacity Provider Strategy is set #179

Open
nerixim opened this issue May 1, 2021 · 0 comments
Open

Comments

@nerixim
Copy link

nerixim commented May 1, 2021

Recently discovered your awesome tool. Thanks for the work!

I have an ECS cluster with Capacity Provider Strategy set and cloudiscovery throws an error when trying to inspect it.
Actually it's a boto3 issue but meanwhile it can be avoided by adding a check as follows

# https://github.com/Cloud-Architects/cloudiscovery/blob/fad132e45f813775eaf0051e628fcbec68291fb4/cloudiscovery/provider/aws/vpc/resource/containers.py#L58
- if data_service_detail["launchType"] == "FARGATE":
  if data_service_detail.get("launchType") == "FARGATE" or data_service_detail.get('capacityProviderStrategy'):

Error trace just in case

Inspecting resources
You've found a bug! Please, open an issue in GitHub project
https://github.com/Cloud-Architects/cloudiscovery/issues

Python:        3.9.4 (default, Apr  5 2021, 01:49:30)
[Clang 12.0.0 (clang-1200.0.32.29)]
boto3 version: 1.17.53
Platform:      macOS-10.15.7-x86_64-i386-64bit

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/cloudiscovery/shared/error_handler.py", line 21, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/cloudiscovery/shared/common.py", line 130, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/cloudiscovery/provider/aws/vpc/resource/containers.py", line 58, in get_resources
    if data_service_detail["launchType"] == "FARGATE":
KeyError: 'launchType'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant