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
2 times, most recently
from
July 27, 2026 00:42
221e217 to
08017e7
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
colachg
force-pushed
the
cola/fix/fix-warnings
branch
from
August 19, 2026 00:27
08017e7 to
0996b3a
Compare
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
August 19, 2026 00:29
0996b3a to
46a3dac
Compare
Author
|
@edersonbrilhante done as you suggested — the outputs now list the full attribute set, so the contract is kept. Only the deprecated keys are gone: inline_policy and managed_policy_arns on the roles, acl / policy / website_* / acceleration_status / request_payer and the deprecated nested blocks on the bucket. Reading those is what triggers the warning, so they can't stay. |
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
With Terraform 1.12+ and AWS provider v6, every plan/apply prints
Warning: Value derived from a deprecated source(38 times in our deployment). See #5159.Cause: outputs that export whole resource objects.
aws_iam_role(deprecatedinline_policy,managed_policy_arns) inlambda,runners,runners/pool,runner-binaries-syncer,webhook/direct,webhook/eventbridge,ami-housekeeper;aws_s3_bucket(deprecatedacl,policy,website_*,acceleration_status,request_payer) inrunner-binaries-syncer.Fix
Those outputs now list the resource attributes explicitly, as suggested by @edersonbrilhante, so the output contract is preserved. Only the deprecated keys are dropped — reading them is what triggers the warning. Everything else keeps the same name and type, so
module.runners.role_runner[0].arn,webhook.role.nameandbucket.idstill work. No consumer changes needed: in-repo consumers only readid/arn/name.Why not wait for Terraform 1.16?
hashicorp/terraform#38778 fixes this upstream, but only in 1.16 (
v1.16.0-rc1). This module allows>= 1.3.0, so users on 1.12–1.15 keep the warnings until they can upgrade. These outputs can go back to whole resources once 1.16 is common.Testing
terraform validatepasses for the root module andmulti-runner,webhook,termination-watcher,lambda.terraform fmt -checkclean. Rebased onmain. Only output expressions change, so a plan against existing state shows no resource changes.Fixes #5159