Closed saleemjaffer closed 5 months ago
Hey, I think this page about Tokens might help you. You can typecast, it's just not the native language typecast but you have to use the typecast on the Token
class, it has a bunch of static methods to get from type a to b.
@DanielMSchmidt I tried the same earlier, and I am getting huge negative numbers.
⠙ Processing
[2024-06-13T15:56:13.186] [ERROR] default - ╷
│ Error: Attribute must be a whole number, got -1.8881545897087635e+289
│
│ with newrelic_nrql_alert_condition.oaac_test_dev_test-group_23730378,
│ on cdk.tf.json line 5908, in resource.newrelic_nrql_alert_condition.oaac_test_dev_test-group_23730378:
│ 5908: "policy_id": -1.8881545897087635e+289
│
dev ╷
│ Error: Attribute must be a whole number, got -1.8881545897087635e+289
│
│ with newrelic_nrql_alert_condition.oaac_test_dev_test-group_23730378 (oaac_test_dev_test-group_23730378),
│ on cdk.tf.json line 5908, in resource.newrelic_nrql_alert_condition.oaac_test_dev_test-group_23730378 (oaac_test_dev_test-group_23730378):
│ 5908: "policy_id": -1.8881545897087635e+289
│
╵
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.
Expected Behavior
I am trying to create an
NrqlAlertCondition
. This requires apolicy_id
parameter.Before creation of
NrqlAlertCondition
, I am creating anAlertPolicy
. I should be able to passid
of theAlertPolicy
topolicy_id
ofNrqlAlertCondition
Actual Behavior
policy_id
ofNrqlAlertCondition
accepts an int or float. Thepolicy.id
that we get fromAlertPolicy
is a string like${TfToken[TOKEN.244]}
and hence can't typecast and pass this topolicy_id
Steps to Reproduce
Versions
Providers
newrelic/newrelic │ 3.37.1 │ ^0.20.0 │ │ cdktf-cdktf-provider-newrelic │ 12.8.1
Gist
No response
Possible Solutions
No response
Workarounds
No response
Anything Else?
No response
References
https://github.com/newrelic/terraform-provider-newrelic/issues/1940
Help Wanted
Community Note