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

Terraform 1.12+ together with AWS provider v6 emits a large number of Warning: Value derived from a deprecated source warnings on every plan/apply (38 in our deployment). See #5159.

The cause is module outputs that export whole resource objects:

  • aws_iam_rolemanaged_policy_arns is 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_bucketacl, policy, website_domain, website_endpoint, acceleration_status, request_payer are deprecated; the bucket output in modules/runner-binaries-syncer exports the full bucket resource.

Fix

Replace whole-resource outputs with explicit attribute objects:

  • roles → { id, arn, name } (role_runner keeps its list shape via a for expression)
  • bucket → { 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, and job-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].arn or webhook.role.name keep 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 validate passes for the root module and multi-runner, webhook, termination-watcher, lambda.
  • terraform fmt -check clean.
  • Since only output expressions change, a plan against existing state should show zero resource changes; we will verify this against our deployment and report back here.

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 from 4ee7547 to 221e217 Compare July 27, 2026 00:40
colachg added 2 commits July 27, 2026 09:41
…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
colachg force-pushed the cola/fix/fix-warnings branch from 221e217 to 08017e7 Compare July 27, 2026 00:42
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