Open rokoucha opened 1 week ago
@rokoucha Thank you for your report.
There are two ideas about the specification: one is that we are happy to have constraints at schema level, and the other is that we don't want schema to be dynamic. Please give me some time to review how it is implemented in a general provider and consider pros/cons of making the provider's schema static.
There would be a workaround to set an empty environment variable during code generation by cdktf.
CDKTF is a useful tool that uses terraform like AWS CDK. CDKTF will generate a binding code from terraform providers; most providers work great. However, it behaves strangely in mackerelio-labs/mackerel.
Mackerel provider will check environment variables and change provider argument typing dynamically if defined the
MACKEREL_APIKEY
orMACKEREL_API_KEY
. This also works when the CDKTF generates the binding code, But it doesn't work whenplan
orapply
. Therefore, Environment variable definitions affect the binding code generated by CDKTF, and reproducibility will be lost.Below is the generated code fragment:
If defined the
MACKEREL_APIKEY
orMACKEREL_API_KEY
If not defined any environment variables: