[v18] tfgen: support including top-level access list scope field - #69614
[v18] tfgen: support including top-level access list scope field#69614kimlisa wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6cef063fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if scope != nil && !opts.fieldsToOmit["scope"] { | ||
| tokens := valueToTokens(fieldPath{"scope"}, scope.Value, opts, false /* emitZeroVal */) | ||
| if tokens != nil { | ||
| resourceBlock.Body().SetAttributeRaw("scope", tokens) |
There was a problem hiding this comment.
Qualify scoped access-list-member parents
When tfgen is given a scoped access_list_member whose Spec.AccessList is a bare list name (the new test constructs this exact case), this line emits scope, but the generated HCL still leaves spec.access_list bare. The access-list service treats any non-empty member scope as requiring spec.access_list to be scope-qualified (ParentListOf in lib/accesslists/scopequalifiedname.go:142-149 calls ParseScopeQualifiedName), so Terraform apply fails before creating the member; either qualify the parent (/scope::name) when emitting scoped members or reject/normalize this input.
Useful? React with 👍 / 👎.
Backport #69337 to branch/v18