Hi team, I recently started using the required_pro...
# atmos
t
Hi team, I recently started using the required_providers, required_version and providers atmos fields and wanted to share some findings and get a sense of whether I'm on the right track.
I understood from the documentation that it uses *_override.tf built-in terraform/tofu override manifests, and I've used them in the past so I understand they are intended to be overrides for in-component defined blocks of the same type. Interestingly something I didn't know is that they also appear to work without the original blocks being defined in most cases. So if I had a versions.tf with a terraform block, and I delete the file, but put the same details in atmos required_version, then tofu continues to use the requirements provided without error. Where it doesn't work is for aliased providers. Even without atmos in the mix, tofu throws an error that it needs an original provider definition to override with the alias from *_overrides.tf. I worked around this by creating a script that parses the output of atmos describe to find aliased providers and pre-generate a providers.tf with the aliased providers, so that the overrides work properly. This all works great except for one small thing that I think should probably be fixed in Atmos.
e
I thought we had some way of expressing the alias using dot notation
If not, that's a real gap and please open a GitHub issue for it and we'll address that
t
We do and that isn't the issue.
When using the azurerm provider, it requires a nested
features {}
block inside the
provider {}
block. When I try to generate the
features {}
block from atmos, if I don't include any parameters for the block, the features block doesn't get properly created in the *_override.tf file. In terraform the block looks like this:
Copy code
provider "azurerm" {
  features {}
}
But I'm thinking the yaml parser in atmos sees
features: {}
and strips the field out before it can be put into the *_override.tf.
Because I get an error that my override is missing the features block.
As soon as I add something inside the features object in the yaml, it starts working. So I set a default value explicitly:
prevent_deletion_if_contains_resources: true
e
It sounds like there's something more we need to extend to support your use case but it makes sense
Would you mind opening a GitHub issue for it?
👍 1
t