-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, we have errors with two oncall resources: - Schedule: `web` type schedules are fetched but they can't be managed with TF - Escalation: Mutually exclusive attributes are being set. With this change, all `nil` attributes won't be set in the TF state (rather than a zero value)
- Loading branch information
1 parent
a30cca8
commit b7983e0
Showing
8 changed files
with
258 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
pkg/generate/testdata/generate/oncall-resources/imports.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { | ||
to = grafana_oncall_escalation._{{ .EscalationID }} | ||
id = "{{ .EscalationID }}" | ||
} | ||
|
||
import { | ||
to = grafana_oncall_escalation_chain._{{ .EscalationChainID }} | ||
id = "{{ .EscalationChainID }}" | ||
} | ||
|
||
import { | ||
to = grafana_oncall_integration._{{ .IntegrationID }} | ||
id = "{{ .IntegrationID }}" | ||
} | ||
|
||
import { | ||
to = grafana_oncall_schedule._{{ .ScheduleID }} | ||
id = "{{ .ScheduleID }}" | ||
} |
15 changes: 15 additions & 0 deletions
15
pkg/generate/testdata/generate/oncall-resources/provider.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
terraform { | ||
required_providers { | ||
grafana = { | ||
source = "grafana/grafana" | ||
version = "999.999.999" | ||
} | ||
} | ||
} | ||
|
||
provider "grafana" { | ||
url = "https://tfprovidertests.grafana.net/" | ||
auth = "REDACTED" | ||
oncall_url = "https://oncall-prod-us-central-0.grafana.net/oncall" | ||
oncall_access_token = "REDACTED" | ||
} |
29 changes: 29 additions & 0 deletions
29
pkg/generate/testdata/generate/oncall-resources/resources.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# __generated__ by Terraform | ||
# Please review these resources and move them into your main configuration files. | ||
|
||
# __generated__ by Terraform from "{{ .EscalationID }}" | ||
resource "grafana_oncall_escalation" "_{{ .EscalationID }}" { | ||
duration = 300 | ||
escalation_chain_id = grafana_oncall_escalation_chain._{{ .EscalationChainID }}.id | ||
position = 0 | ||
type = "wait" | ||
} | ||
|
||
# __generated__ by Terraform from "{{ .EscalationChainID }}" | ||
resource "grafana_oncall_escalation_chain" "_{{ .EscalationChainID }}" { | ||
name = "{{ .Name }}" | ||
} | ||
|
||
# __generated__ by Terraform from "{{ .IntegrationID }}" | ||
resource "grafana_oncall_integration" "_{{ .IntegrationID }}" { | ||
name = "{{ .Name }}" | ||
type = "grafana" | ||
} | ||
|
||
# __generated__ by Terraform from "{{ .ScheduleID }}" | ||
resource "grafana_oncall_schedule" "_{{ .ScheduleID }}" { | ||
enable_web_overrides = false | ||
name = "{{ .Name }}" | ||
time_zone = "America/New_York" | ||
type = "calendar" | ||
} |