Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. def evaluate_compliance(configuration_item, rule_parameters):
  2. ################################
  3. # EDIT BELOW THIS COMMENT ONLY #
  4. ################################
  5.  
  6. ami_whitelist = rule_parameters["AllowedAMIs"]
  7.  
  8. if (configuration_item['resourceType'] != 'AWS::EC2::Instance'):
  9. return 'NOT_APPLICABLE'
  10. elif (configuration_item['configuration']['imageId'] in ami_whitelist):
  11. return 'COMPLIANT'
  12. else:
  13. return 'NON_COMPLIANT'
  14.  
  15. ################################
  16. # EDIT ABOVE THIS COMMENT ONLY #
  17. ################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement