Skip to content

Add back ecr.getCredentials data source from v6 - #6590

Merged
corymhall merged 3 commits into
masterfrom
add-ecr-getCredentials
Aug 4, 2026
Merged

Add back ecr.getCredentials data source from v6#6590
corymhall merged 3 commits into
masterfrom
add-ecr-getCredentials

Conversation

@corymhall

Copy link
Copy Markdown
Member

In the v7 release we removed the old ecr.getCredentials data source. This datasource did not exist in upstream Terraform, it was added as a new datasource in a patch. Upstream added their own official datasource to achieve the same functionality ecr.getAuthorizationToken. This datasource is better in several ways and gives the same functionality.

To give users extra time to migrate we are adding back the old getCredentials datasource, but we are doing it by adding a shim/proxy to the getAuthorizationToken data source.

The specific customizations that we have made on top are to keep complete backwards compatibility with the v6 version of getCredentials.

Change Type

  • Provider logic only (provider/)
  • Schema or mapping change (may require SDK regeneration)
  • Upstream or patch pipeline change (upstream/, patches/, scripts/upstream.sh)
  • CI workflow source change (.ci-mgmt.yaml)

Risk

The main risk is that this is not 100% compatible with the v6 version of the datasource. We've added upgrade tests to validate that it is. If there are some compatibility issues then we will fix forward.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcfd4ffe3b

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread provider/resources.go Outdated
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

Generated by schema-tools v0.8.1.

Looking good! No breaking changes found.

New functions:

  • ecr/getCredentials.getCredentials

Maintainer note: consult the runbook for dealing with any breaking changes.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 15.84%. Comparing base (6d86d4b) to head (03e9f89).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6590   +/-   ##
=======================================
  Coverage   15.84%   15.84%           
=======================================
  Files         376      376           
  Lines       91883    91883           
=======================================
  Hits        14558    14558           
  Misses      77304    77304           
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@corymhall
corymhall requested a review from pulumi-eon August 3, 2026 13:51
@eon-pulumi

eon-pulumi Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Verdict: Comment Only

Implementation is clean, well tested, and verified faithful to v6 semantics (id==registry_id, required registryId, non-secret authorizationToken), with all currently-reported CI checks green — but this re-adds a public Pulumi data source across all generated SDKs, and the PR description itself acknowledges full v6 parity isn't 100% verified yet, so a human should own the compatibility contract before it ships.


View session · Was this review helpful? Yes · No

@eon-pulumi-agent eon-pulumi-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the ECR getCredentials back-compat shim: the new addLegacyECRCredentialsDataSource wrapper in provider/resources.go, the bridge Field overrides (registryId required, region omitted, authorizationToken not-secret), the regenerated schema/SDKs for all five languages, and the new acceptance/upgrade tests in examples/examples_yaml_test.go.

Verified against the actual v6.66.2 release (schema + the original patches/0009-Add-ECR-credentials_data_source.patch): the shim correctly reproduces v6's id == registry_id semantics (v6 set id from registry_id; the new upstream aws_ecr_authorization_token sets id from region), keeps registryId required, and keeps authorizationToken un-marked as a Pulumi secret exactly as v6 did. The extra userName/password outputs are additive (not present in v6) and don't break existing v6 programs. go build on the provider package succeeds, and all currently-reported CI checks (schema build, compare_sdk/build_sdk for all five languages, license check) are green; a few test_provider/build_provider/upstream_tests jobs were still running at review time with no failures.

No bugs, security, or correctness issues that would block merge were found. Three non-blocking nits below: the new example fixture's directory placement deviates from the documented examples/test-programs/<name> convention, authorizationToken and password protect the same underlying credential but only one is marked secret (worth a doc/comment clarification), and the new acceptance test never actually asserts that authorizationToken/userName remain non-secret (so a future regression there wouldn't be caught).

This PR reintroduces a public Pulumi data source (aws.ecr.getCredentials) across all generated SDKs. Once released, downstream users will begin depending on it again, and the PR description itself flags that full v6 parity is not yet 100% verified ("if there are some compatibility issues then we will fix forward") -- that combination of a public API re-addition and an author-acknowledged compatibility risk is the kind of one-way door worth a human sign-off on the exact compatibility contract, even though the implementation itself looks correct and is well tested.

Comment thread examples/examples_yaml_test.go Outdated
Comment thread provider/resources.go
Comment thread examples/examples_yaml_test.go

@eon-pulumi-agent eon-pulumi-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the follow-up commit (56b17d7f2, "updates based on eon review"). All three nits from the previous round are addressed:

  • The ecr-credentials example program moved to examples/test-programs/ecr-credentials/, and both TestAccEcrCredentials and TestEcrCredentialsUpgrade now reference it via filepath.Join(..., "test-programs", "ecr-credentials"), matching the convention used by every other fixture in this file.
  • provider/resources.go now has a code comment on the authorization_token Field override explaining it's intentionally non-secret for v6 compatibility even though it base64-encodes the same credential as the (secret) password field.
  • validateEcrCreds now asserts result.Outputs["userName"].Secret is false, closing the test-coverage gap on that compatibility guarantee.

No new issues in the incremental diff, which is limited to the rename and these three small additions. CI is green (schema build, compare_sdk/build_sdk across all five languages, test_provider, license check), with only a couple of build_provider/upstream_tests jobs still in progress and nothing failing.

@corymhall
corymhall requested a review from a team August 3, 2026 14:57
In the v7 release we removed the old `ecr.getCredentials` data source.
This datasource did not exist in upstream Terraform, it was added as a
new datasource in a patch. Upstream added their own official datasource
to achieve the same functionality `ecr.getAuthorizationToken`. This
datasource is better in several ways and gives the same functionality.

To give users extra time to migrate we are adding back the old
`getCredentials` datasource, but we are doing it by adding a shim/proxy
to the `getAuthorizationToken` data source.

The specific customizations that we have made on top are to keep
complete backwards compatibility with the v6 version of
`getCredentials`.
@corymhall
corymhall force-pushed the add-ecr-getCredentials branch from 56b17d7 to 03e9f89 Compare August 4, 2026 09:18
@corymhall
corymhall enabled auto-merge (squash) August 4, 2026 09:37
@corymhall
corymhall merged commit 97704c1 into master Aug 4, 2026
36 of 37 checks passed
@corymhall
corymhall deleted the add-ecr-getCredentials branch August 4, 2026 10:17
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v7.41.0.

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.

3 participants