terraform-provider-grafana
terraform-provider-grafana copied to clipboard
Support Grafana implementation of alerting integration AWS SNS
A while ago PR https://github.com/grafana/terraform-provider-grafana/pull/1295 introduced a terraform resource for AWS SNS alerting integration that was implemented only in Amazon Managed Grafana. There wasn't an integration in Grafana alerting at that time. Few months later we PR https://github.com/grafana/alerting/pull/173 added such integration to Grafana Alerting.
The problem is that the current model of terraform resource does not match the Grafana settings. We need to figure out how to support Grafana integration.
I can see four options:
- Breaking changes. Change the resource format to support Grafana's integration to support HCL like the following (this is the export from Grafana).
apiVersion: 1
contactPoints:
- orgId: 1
name: TEST-123
receivers:
- uid: fdvi0t6uirlkwb
type: sns
settings:
api_url: http://test
attributes:
test_id: id
message: '{{ template "default.message" . }}'
phone_number: 555-555-5555
sigv4:
access_key: "12345"
profile: default
region: us-east-1
role_arn: arn:aws:sns:region:0123456789:SNSRoleName
secret_key: "12345"
subject: '{{ template "default.title" . }}'
target_arn: arn:aws:sns:region:0123456789:SNSTargetName
topic_arn: arn:aws:sns:region:0123456789:SNSTopicName
disableResolveMessage: false
- Semi-breaking changes. Keep the current resource format but (un)pack to the Grafana's API format. This will require changes in export format in Grafana.
- Non-breaking, mode field. Variation of the semi-breaking. Add a new field to control format of the (un)packing. For example,
format: Grafana|AWS - Non-breaking, a new resource. Two resources:
snsandgrafana_sns.