Ignore resource overwrite warnings if they are aws resources

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-02-20 15:38:15 -05:00
parent 73f2f50e78
commit d96fbb8cfc

View file

@ -147,7 +147,10 @@ module Inspec
end end
# rubocop:enable Lint/NestedMethodDefinition # rubocop:enable Lint/NestedMethodDefinition
if __resource_registry.key?(name)
# Warn if a resource pack is overwriting a core resource.
# Suppress warning if the resource is an AWS resource, see #3822
if __resource_registry.key?(name) && !name.start_with?('aws_')
Inspec::Log.warn("Overwriting resource #{name}. To reference a specific version of #{name} use the resource() method") Inspec::Log.warn("Overwriting resource #{name}. To reference a specific version of #{name} use the resource() method")
end end
__resource_registry[name] = cl __resource_registry[name] = cl