You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provider version 1.0.84 forces both sides of the Integration/Monitor† relationship to be defined, which is inappropriate. Other providers do this via association resources or they allow the relationship to be set on one side of the relationship.
†There may be other circular resource dependencies in the provider that need to be worked out, as well, but I'm starting with this one.
I'd suggest studying how some of the big providers do many-to-many relationships and pick/implement an option that makes sense.
There are problems with the current behavior. Here are two of them:
I must remember to modify the relationship on both sides, otherwise I get a problematic terraform plan.
There is a circular dependency between the two, so I am forced to hardcode an ID on one of the sides. For instance:
resource"site24x7_slack_integration""experimental" {
...# i have to do this:monitors=["207348000022635025"]
# because i cannot do this, due to the circular dependency.monitors=[site24x7_website_monitor.home_page__stage__jaj_test.id]
}
resource"site24x7_website_monitor""home_page__stage__jaj_test" {
...third_party_service_ids=[
site24x7_slack_integration.experimental.id
]
}
At first blush, I think it probably makes the most sense to define the integration relationship from the monitor side, which would look like this:
resource"site24x7_slack_integration""experimental" {
...# _no_ monitors array specified!
}
resource"site24x7_website_monitor""home_page__stage__jaj_test" {
...# monitor defines which integrations it hasthird_party_service_ids=[
site24x7_slack_integration.experimental.id
]
}
Here is the fuller example of my current, problematic use case, as I am forced to implement it now.
resource"site24x7_slack_integration""experimental" {
alert_tags_id=[]
critical_alert=truedown_alert=truemonitors=["207348000022635025"]
name="JAJ Test Default (#experimental) Webhook)"selection_type=2sender_name="Site24x7"tags=[]
title="$MONITORNAME is $STATUS"trouble_alert=trueurl=data.aws_ssm_parameter.slack_webhook_url__default.value
}
# I'm using this to experiment with https://github.com/site24x7/terraform-provider-site24x7/issues/261resource"site24x7_website_monitor""home_page__stage__jaj_test" {
display_name="JAJ test"website="https://stage.example.com/"check_frequency="1"credential_profile_id=local.credentials.stage_basic_auth_idignore_cert_err=falselocation_profile_id=site24x7_location_profile.united_states.idmatch_regex_severity=2matching_keyword_severity=0matching_keyword_value="need housing assistance"timeout=30unmatching_keyword_severity=2use_name_server=falsemonitor_groups=[]
third_party_service_ids=[
site24x7_slack_integration.experimental.id
]
}
The text was updated successfully, but these errors were encountered:
We wanted to start using terraform for setup and we got the same issue with webhook integration. Hopefully someone work on this bug. We use version 1.0.90
Provider version 1.0.84 forces both sides of the Integration/Monitor† relationship to be defined, which is inappropriate. Other providers do this via association resources or they allow the relationship to be set on one side of the relationship.
†There may be other circular resource dependencies in the provider that need to be worked out, as well, but I'm starting with this one.
I'd suggest studying how some of the big providers do many-to-many relationships and pick/implement an option that makes sense.
There are problems with the current behavior. Here are two of them:
terraform plan
.At first blush, I think it probably makes the most sense to define the integration relationship from the monitor side, which would look like this:
Here is the fuller example of my current, problematic use case, as I am forced to implement it now.
The text was updated successfully, but these errors were encountered: