Skip to content

fix(redshift-alpha): replace deprecated Provider role with frameworkOnEventRole#37465

Open
syukawa-gh wants to merge 2 commits intoaws:mainfrom
syukawa-gh:fix/redshift-deprecated-provider-role
Open

fix(redshift-alpha): replace deprecated Provider role with frameworkOnEventRole#37465
syukawa-gh wants to merge 2 commits intoaws:mainfrom
syukawa-gh:fix/redshift-deprecated-provider-role

Conversation

@syukawa-gh
Copy link
Copy Markdown
Contributor

Issue

Closes #37006

Reason for this change

The DatabaseQuery construct in aws-redshift-alpha was using the deprecated role property on custom_resources.Provider, which triggers deprecation warnings during synthesis:

[WARNING] aws-cdk-lib.custom_resources.ProviderProps#role is deprecated

Description of changes

Replaced role with frameworkOnEventRole in the Provider constructor call in database-query.ts. Since the Redshift DatabaseQuery construct does not use isCompleteHandler, only the frameworkOnEventRole is needed (no frameworkCompleteAndTimeoutRole required).

The behavior is functionally equivalent — the same IAM role is assigned to the framework's onEvent Lambda function.

Description of how you validated changes

  • frameworkOnEventRole is the documented replacement for the deprecated role property
  • The Provider implementation shows that role and frameworkOnEventRole are applied to the same Lambda function via this.role ?? role in createFunction()
  • No isCompleteHandler is used, so only the onEvent role is relevant

Checklist

@github-actions github-actions bot added the admired-contributor [Pilot] contributed between 13-24 PRs to the CDK label Apr 1, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 1, 2026 02:00
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels Apr 1, 2026
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

…nEventRole

The DatabaseQuery construct was using the deprecated 'role' property
on custom_resources.Provider, which triggers deprecation warnings
during synthesis. Replaced with 'frameworkOnEventRole' which is the
recommended replacement.

Closes aws#37006
@syukawa-gh syukawa-gh force-pushed the fix/redshift-deprecated-provider-role branch from 9aeb6c9 to 6dcf7e4 Compare April 1, 2026 08:21
@syukawa-gh
Copy link
Copy Markdown
Contributor Author

Exemption Request: This change is a minimal fix that does not alter CloudFormation resource behavior in a way that requires a new integration test. The fix is covered by unit tests.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Apr 1, 2026
@syukawa-gh
Copy link
Copy Markdown
Contributor Author

Exemption Request: This fix replaces the deprecated Provider role with frameworkOnEventRole in redshift-alpha. Integration test snapshot is unchanged as the synthesized CloudFormation output is identical.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

admired-contributor [Pilot] contributed between 13-24 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-redshift-alpha: Triggers [WARNING] aws-cdk-lib.custom_resources.ProviderProps#role is deprecated

3 participants