How to exclude a BOM import?

Is it possible to exclude a BOM import? I have a micronaut dependency and in some point in the dependency resolution it tries to resolve aws bom:

ModuleVersionNotFoundException: Could not find

I don’t use aws so im trying to exclude aws bom with the transitive dependencies, i tried with a global exclude:

configurations.all {
exclude group: ‘’, module: ‘micronaut-aws-bom’

but it doesn’t work, is there a way to exclude/ignore BOM resolution?