Closed iamzhaoxu closed 11 months ago
MaxDeliveryCount
is technically required, but that information is lost when generating the C# bindings (it's present in TypeScript). https://github.com/aws/jsii/issues/715 has more information. C# 11 will potentially have required
properties which may be another way to fix this.
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
cdktf & Language Versions
cdktf : latest version Language: .NET 6.0.101
Affected Resource(s)
Azurerm - Azure ServiceBus Topic Subscription
Debug Output
https://gist.github.com/iamzhaoxu/7735a82b8694b04f9dbfa1519d136dad
Expected Behavior
I will expect the terraform application will not return a 500 error and create the subscription successfully.
Actual Behavior
It returns 500 error with more details links as https://aka.ms/eventhubsarmexceptions. However, there is nothing related to event hub resource at all in my terraform application.
Steps to Reproduce
Use the code below to create the service bus subscription can produce the error in the stack.
Important Factoids
When I try to use the code above to create the subscription, the
cdktf synthn
/ckdtf diff
run successfully and does not return any error. The cdktf.json produce the resource as below:As you see![image](https://user-images.githubusercontent.com/1594894/173009309-affe90fe-c13c-448c-b3ad-15122e417db0.png)
max_delivery_count
is 0 in the file. However, when I check the max_delivery_count on the azure portal, the max delivery count value has a range as 1~ 2000. So the 0 value is not valid for the configuration.The terraform CDK does not consider this value as a mandatory field. If I don't configure it in the code with a specified value, the default value of max_delivery_count will become 0.
cdktf synthn
orckdtf diff
commands do not validate it and let it go through. Then we apply the terraform, it will keep creating the subscription until it timeout and return a 500 error response.It will be great if we can fail this with a proper reason before the terraform apply.