mongodbatlas-cloudformation-resources
mongodbatlas-cloudformation-resources copied to clipboard
Enum related cluster creation error
Is there an existing issue for this?
- [X] I have searched the existing issues
CFN Resource version
v2.0.0
CFN Resource Region
eu-central-1
Current Behavior
Cluster creation using the CfnCluster CDK construct fails with the following error:
Resource handler returned message: "https://cloud.mongodb.com/api/atlas/v2/groups/xxx/clusters POST: HTTP 400 Bad Request (Error code: "INVALID_ENUM_VALUE") Detail: An invalid enumeration value was specified. Reason: Bad Request. Params: []" (RequestToken: c8e86d90-7bc3-b702-a78c-605e34649745, HandlerErrorCode: InvalidRequest)
The details message contains two spaces between "value" and "was" which suggests that an empty string was sent as an enum value.
I checked the enum valued properties in CfnClusterProps
. I found that the error disappears when ebsVolumeType: 'STANDARD'
is set in the electableSpecs
property. Setting the ebsVolumeType
property should not be necessary. The MongoDB Atlas Admin API/createCluster operation documents the ebsVolumeType
property to have 'STANDARD'
as default.
I guess that the CfnCluster
resource sends an empty string for the ebsVolumeType
when that property is not set in CfnClusterProps
. Unfortunately, the error does not always happen. I could create clusters without having that property set. However, within a specific account and specifc CfnClusterProps
this error is reproducable.
CFN template to reproduce the issue
"instance": {
"Type": "MongoDB::Atlas::Cluster",
"Properties": {
"BackupEnabled": true,
"ClusterType": "REPLICASET",
"DiskSizeGB": 10,
"ProjectId": {
"Ref": "SsmParameterValuepaymentmongoatlasprojectIdC96584B6F00A464EAD1953AFF4B05118Parameter"
},
"Name": "payment-live",
"ReplicationSpecs": [
{
"NumShards": 1,
"AdvancedRegionConfigs": [
{
"RegionName": "EU_CENTRAL_1",
"ElectableSpecs": {
"InstanceSize": "M10",
"NodeCount": 3
},
"Priority": 7
}
]
}
]
}
}
Steps To Reproduce
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Thanks for opening this issue! Please make sure to provide the following information to help us reproduce the issue:
- Complete cloud formation template used by the customers
- List of Public CFN Resources that are activated in the AWS account with their release version
- AWS Region where the CFN stack is running
- The policies and service principals of the IAM role that is used to activate the CFN resource and run the CFN template (if any). Note that passing an IAM role to CloudFormation when creating a stack is optional. If you don't supply one, the user permissions are assumed. See the IAM permissions section in the General information guide for more information.
The ticket CLOUDP-228190 was created for internal tracking.
Hi @StefanWachter1507, we appreciate you raising this issue with us. The team will consider this bug and triage it. Since you have a workaround, could you please kindly tell us if this is blocking you somehow? Thank you!
We are not blocked by this issue.
This issue has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!
bump
This issue has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!
bump
This issue has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!