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: CfnReplicationGroup cluster mode is missing types #33365

Open
nickdnk opened this issue Feb 10, 2025 · 3 comments
Open

aws-elasticache: CfnReplicationGroup cluster mode is missing types #33365

nickdnk opened this issue Feb 10, 2025 · 3 comments
Labels
@aws-cdk/aws-elasticache Related to Amazon ElastiCache documentation This is a problem with documentation. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed.

Comments

@nickdnk
Copy link

nickdnk commented Feb 10, 2025

Describe the issue

Hello

The clusterMode property of the CfnReplicationGroup component should not be a plain string type, but 'enabled' | 'disabled' | undefined. The documentation (incorrectly?) lists the valid options for this property as Disabled or Enabled, with a capital D/E, which causes problems when you try to deploy, such as incorrectly triggering Cluster mode updates are not supported while attempting to update additional properties. If you instead change to lower-case typing in the CDK, it seems to work as expected. This is described in this thread as well.

So it seems that https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-replicationgroup.html#cfn-elasticache-replicationgroup-clustermode is either incorrect or that the output produced by the CDK is different from its input (i.e. lowercase in CDK but titelcase in the API).

Either way, correctly typing this in the CDK would avoid this issue entirely.

Links

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-replicationgroup.html#cfn-elasticache-replicationgroup-clustermode

@nickdnk nickdnk added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@github-actions github-actions bot added the @aws-cdk/aws-elasticache Related to Amazon ElastiCache label Feb 10, 2025
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@khushail khushail self-assigned this Feb 10, 2025
@khushail
Copy link
Contributor

khushail commented Feb 10, 2025

Hi @nickdnk , thanks for reporting this. I checked API reference for ElasticCache, which mentions about ClusterMode values to be with lowercase as this -

ClusterMode

    Enabled or Disabled. To modify cluster mode from Disabled to Enabled, you must first set the cluster mode to Compatible. Compatible mode allows your Valkey or Redis OSS clients to connect using both cluster mode enabled and cluster mode disabled. After you migrate all Valkey or Redis OSS clients to use cluster mode enabled, you can then complete cluster mode configuration and set the cluster mode to Enabled.

    Type: String

    Valid Values: enabled | disabled | compatible

    Required: No


which looks to be different from what's mentioned in Cloudformation docs -

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache.CfnReplicationGroup.html#clustermode

IMO, this could be corrected to avoid confusion when setting the values. Since this is reg. the Cfn construct level documentation, this would need to be handled by cloudformation team. I would be filing issue with them and you could track that for updates.

Thanks.

@khushail khushail added needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Feb 10, 2025
@khushail
Copy link
Contributor

@nickdnk , issue created with Cloudformation team for doc update -aws-cloudformation/cloudformation-coverage-roadmap#2256

@khushail khushail removed their assignment Feb 10, 2025
@nickdnk
Copy link
Author

nickdnk commented Feb 10, 2025

Hello
Great, thanks.

I would still argue that the type constraint issue belongs in this repo: It should not be a plain string when it only accepts a small set of enumerated values, such as enabled, disabled and compatible.

Edit: Okay, maybe that is already what's happening here. If so, then cool.

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 documentation This is a problem with documentation. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed.
Projects
None yet
Development

No branches or pull requests

2 participants