I actually was leaning towards B since managing actions based on differences feels like more of what Terraform Core does, but now that I review it, providers need to know what actions to take for the resources they manage. The real trick here is D-provisioning across multiple platforms isn't a provider's job at all. I thought B at first due to the wording, anyone else make that mistake?
Would go with B here. Modules only get access to what you pass via module inputs, they don't inherit parent variables unless sent explicitly. Makes it very predictable but sometimes I forget that edge case when refactoring big configs. Unless the question is about outputs or data sources (which can be shared differently), this fits Terraform's module scope rules. Anyone disagree if the variable's output from the parent though?
I could see why someone might pick A, since sometimes it feels like child modules should just inherit from parents if the variables are declared up top. But unless you use explicit inputs in the module block, those variables aren't automatically available. Pretty sure that's a common trip-up. Disagree?
This came up for me too on practice questions, it's B. Child modules can't just reach into parent variables, they have to get them passed in as inputs. Keeps things nice and isolated I think.
Probably A and D here, since IaC is really about repeatability and version control. B is a trap because costs don't go down just by using code, and preventing manual changes (E) isn't really guaranteed. Does the question specify if some manual intervention is still allowed? That could change things.
-var and sourcing from a secret manager keeps things safer. Pretty standard CI/CD handling from what I've seen.I remember a similar scenario from labs. "Secure string" isn’t a native Terraform thing, more of an AWS Parameter Store concept. The others (provider, env vars, -var flag) can all be used for secrets. Not totally sure but leaning toward D.
[Interact with Terraform Modules]
You have deployed a new webapp with a public IP address on a cloud provider. However, you did not
create any outputs for your code. What is the best method to quickly find the IP address of the
resource you deployed?
terraform state show when outputs aren't set up. If you're prepping, definitely check the Terraform docs on state commands and run some quick lab tests.