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

update E1019 and E1010 to handle attributes of a resource having type Map #1659

Merged
merged 2 commits into from
Aug 28, 2020

Conversation

kddejong
Copy link
Contributor

Issue #, if available:
fix #1658

Description of changes:

  • update E1019 and E1010 to handle attributes of a resource having type Map

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

This comment has been minimized.

# Check for maps
restypeparts = restype.split('.')
if restypeparts[0] in valid_getatts[resname] and len(restypeparts) >= 2:
if valid_getatts[resname][restypeparts[0]].get('Type') != 'Map':
Copy link
Contributor

@PatMyron PatMyron Aug 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kddejong AWS::ServiceCatalog::CloudFormationProvisionedProduct's the only GetAtt Map so far:

curl -s --compressed https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json | jq '.ResourceTypes' | jq 'with_entries(.value |= .Attributes)' | grep -v ': null' | grep -Eo 'Type": ".*"' | sort | uniq -c | sort -nr
 504 Type": "String"
  26 Type": "List"
   6 Type": "Integer"
   4 Type": "Boolean"
   1 Type": "Map"
   1 Type": "Json"
   1 Type": "FindingsFilterListItem"

so I was considering hardcoding that exception, but this seems even better 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I'm not a huge fan of this solution. I think there are better long term solutions if this continues to grow.

@kddejong kddejong force-pushed the fix/1658 branch 2 times, most recently from 56d4074 to 506c52b Compare August 19, 2020 14:54
@kddejong kddejong requested a review from PatMyron August 19, 2020 14:54
@kddejong kddejong force-pushed the fix/1658 branch 5 times, most recently from 562ddf1 to ef509c2 Compare August 25, 2020 22:44
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

Successfully merging this pull request may close these issues.

AWS::ServiceCatalog::CloudFormationProvisionedProduct.Outputs
2 participants