fix: expose selected output attributes to avoid deprecated source warnings - #5224
Open
colachg wants to merge 2 commits into
Open
fix: expose selected output attributes to avoid deprecated source warnings#5224colachg wants to merge 2 commits into
colachg wants to merge 2 commits into
Conversation
Contributor
|
This would be a breaking change in the output contract. Let's say someone uses another property that is not deprecated. |
Contributor
|
If going forward with this fix, I think we should keep the same output contract |
colachg
force-pushed
the
cola/fix/fix-warnings
branch
from
July 27, 2026 00:40
4ee7547 to
221e217
Compare
…nings Terraform 1.12+ with AWS provider v6 emits 'Value derived from a deprecated source' warnings for every module output that exports a whole aws_iam_role (managed_policy_arns is deprecated) or aws_s3_bucket (acl, policy, website_*, acceleration_status, request_payer are deprecated) resource. Replace whole-resource role and bucket outputs with explicit attribute objects (id, arn, name for roles; id, arn, bucket, region for the distribution bucket). All internal consumers only read these attributes. Fixes github-aws-runners#5159
Instead of exposing only id/arn/name, list every non-deprecated attribute of aws_iam_role and aws_s3_bucket so existing consumers of these module outputs keep working. Only the attributes that trigger "Value derived from a deprecated source" warnings are dropped: - aws_iam_role: managed_policy_arns, inline_policy - aws_s3_bucket: acceleration_status, acl, policy, request_payer, website_domain, website_endpoint, cors_rule, grant, lifecycle_rule, logging, object_lock_configuration, replication_configuration, server_side_encryption_configuration, versioning, website Attribute lists are taken from the provider schema at the modules' minimum supported version (aws 6.21), so bucket_namespace is intentionally excluded.
colachg
force-pushed
the
cola/fix/fix-warnings
branch
from
July 27, 2026 00:42
221e217 to
08017e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Terraform 1.12+ together with AWS provider v6 emits a large number of
Warning: Value derived from a deprecated sourcewarnings on every plan/apply (38 in our deployment). See #5159.The cause is module outputs that export whole resource objects:
aws_iam_role—managed_policy_arnsis deprecated, so every output exporting a full role resource (directly or nested in an object) triggers the warning. Affected:modules/lambda,modules/runners(role_runner,role_scale_up,role_scale_down),modules/runners/pool,modules/runner-binaries-syncer,modules/webhook/direct,modules/webhook/eventbridge,modules/ami-housekeeper.aws_s3_bucket—acl,policy,website_domain,website_endpoint,acceleration_status,request_payerare deprecated; thebucketoutput inmodules/runner-binaries-syncerexports the full bucket resource.Fix
Replace whole-resource outputs with explicit attribute objects:
{ id, arn, name }(role_runnerkeeps its list shape via aforexpression){ id, arn, bucket, region }All in-repo consumers of these outputs only read
id/arn/name(verified by grep), including the pass-through re-exports in the root module,multi-runner,webhook,termination-watcher, andjob-retry— so no other code changes are needed.Compatibility note
The output types change from full resource objects to small attribute objects. Access paths like
module.runners.role_runner[0].arnorwebhook.role.namekeep working, but users reading other role/bucket attributes from these outputs (e.g.assume_role_policy) would break. Happy to adjust the attribute set or split the PR if you prefer.Testing
terraform validatepasses for the root module andmulti-runner,webhook,termination-watcher,lambda.terraform fmt -checkclean.Fixes #5159