-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-rds): "DatabaseSecret" is incompatible with protocol "ISecret" #27852
Comments
Duplicate of aws/jsii#4541 |
Hi @anentropic , this code works fine for me and I am able to pass the database secret.
|
@khushail the code works ok, but I get type errors in my IDE I can "solve" it by but it seems to defeat the purpose of having interface type like |
Similar to #21099 and already being tracked in aws/jsii#4541 |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
I get a type error when passing DatabaseSecret in places where a DatabaseSecret is expected
Expected Behavior
rds.Credentials.from_secret(db_secret)
docstring for
from_secret
says "Creates Credentials from an existing Secrets Manager Secret (or DatabaseSecret)."so I should be able to pass a DatabaseSecret without getting a type error
Current Behavior
Error from Pyright in VS Code:
Argument of type "DatabaseSecret" cannot be assigned to parameter "secret" of type "ISecret" in function "from_secret"
"DatabaseSecret" is incompatible with protocol "ISecret"
"secret_value_from_json" is an incompatible type
Type "(json_field: str) -> SecretValue" cannot be assigned to type "(key: str) -> SecretValue"
Parameter name mismatch: "key" versus "json_field"PylancereportGeneralTypeIssues
Reproduction Steps
Possible Solution
I guess make the naming consistent with the interface it's supposed to implement
Additional Information/Context
No response
CDK CLI Version
2.104.0 (build 3b99abe)
Framework Version
2.102.0
Node.js Version
v18.18.0
OS
macOS 14.1
Language
Python
Language Version
3.11
Other information
No response
The text was updated successfully, but these errors were encountered: