Closed viralmdesai closed 2 months ago
According to the document here, authentication_mode
is type Any
(not typed) and I believe you should pass a JSON object in this case.
https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_elasticache/CfnUser.html
@pahud - What is the purpose of having a Class in the same documentation? here: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_elasticache/CfnUser.html#authenticationmodeproperty
class CfnUser.AuthenticationModeProperty(*, type, passwords=None)?
In other languages too this generates the class which results in incorrect Cloudformation as described in the case?
@pahud I faced the same issue but using Java with CDK 2.133.0.
In Java there is no simple solution like providing JSON object.
Is there a plan to fix this issue in the near future?
@Mateusz-Stasielowicz I faced the same issue with Java CDK, as a workaround you could use a Map like:
CfnUser.Builder.create(scope, "MyId")
.userId("user-1")
.engine("redis")
.userName("user-1")
.accessString("on ~* +@all")
.authenticationMode(Map.of("Type", "iam"))
.build();
@Mateusz-Stasielowicz
Thank you. The doc for Java could be very confusing. I will bring this up to the team. Meanwhile, please try the workaround by @Mateusz-Stasielowicz and let me know if it works for you.
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.
This still seems to be an issue in TypeScript
"aws-cdk": "2.151.0", "aws-cdk-lib": "2.151.0"
Describe the bug
When using AuthenticationModeProperty(type="iam"), the synthesized cloudformation is incorrect.
Notice that the generated CloudFormation "type" in lower case for user properties...
"ecuser1": { "Type": "AWS::ElastiCache::User", "Properties": { "AccessString": "on ~* +@all", "AuthenticationMode": { "type": "iam" }, "Engine": "redis", "UserId": "ec-user-1", "UserName": "ec-user-1" },
...
authenticationMode?: any | cdk.IResolvable;
Should it be
authenticationMode?: CfnUser.AuthenticationModeProperty | cdk.IResolvable;