Checks: Add support for scoped resources.#32732
Conversation
d0a15b7 to
de03bec
Compare
jbardin
left a comment
There was a problem hiding this comment.
The changes LGTM! Though I don't think I see any tests checking what happens when something is referenced from the incorrect scope.
Yeah, the way the existing tests are all configured is that they use real configuration to load and execute against, and we don't have anything right now that actually uses the scope to validate whether it's working or not working. The WIP graph PR further down the chain actually hooks everything up and includes tests for scoped/unscoped access etc. |
|
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR adds support for scoped resources into the Terraform configuration language.
Containerinterface within theconfigspackage.configs.Resourcestructure.source.As of this PR, this new functionality is not used. As such all
sourcereferences are set tonil, indicating they have only the default level of access and cannot access anything within a container.In the longer term, only items that know they might need to access containerised resources will need to set the
sourceargument which at the moment will only be the newCheckblocks.As nothing is using this functionality it was challenging to write tests within the existing frameworks. Unit tests for scoped resources are added later in the chain (liamcervante/checks/graph) when we have config and implementation that actually use the new functionality.
This PR is part of chain of PRs introducing the new Checks feature into Terraform for v1.5. The chain of PRs is as follows:
I have created the chain to make reviewing the smaller contained part of the process easier. IF you want to view all the changes together in a single PR, navigate to the last PR in the chain and compare it to the main branch and you will see all changes from all prior PRs in a single place.