Skip to content

fix: expose selected output attributes to avoid deprecated source warnings - #5224

Open
colachg wants to merge 2 commits into
github-aws-runners:mainfrom
colachg:cola/fix/fix-warnings
Open

fix: expose selected output attributes to avoid deprecated source warnings#5224
colachg wants to merge 2 commits into
github-aws-runners:mainfrom
colachg:cola/fix/fix-warnings

Conversation

@colachg

@colachg colachg commented Jul 23, 2026

Copy link
Copy Markdown

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 (deprecated inline_policy, managed_policy_arns) in lambda, runners, runners/pool, runner-binaries-syncer, webhook/direct, webhook/eventbridge, ami-housekeeper; aws_s3_bucket (deprecated acl, policy, website_*, acceleration_status, request_payer) in runner-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.name and bucket.id still work. No consumer changes needed: in-repo consumers only read id / 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 validate passes for the root module and multi-runner, webhook, termination-watcher, lambda. terraform fmt -check clean. Rebased on main. Only output expressions change, so a plan against existing state shows no resource changes.

Fixes #5159

@colachg
colachg requested a review from a team as a code owner July 23, 2026 08:13
@edersonbrilhante

Copy link
Copy Markdown
Contributor

This would be a breaking change in the output contract. Let's say someone uses another property that is not deprecated.

@edersonbrilhante

Copy link
Copy Markdown
Contributor

If going forward with this fix, I think we should keep the same output contract
example

      arn                   = aws_iam_role.dispatcher_lambda.arn
      assume_role_policy    = aws_iam_role.dispatcher_lambda.assume_role_policy
      create_date           = aws_iam_role.dispatcher_lambda.create_date
      description           = aws_iam_role.dispatcher_lambda.description
      force_detach_policies = aws_iam_role.dispatcher_lambda.force_detach_policies
      id                    = aws_iam_role.dispatcher_lambda.id
      max_session_duration  = aws_iam_role.dispatcher_lambda.max_session_duration
      name                  = aws_iam_role.dispatcher_lambda.name
      name_prefix           = aws_iam_role.dispatcher_lambda.name_prefix
      path                  = aws_iam_role.dispatcher_lambda.path
      permissions_boundary  = aws_iam_role.dispatcher_lambda.permissions_boundary
      tags                  = aws_iam_role.dispatcher_lambda.tags
      tags_all              = aws_iam_role.dispatcher_lambda.tags_all
      unique_id             = aws_iam_role.dispatcher_lambda.unique_id

@colachg
colachg force-pushed the cola/fix/fix-warnings branch 2 times, most recently from 221e217 to 08017e7 Compare July 27, 2026 00:42
…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
colachg force-pushed the cola/fix/fix-warnings branch from 08017e7 to 0996b3a Compare August 19, 2026 00:27
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
colachg force-pushed the cola/fix/fix-warnings branch from 0996b3a to 46a3dac Compare August 19, 2026 00:29
@colachg

colachg commented Aug 19, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webhook depreciation warning

2 participants