Skip to content
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_elasticache): CfnUser.AuthenticationModeProperty incorrectly synthesizes Type #28397

Closed
FarrOut opened this issue Dec 17, 2023 · 2 comments
Labels
@aws-cdk/aws-elasticache Related to Amazon ElastiCache bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@FarrOut
Copy link

FarrOut commented Dec 17, 2023

Describe the bug

CfnUser.AuthenticationModeProperty incorrectly synthesizes to type rather than Type.

Expected Behavior

  "ECadmin": {
   "Type": "AWS::ElastiCache::User",
   "Properties": {
    "AccessString": "on ~* +@all",
    "AuthenticationMode": {
     "Type": "iam"
    },
    "Engine": "redis",
    "NoPasswordRequired": false,
    "UserId": "ec-admin",
    "UserName": "ec-admin"
   },

Current Behavior

"ECadmin": {
   "Type": "AWS::ElastiCache::User",
   "Properties": {
    "AccessString": "on ~* +@all",
    "AuthenticationMode": {
     "type": "iam"
    },
    "Engine": "redis",
    "NoPasswordRequired": false,
    "UserId": "ec_admin",
    "UserName": "ec_admin"
   },
UPDATE_FAILED        | AWS::ElastiCache::User     | ElastiCacheNestedStack/ECadmin (ECadmin) Properties validation failed for resource ECadmin with message:
#/AuthenticationMode: required key [Type] not found
#/AuthenticationMode: extraneous key [type] is not permitted

Reproduction Steps

        admin_user = elasticache.CfnUser(
            self,
            "ECadmin",
            engine="redis",
            user_id="ec-admin",
            user_name="ec-admin",
            access_string="on ~* +@all",
            authentication_mode=elasticache.CfnUser.AuthenticationModeProperty(
                type="iam",
            ),
            no_password_required=False
        )

Possible Solution

admin_user = elasticache.CfnUser(
    self,
    "ECadmin",
    engine="redis",
    user_id="ec-admin",
    user_name="ec-admin",
    access_string="on ~* +@all",
    authentication_mode= {"Type": "iam"},
    no_password_required=False
)

Additional Information/Context

No response

CDK CLI Version

2.115.0 (build 58027ee)

Framework Version

No response

Node.js Version

v20.10.0

OS

Win10

Language

Python

Language Version

Python 3.12.0

Other information

No response

@FarrOut FarrOut added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 17, 2023
@github-actions github-actions bot added the @aws-cdk/aws-elasticache Related to Amazon ElastiCache label Dec 17, 2023
@pahud
Copy link
Contributor

pahud commented Dec 18, 2023

authentication_mode is type Any(doc) and you will need to pass a JSON instead

I think your possible solution should work.

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 18, 2023
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-elasticache Related to Amazon ElastiCache bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants