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

NewRelic provider: How to pass policy_id parameter to NrqlAlertCondition #3642

Closed
1 task
saleemjaffer opened this issue Jun 4, 2024 · 3 comments
Closed
1 task
Labels
bug Something isn't working new Un-triaged issue pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager

Comments

@saleemjaffer
Copy link

saleemjaffer commented Jun 4, 2024

Expected Behavior

I am trying to create an NrqlAlertCondition. This requires a policy_id parameter.

Before creation of NrqlAlertCondition, I am creating an AlertPolicy. I should be able to pass id of the AlertPolicy to policy_id of NrqlAlertCondition

Actual Behavior

policy_id of NrqlAlertCondition accepts an int or float. The policy.id that we get from AlertPolicy is a string like ${TfToken[TOKEN.244]} and hence can't typecast and pass this to policy_id

Steps to Reproduce

  1. Create a NewRelic alert policy.
  2. Create a NewRelic alert condition using the Id of the policy created in the previous step.

Versions

language: python
cdktf-cli: 0.20.7
node: v20.14.0
cdktf: 0.20.7
constructs: 10.3.0
jsii: 1.98.0
terraform: 1.7.5
arch: arm64
os: darwin 23.3.0
python: Python 3.9.7
pip: pip 21.2.3 from /Users/saleem.majeeth/.pyenv/versions/3.9.7/envs/playground-3.9.7/lib/python3.9/site-packages/pip (python 3.9)
pipenv: pipenv, version 2023.12.1
providers
cdktf-cdktf-provider-newrelic (PREBUILT)
        terraform provider version: 3.37.1 
        prebuilt provider version: 12.8.1
        cdktf version: ^0.20.0

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

newrelic/terraform-provider-newrelic#1940

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@saleemjaffer saleemjaffer added bug Something isn't working new Un-triaged issue pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager labels Jun 4, 2024
@DanielMSchmidt
Copy link
Contributor

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.

@saleemjaffer
Copy link
Author

@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
     │ 
     ╵

Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2024
@xiehan xiehan changed the title PROVIDER_NAME: cdktf_cdktf_provider_newrelic NewRelic provider: How to pass policy_id parameter to NrqlAlertCondition Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working new Un-triaged issue pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager
Projects
None yet
Development

No branches or pull requests

2 participants