Skip to content

Commit

Permalink
Merge pull request #109 from mitchclarkebase2/fix
Browse files Browse the repository at this point in the history
Add logic for resources with Id in a lower level
  • Loading branch information
tarunmenon95 authored Jun 20, 2023
2 parents 3c23432 + 63de360 commit d7cd28b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/cfnguardian/compile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,18 @@ def get_resources
@resource_groups.each do |group,resources|
resources.each do |resource|
if !resource.has_key?('Id')
@errors << "CfnGuardian::NoIdKeyForResourceError - resource: #{resource} in resource group: #{group} doesn't have the `Id:` key"
next
if !resource.has_key?('Hosts')
@errors << "CfnGuardian::NoIdKeyForResourceError - resource: #{resource} in resource group: #{group} doesn't have the `Id:` key"
next
else
resource['Hosts'].each { |host|
if !host.has_key?('Id')
@errors << "CfnGuardian::NoIdKeyForResourceError - resource: #{resource} in resource group: #{group} doesn't have the `Id:` key"
next
end
}

end
end

begin
Expand Down

0 comments on commit d7cd28b

Please sign in to comment.