diff --git a/.pulumi-java-gen.version b/.pulumi-java-gen.version index 51de3305..92e0c743 100644 --- a/.pulumi-java-gen.version +++ b/.pulumi-java-gen.version @@ -1 +1 @@ -0.13.0 \ No newline at end of file +0.16.1 \ No newline at end of file diff --git a/provider/cmd/pulumi-resource-grafana/bridge-metadata.json b/provider/cmd/pulumi-resource-grafana/bridge-metadata.json index a0aa6f7a..27a0f5f9 100644 --- a/provider/cmd/pulumi-resource-grafana/bridge-metadata.json +++ b/provider/cmd/pulumi-resource-grafana/bridge-metadata.json @@ -673,6 +673,9 @@ } } }, + "grafana_oncall_user_notification_rule": { + "current": "grafana:index/oncallUserNotificationRule:OncallUserNotificationRule" + }, "grafana_organization": { "current": "grafana:oss/organization:Organization", "past": [ @@ -905,6 +908,9 @@ "maxItemsOne": false, "elem": { "fields": { + "advanced_options": { + "maxItemsOne": true + }, "annotation": { "maxItemsOne": false }, @@ -1522,6 +1528,9 @@ "maxItemsOne": false, "elem": { "fields": { + "advanced_options": { + "maxItemsOne": true + }, "annotation": { "maxItemsOne": false }, @@ -2142,6 +2151,7 @@ "grafana:index/oncallOutgoingWebhook:OncallOutgoingWebhook": 0, "grafana:index/oncallRoute:OncallRoute": 0, "grafana:index/oncallSchedule:OncallSchedule": 0, + "grafana:index/oncallUserNotificationRule:OncallUserNotificationRule": 1, "grafana:index/organization:Organization": 0, "grafana:index/organizationPreferences:OrganizationPreferences": 0, "grafana:index/playlist:Playlist": 0, diff --git a/provider/cmd/pulumi-resource-grafana/schema.json b/provider/cmd/pulumi-resource-grafana/schema.json index 951e68ac..7603999b 100644 --- a/provider/cmd/pulumi-resource-grafana/schema.json +++ b/provider/cmd/pulumi-resource-grafana/schema.json @@ -4539,6 +4539,10 @@ }, "grafana:index/SLOAlerting:SLOAlerting": { "properties": { + "advancedOptions": { + "$ref": "#/types/grafana:index/SLOAlertingAdvancedOptions:SLOAlertingAdvancedOptions", + "description": "Advanced Options for Alert Rules\n" + }, "annotations": { "type": "array", "items": { @@ -4570,6 +4574,15 @@ }, "type": "object" }, + "grafana:index/SLOAlertingAdvancedOptions:SLOAlertingAdvancedOptions": { + "properties": { + "minFailures": { + "type": "integer", + "description": "Minimum number of failed events to trigger an alert\n" + } + }, + "type": "object" + }, "grafana:index/SLOAlertingAnnotation:SLOAlertingAnnotation": { "properties": { "key": { @@ -5976,6 +5989,10 @@ }, "grafana:index/getSlosSloAlerting:getSlosSloAlerting": { "properties": { + "advancedOptions": { + "$ref": "#/types/grafana:index/getSlosSloAlertingAdvancedOptions:getSlosSloAlertingAdvancedOptions", + "description": "Advanced Options for Alert Rules\n" + }, "annotations": { "type": "array", "items": { @@ -6001,6 +6018,15 @@ }, "type": "object" }, + "grafana:index/getSlosSloAlertingAdvancedOptions:getSlosSloAlertingAdvancedOptions": { + "properties": { + "minFailures": { + "type": "integer", + "description": "Minimum number of failed events to trigger an alert\n" + } + }, + "type": "object" + }, "grafana:index/getSlosSloAlertingAnnotation:getSlosSloAlertingAnnotation": { "properties": { "key": { @@ -7229,6 +7255,10 @@ }, "grafana:slo/SLOAlerting:SLOAlerting": { "properties": { + "advancedOptions": { + "$ref": "#/types/grafana:slo/SLOAlertingAdvancedOptions:SLOAlertingAdvancedOptions", + "description": "Advanced Options for Alert Rules\n" + }, "annotations": { "type": "array", "items": { @@ -7260,6 +7290,15 @@ }, "type": "object" }, + "grafana:slo/SLOAlertingAdvancedOptions:SLOAlertingAdvancedOptions": { + "properties": { + "minFailures": { + "type": "integer", + "description": "Minimum number of failed events to trigger an alert\n" + } + }, + "type": "object" + }, "grafana:slo/SLOAlertingAnnotation:SLOAlertingAnnotation": { "properties": { "key": { @@ -7557,6 +7596,10 @@ }, "grafana:slo/getSlosSloAlerting:getSlosSloAlerting": { "properties": { + "advancedOptions": { + "$ref": "#/types/grafana:slo/getSlosSloAlertingAdvancedOptions:getSlosSloAlertingAdvancedOptions", + "description": "Advanced Options for Alert Rules\n" + }, "annotations": { "type": "array", "items": { @@ -7588,6 +7631,15 @@ }, "type": "object" }, + "grafana:slo/getSlosSloAlertingAdvancedOptions:getSlosSloAlertingAdvancedOptions": { + "properties": { + "minFailures": { + "type": "integer", + "description": "Minimum number of failed events to trigger an alert\n" + } + }, + "type": "object" + }, "grafana:slo/getSlosSloAlertingAnnotation:getSlosSloAlertingAnnotation": { "properties": { "key": { @@ -16244,6 +16296,88 @@ ], "deprecationMessage": "grafana.index/oncallschedule.OncallSchedule has been deprecated in favor of grafana.oncall/schedule.Schedule" }, + "grafana:index/oncallUserNotificationRule:OncallUserNotificationRule": { + "description": "* [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/)\n\n**Note**: you must be running Grafana OnCall \u003e= v1.8.0 to use this resource.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as grafana from \"@pulumi/grafana\";\nimport * as grafana from \"@pulumiverse/grafana\";\n\nconst myUser = grafana.onCall.getUser({\n username: \"my_username\",\n});\nconst myUserStep1 = new grafana.OncallUserNotificationRule(\"my_user_step_1\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n position: 0,\n type: \"notify_by_mobile_app\",\n});\nconst myUserStep2 = new grafana.OncallUserNotificationRule(\"my_user_step_2\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n position: 1,\n duration: 600,\n type: \"wait\",\n});\nconst myUserStep3 = new grafana.OncallUserNotificationRule(\"my_user_step_3\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n position: 2,\n type: \"notify_by_phone_call\",\n});\nconst myUserStep4 = new grafana.OncallUserNotificationRule(\"my_user_step_4\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n position: 3,\n duration: 300,\n type: \"wait\",\n});\nconst myUserStep5 = new grafana.OncallUserNotificationRule(\"my_user_step_5\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n position: 4,\n type: \"notify_by_slack\",\n});\nconst myUserImportantStep1 = new grafana.OncallUserNotificationRule(\"my_user_important_step_1\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n important: true,\n position: 0,\n type: \"notify_by_mobile_app_critical\",\n});\nconst myUserImportantStep2 = new grafana.OncallUserNotificationRule(\"my_user_important_step_2\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n important: true,\n position: 1,\n duration: 300,\n type: \"wait\",\n});\nconst myUserImportantStep3 = new grafana.OncallUserNotificationRule(\"my_user_important_step_3\", {\n userId: myUser.then(myUser =\u003e myUser.id),\n important: true,\n position: 2,\n type: \"notify_by_mobile_app_critical\",\n});\n```\n```python\nimport pulumi\nimport pulumi_grafana as grafana\nimport pulumiverse_grafana as grafana\n\nmy_user = grafana.onCall.get_user(username=\"my_username\")\nmy_user_step1 = grafana.OncallUserNotificationRule(\"my_user_step_1\",\n user_id=my_user.id,\n position=0,\n type=\"notify_by_mobile_app\")\nmy_user_step2 = grafana.OncallUserNotificationRule(\"my_user_step_2\",\n user_id=my_user.id,\n position=1,\n duration=600,\n type=\"wait\")\nmy_user_step3 = grafana.OncallUserNotificationRule(\"my_user_step_3\",\n user_id=my_user.id,\n position=2,\n type=\"notify_by_phone_call\")\nmy_user_step4 = grafana.OncallUserNotificationRule(\"my_user_step_4\",\n user_id=my_user.id,\n position=3,\n duration=300,\n type=\"wait\")\nmy_user_step5 = grafana.OncallUserNotificationRule(\"my_user_step_5\",\n user_id=my_user.id,\n position=4,\n type=\"notify_by_slack\")\nmy_user_important_step1 = grafana.OncallUserNotificationRule(\"my_user_important_step_1\",\n user_id=my_user.id,\n important=True,\n position=0,\n type=\"notify_by_mobile_app_critical\")\nmy_user_important_step2 = grafana.OncallUserNotificationRule(\"my_user_important_step_2\",\n user_id=my_user.id,\n important=True,\n position=1,\n duration=300,\n type=\"wait\")\nmy_user_important_step3 = grafana.OncallUserNotificationRule(\"my_user_important_step_3\",\n user_id=my_user.id,\n important=True,\n position=2,\n type=\"notify_by_mobile_app_critical\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Grafana = Pulumi.Grafana;\nusing Grafana = Pulumiverse.Grafana;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var myUser = Grafana.OnCall.GetUser.Invoke(new()\n {\n Username = \"my_username\",\n });\n\n var myUserStep1 = new Grafana.OncallUserNotificationRule(\"my_user_step_1\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Position = 0,\n Type = \"notify_by_mobile_app\",\n });\n\n var myUserStep2 = new Grafana.OncallUserNotificationRule(\"my_user_step_2\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Position = 1,\n Duration = 600,\n Type = \"wait\",\n });\n\n var myUserStep3 = new Grafana.OncallUserNotificationRule(\"my_user_step_3\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Position = 2,\n Type = \"notify_by_phone_call\",\n });\n\n var myUserStep4 = new Grafana.OncallUserNotificationRule(\"my_user_step_4\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Position = 3,\n Duration = 300,\n Type = \"wait\",\n });\n\n var myUserStep5 = new Grafana.OncallUserNotificationRule(\"my_user_step_5\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Position = 4,\n Type = \"notify_by_slack\",\n });\n\n var myUserImportantStep1 = new Grafana.OncallUserNotificationRule(\"my_user_important_step_1\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Important = true,\n Position = 0,\n Type = \"notify_by_mobile_app_critical\",\n });\n\n var myUserImportantStep2 = new Grafana.OncallUserNotificationRule(\"my_user_important_step_2\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Important = true,\n Position = 1,\n Duration = 300,\n Type = \"wait\",\n });\n\n var myUserImportantStep3 = new Grafana.OncallUserNotificationRule(\"my_user_important_step_3\", new()\n {\n UserId = myUser.Apply(getUserResult =\u003e getUserResult.Id),\n Important = true,\n Position = 2,\n Type = \"notify_by_mobile_app_critical\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana\"\n\t\"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/onCall\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tmyUser, err := onCall.GetUser(ctx, \u0026oncall.GetUserArgs{\n\t\t\tUsername: \"my_username\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_step_1\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tPosition: pulumi.Int(0),\n\t\t\tType: pulumi.String(\"notify_by_mobile_app\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_step_2\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tPosition: pulumi.Int(1),\n\t\t\tDuration: pulumi.Int(600),\n\t\t\tType: pulumi.String(\"wait\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_step_3\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tPosition: pulumi.Int(2),\n\t\t\tType: pulumi.String(\"notify_by_phone_call\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_step_4\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tPosition: pulumi.Int(3),\n\t\t\tDuration: pulumi.Int(300),\n\t\t\tType: pulumi.String(\"wait\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_step_5\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tPosition: pulumi.Int(4),\n\t\t\tType: pulumi.String(\"notify_by_slack\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_important_step_1\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tImportant: pulumi.Bool(true),\n\t\t\tPosition: pulumi.Int(0),\n\t\t\tType: pulumi.String(\"notify_by_mobile_app_critical\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_important_step_2\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tImportant: pulumi.Bool(true),\n\t\t\tPosition: pulumi.Int(1),\n\t\t\tDuration: pulumi.Int(300),\n\t\t\tType: pulumi.String(\"wait\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = grafana.NewOncallUserNotificationRule(ctx, \"my_user_important_step_3\", \u0026grafana.OncallUserNotificationRuleArgs{\n\t\t\tUserId: pulumi.String(myUser.Id),\n\t\t\tImportant: pulumi.Bool(true),\n\t\t\tPosition: pulumi.Int(2),\n\t\t\tType: pulumi.String(\"notify_by_mobile_app_critical\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.grafana.onCall.OnCallFunctions;\nimport com.pulumi.grafana.onCall.inputs.GetUserArgs;\nimport com.pulumi.grafana.OncallUserNotificationRule;\nimport com.pulumi.grafana.OncallUserNotificationRuleArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var myUser = OnCallFunctions.getUser(GetUserArgs.builder()\n .username(\"my_username\")\n .build());\n\n var myUserStep1 = new OncallUserNotificationRule(\"myUserStep1\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .position(0)\n .type(\"notify_by_mobile_app\")\n .build());\n\n var myUserStep2 = new OncallUserNotificationRule(\"myUserStep2\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .position(1)\n .duration(600)\n .type(\"wait\")\n .build());\n\n var myUserStep3 = new OncallUserNotificationRule(\"myUserStep3\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .position(2)\n .type(\"notify_by_phone_call\")\n .build());\n\n var myUserStep4 = new OncallUserNotificationRule(\"myUserStep4\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .position(3)\n .duration(300)\n .type(\"wait\")\n .build());\n\n var myUserStep5 = new OncallUserNotificationRule(\"myUserStep5\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .position(4)\n .type(\"notify_by_slack\")\n .build());\n\n var myUserImportantStep1 = new OncallUserNotificationRule(\"myUserImportantStep1\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .important(true)\n .position(0)\n .type(\"notify_by_mobile_app_critical\")\n .build());\n\n var myUserImportantStep2 = new OncallUserNotificationRule(\"myUserImportantStep2\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .important(true)\n .position(1)\n .duration(300)\n .type(\"wait\")\n .build());\n\n var myUserImportantStep3 = new OncallUserNotificationRule(\"myUserImportantStep3\", OncallUserNotificationRuleArgs.builder()\n .userId(myUser.applyValue(getUserResult -\u003e getUserResult.id()))\n .important(true)\n .position(2)\n .type(\"notify_by_mobile_app_critical\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n myUserStep1:\n type: grafana:OncallUserNotificationRule\n name: my_user_step_1\n properties:\n userId: ${myUser.id}\n position: 0\n type: notify_by_mobile_app\n myUserStep2:\n type: grafana:OncallUserNotificationRule\n name: my_user_step_2\n properties:\n userId: ${myUser.id}\n position: 1\n duration: 600 # 10 minutes\n type: wait\n myUserStep3:\n type: grafana:OncallUserNotificationRule\n name: my_user_step_3\n properties:\n userId: ${myUser.id}\n position: 2\n type: notify_by_phone_call\n myUserStep4:\n type: grafana:OncallUserNotificationRule\n name: my_user_step_4\n properties:\n userId: ${myUser.id}\n position: 3\n duration: 300 # 5 minutes\n type: wait\n myUserStep5:\n type: grafana:OncallUserNotificationRule\n name: my_user_step_5\n properties:\n userId: ${myUser.id}\n position: 4\n type: notify_by_slack\n myUserImportantStep1:\n type: grafana:OncallUserNotificationRule\n name: my_user_important_step_1\n properties:\n userId: ${myUser.id}\n important: true\n position: 0\n type: notify_by_mobile_app_critical\n myUserImportantStep2:\n type: grafana:OncallUserNotificationRule\n name: my_user_important_step_2\n properties:\n userId: ${myUser.id}\n important: true\n position: 1\n duration: 300 # 5 minutes\n type: wait\n myUserImportantStep3:\n type: grafana:OncallUserNotificationRule\n name: my_user_important_step_3\n properties:\n userId: ${myUser.id}\n important: true\n position: 2\n type: notify_by_mobile_app_critical\nvariables:\n myUser:\n fn::invoke:\n Function: grafana:onCall:getUser\n Arguments:\n username: my_username\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\n```sh\n$ pulumi import grafana:index/oncallUserNotificationRule:OncallUserNotificationRule name \"{{ id }}\"\n```\n\n", + "properties": { + "duration": { + "type": "integer", + "description": "A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600\n" + }, + "important": { + "type": "boolean", + "description": "Boolean value which indicates if a rule is “important”\n" + }, + "position": { + "type": "integer", + "description": "Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list.\n" + }, + "type": { + "type": "string", + "description": "The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers.\n" + }, + "userId": { + "type": "string", + "description": "User ID\n" + } + }, + "required": [ + "important", + "type", + "userId" + ], + "inputProperties": { + "duration": { + "type": "integer", + "description": "A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600\n" + }, + "important": { + "type": "boolean", + "description": "Boolean value which indicates if a rule is “important”\n" + }, + "position": { + "type": "integer", + "description": "Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list.\n" + }, + "type": { + "type": "string", + "description": "The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers.\n" + }, + "userId": { + "type": "string", + "description": "User ID\n" + } + }, + "requiredInputs": [ + "type", + "userId" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering OncallUserNotificationRule resources.\n", + "properties": { + "duration": { + "type": "integer", + "description": "A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600\n" + }, + "important": { + "type": "boolean", + "description": "Boolean value which indicates if a rule is “important”\n" + }, + "position": { + "type": "integer", + "description": "Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list.\n" + }, + "type": { + "type": "string", + "description": "The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers.\n" + }, + "userId": { + "type": "string", + "description": "User ID\n" + } + }, + "type": "object" + } + }, "grafana:index/organization:Organization": { "description": "* [Official documentation](https://grafana.com/docs/grafana/latest/administration/organization-management/)\n* [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/org/)\n\nThis resource represents an instance-scoped resource and uses Grafana's admin APIs.\nIt does not work with API tokens or service accounts which are org-scoped.\nYou must use basic auth.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as grafana from \"@pulumiverse/grafana\";\n\nconst test = new grafana.oss.Organization(\"test\", {\n name: \"Test Organization\",\n adminUser: \"admin\",\n createUsers: true,\n admins: [\"admin@example.com\"],\n editors: [\n \"editor-01@example.com\",\n \"editor-02@example.com\",\n ],\n viewers: [\n \"viewer-01@example.com\",\n \"viewer-02@example.com\",\n ],\n});\n```\n```python\nimport pulumi\nimport pulumiverse_grafana as grafana\n\ntest = grafana.oss.Organization(\"test\",\n name=\"Test Organization\",\n admin_user=\"admin\",\n create_users=True,\n admins=[\"admin@example.com\"],\n editors=[\n \"editor-01@example.com\",\n \"editor-02@example.com\",\n ],\n viewers=[\n \"viewer-01@example.com\",\n \"viewer-02@example.com\",\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Grafana = Pulumiverse.Grafana;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var test = new Grafana.Oss.Organization(\"test\", new()\n {\n Name = \"Test Organization\",\n AdminUser = \"admin\",\n CreateUsers = true,\n Admins = new[]\n {\n \"admin@example.com\",\n },\n Editors = new[]\n {\n \"editor-01@example.com\",\n \"editor-02@example.com\",\n },\n Viewers = new[]\n {\n \"viewer-01@example.com\",\n \"viewer-02@example.com\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/oss\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := oss.NewOrganization(ctx, \"test\", \u0026oss.OrganizationArgs{\n\t\t\tName: pulumi.String(\"Test Organization\"),\n\t\t\tAdminUser: pulumi.String(\"admin\"),\n\t\t\tCreateUsers: pulumi.Bool(true),\n\t\t\tAdmins: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"admin@example.com\"),\n\t\t\t},\n\t\t\tEditors: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"editor-01@example.com\"),\n\t\t\t\tpulumi.String(\"editor-02@example.com\"),\n\t\t\t},\n\t\t\tViewers: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"viewer-01@example.com\"),\n\t\t\t\tpulumi.String(\"viewer-02@example.com\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.grafana.oss.Organization;\nimport com.pulumi.grafana.oss.OrganizationArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var test = new Organization(\"test\", OrganizationArgs.builder()\n .name(\"Test Organization\")\n .adminUser(\"admin\")\n .createUsers(true)\n .admins(\"admin@example.com\")\n .editors( \n \"editor-01@example.com\",\n \"editor-02@example.com\")\n .viewers( \n \"viewer-01@example.com\",\n \"viewer-02@example.com\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n test:\n type: grafana:oss:Organization\n properties:\n name: Test Organization\n adminUser: admin\n createUsers: true\n admins:\n - admin@example.com\n editors:\n - editor-01@example.com\n - editor-02@example.com\n viewers:\n - viewer-01@example.com\n - viewer-02@example.com\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\n```sh\n$ pulumi import grafana:index/organization:Organization name \"{{ id }}\"\n```\n\n", "properties": { diff --git a/provider/go.mod b/provider/go.mod index a5fc012f..6a1c34c0 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.4 replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20240520223432-0c0bf0d65f10 require ( - github.com/grafana/terraform-provider-grafana/v3 v3.2.1 + github.com/grafana/terraform-provider-grafana/v3 v3.3.0 github.com/pulumi/pulumi-terraform-bridge/pf v0.41.0 github.com/pulumi/pulumi-terraform-bridge/v3 v3.88.0 github.com/pulumi/pulumi/sdk/v3 v3.126.0 @@ -119,14 +119,14 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/mux v1.8.1 // indirect - github.com/grafana/amixr-api-go-client v0.0.12-0.20240410110211-c9f68db085c4 // indirect + github.com/grafana/amixr-api-go-client v0.0.12 // indirect github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20240322153219-42c6a1d2bcab // indirect github.com/grafana/grafana-openapi-client-go v0.0.0-20240523010106-657d101fcbd9 // indirect github.com/grafana/grafana-plugin-sdk-go v0.235.0 // indirect github.com/grafana/machine-learning-go-client v0.7.0 // indirect github.com/grafana/otel-profiling-go v0.5.1 // indirect github.com/grafana/pyroscope-go/godeltaprof v0.1.7 // indirect - github.com/grafana/slo-openapi-client/go v0.0.0-20240507015908-bf9e85638f2f // indirect + github.com/grafana/slo-openapi-client/go v0.0.0-20240626093634-e6741482b090 // indirect github.com/grafana/synthetic-monitoring-agent v0.24.3 // indirect github.com/grafana/synthetic-monitoring-api-go-client v0.8.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect diff --git a/provider/go.sum b/provider/go.sum index 876abe05..39007c6a 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -1631,8 +1631,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1 github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/grafana/amixr-api-go-client v0.0.12-0.20240410110211-c9f68db085c4 h1:e7cZfDiNodjQn63be9m8zfnvMEQAMqHVFswjcbdlspk= -github.com/grafana/amixr-api-go-client v0.0.12-0.20240410110211-c9f68db085c4/go.mod h1:N6x26XUrM5zGtK5zL5vNJnAn2JFMxLFPPLTw/6pDkFE= +github.com/grafana/amixr-api-go-client v0.0.12 h1:oEHZTBhxoZ35EsfeccZBJGPKhZUVOmdSir3WWnSJMLc= +github.com/grafana/amixr-api-go-client v0.0.12/go.mod h1:N6x26XUrM5zGtK5zL5vNJnAn2JFMxLFPPLTw/6pDkFE= github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20240322153219-42c6a1d2bcab h1:/5R8NO996/keDkZqKXEkU3/QgFs1wzChKYkakjsBpRk= github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20240322153219-42c6a1d2bcab/go.mod h1:6sYY1qgwYfSDNQhKQA0tar8Oc38cIGfyqwejhxoOsPs= github.com/grafana/grafana-openapi-client-go v0.0.0-20240523010106-657d101fcbd9 h1:lOumw0RmkvKsTRMm6e5x2x6EbtyTeIKhy8ZJaK1KW9w= @@ -1645,14 +1645,14 @@ github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls= github.com/grafana/pyroscope-go/godeltaprof v0.1.7 h1:C11j63y7gymiW8VugJ9ZW0pWfxTZugdSJyC48olk5KY= github.com/grafana/pyroscope-go/godeltaprof v0.1.7/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= -github.com/grafana/slo-openapi-client/go v0.0.0-20240507015908-bf9e85638f2f h1:aUDhr6LmO2W08tEP0Xe694DRfYZjlGp9kUnbeAF+194= -github.com/grafana/slo-openapi-client/go v0.0.0-20240507015908-bf9e85638f2f/go.mod h1:HgbbeH2gFfCk2XZCrCly39DB13WkwWyQ+Ww+HTxePCs= +github.com/grafana/slo-openapi-client/go v0.0.0-20240626093634-e6741482b090 h1:gDkJPpTL84zx+UkSY6a1pPlUm9aDEVBzPlVOkUbXmgM= +github.com/grafana/slo-openapi-client/go v0.0.0-20240626093634-e6741482b090/go.mod h1:HgbbeH2gFfCk2XZCrCly39DB13WkwWyQ+Ww+HTxePCs= github.com/grafana/synthetic-monitoring-agent v0.24.3 h1:+xscAsGZtWTNTNDxdYqqcz4w1tG6QPaOIgCONsVMoO8= github.com/grafana/synthetic-monitoring-agent v0.24.3/go.mod h1:CJQmPtKRcJMjb/sDe6fDA4vyS2qFPElu0szI33nKlzk= github.com/grafana/synthetic-monitoring-api-go-client v0.8.0 h1:Tm4MtwwYmPNInGfnj66l6j6KOshMkNV4emIVKJdlXMg= github.com/grafana/synthetic-monitoring-api-go-client v0.8.0/go.mod h1:TGaywTdL2Z+PJhpWzJEmJFRF5K55vKz2f39mWY/GvV8= -github.com/grafana/terraform-provider-grafana/v3 v3.2.1 h1:W0ahltYUbc/jL4M+Spj7ePypgulZezYGFkpTeSKOtYU= -github.com/grafana/terraform-provider-grafana/v3 v3.2.1/go.mod h1:k/2GjCoboSLVd+4XzMKhiSylcGvHZllO1xilNbx3j1o= +github.com/grafana/terraform-provider-grafana/v3 v3.3.0 h1:S1SMxwzO8ueqGBqnHSICALIALVIFzQmd/Y3WXp8OA/4= +github.com/grafana/terraform-provider-grafana/v3 v3.3.0/go.mod h1:l5SJhLtqYZqEN0tavnsQxQax8aH8/Fr5vWhxTX1fbk8= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= diff --git a/sdk/dotnet/Inputs/SLOAlertingAdvancedOptionsArgs.cs b/sdk/dotnet/Inputs/SLOAlertingAdvancedOptionsArgs.cs new file mode 100644 index 00000000..d54017f6 --- /dev/null +++ b/sdk/dotnet/Inputs/SLOAlertingAdvancedOptionsArgs.cs @@ -0,0 +1,27 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Inputs +{ + + public sealed class SLOAlertingAdvancedOptionsArgs : global::Pulumi.ResourceArgs + { + /// + /// Minimum number of failed events to trigger an alert + /// + [Input("minFailures")] + public Input? MinFailures { get; set; } + + public SLOAlertingAdvancedOptionsArgs() + { + } + public static new SLOAlertingAdvancedOptionsArgs Empty => new SLOAlertingAdvancedOptionsArgs(); + } +} diff --git a/sdk/dotnet/Inputs/SLOAlertingAdvancedOptionsGetArgs.cs b/sdk/dotnet/Inputs/SLOAlertingAdvancedOptionsGetArgs.cs new file mode 100644 index 00000000..5af2cada --- /dev/null +++ b/sdk/dotnet/Inputs/SLOAlertingAdvancedOptionsGetArgs.cs @@ -0,0 +1,27 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Inputs +{ + + public sealed class SLOAlertingAdvancedOptionsGetArgs : global::Pulumi.ResourceArgs + { + /// + /// Minimum number of failed events to trigger an alert + /// + [Input("minFailures")] + public Input? MinFailures { get; set; } + + public SLOAlertingAdvancedOptionsGetArgs() + { + } + public static new SLOAlertingAdvancedOptionsGetArgs Empty => new SLOAlertingAdvancedOptionsGetArgs(); + } +} diff --git a/sdk/dotnet/Inputs/SLOAlertingArgs.cs b/sdk/dotnet/Inputs/SLOAlertingArgs.cs index b50c7e3c..46d00585 100644 --- a/sdk/dotnet/Inputs/SLOAlertingArgs.cs +++ b/sdk/dotnet/Inputs/SLOAlertingArgs.cs @@ -13,6 +13,12 @@ namespace Pulumiverse.Grafana.Inputs public sealed class SLOAlertingArgs : global::Pulumi.ResourceArgs { + /// + /// Advanced Options for Alert Rules + /// + [Input("advancedOptions")] + public Input? AdvancedOptions { get; set; } + [Input("annotations")] private InputList? _annotations; diff --git a/sdk/dotnet/Inputs/SLOAlertingGetArgs.cs b/sdk/dotnet/Inputs/SLOAlertingGetArgs.cs index 7650a5b1..fc57ee2e 100644 --- a/sdk/dotnet/Inputs/SLOAlertingGetArgs.cs +++ b/sdk/dotnet/Inputs/SLOAlertingGetArgs.cs @@ -13,6 +13,12 @@ namespace Pulumiverse.Grafana.Inputs public sealed class SLOAlertingGetArgs : global::Pulumi.ResourceArgs { + /// + /// Advanced Options for Alert Rules + /// + [Input("advancedOptions")] + public Input? AdvancedOptions { get; set; } + [Input("annotations")] private InputList? _annotations; diff --git a/sdk/dotnet/OncallUserNotificationRule.cs b/sdk/dotnet/OncallUserNotificationRule.cs new file mode 100644 index 00000000..3617e1a9 --- /dev/null +++ b/sdk/dotnet/OncallUserNotificationRule.cs @@ -0,0 +1,258 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana +{ + /// + /// * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/) + /// + /// **Note**: you must be running Grafana OnCall >= v1.8.0 to use this resource. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Grafana = Pulumi.Grafana; + /// using Grafana = Pulumiverse.Grafana; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var myUser = Grafana.OnCall.GetUser.Invoke(new() + /// { + /// Username = "my_username", + /// }); + /// + /// var myUserStep1 = new Grafana.OncallUserNotificationRule("my_user_step_1", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Position = 0, + /// Type = "notify_by_mobile_app", + /// }); + /// + /// var myUserStep2 = new Grafana.OncallUserNotificationRule("my_user_step_2", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Position = 1, + /// Duration = 600, + /// Type = "wait", + /// }); + /// + /// var myUserStep3 = new Grafana.OncallUserNotificationRule("my_user_step_3", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Position = 2, + /// Type = "notify_by_phone_call", + /// }); + /// + /// var myUserStep4 = new Grafana.OncallUserNotificationRule("my_user_step_4", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Position = 3, + /// Duration = 300, + /// Type = "wait", + /// }); + /// + /// var myUserStep5 = new Grafana.OncallUserNotificationRule("my_user_step_5", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Position = 4, + /// Type = "notify_by_slack", + /// }); + /// + /// var myUserImportantStep1 = new Grafana.OncallUserNotificationRule("my_user_important_step_1", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Important = true, + /// Position = 0, + /// Type = "notify_by_mobile_app_critical", + /// }); + /// + /// var myUserImportantStep2 = new Grafana.OncallUserNotificationRule("my_user_important_step_2", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Important = true, + /// Position = 1, + /// Duration = 300, + /// Type = "wait", + /// }); + /// + /// var myUserImportantStep3 = new Grafana.OncallUserNotificationRule("my_user_important_step_3", new() + /// { + /// UserId = myUser.Apply(getUserResult => getUserResult.Id), + /// Important = true, + /// Position = 2, + /// Type = "notify_by_mobile_app_critical", + /// }); + /// + /// }); + /// ``` + /// + /// ## Import + /// + /// ```sh + /// $ pulumi import grafana:index/oncallUserNotificationRule:OncallUserNotificationRule name "{{ id }}" + /// ``` + /// + [GrafanaResourceType("grafana:index/oncallUserNotificationRule:OncallUserNotificationRule")] + public partial class OncallUserNotificationRule : global::Pulumi.CustomResource + { + /// + /// A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + /// + [Output("duration")] + public Output Duration { get; private set; } = null!; + + /// + /// Boolean value which indicates if a rule is “important” + /// + [Output("important")] + public Output Important { get; private set; } = null!; + + /// + /// Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + /// + [Output("position")] + public Output Position { get; private set; } = null!; + + /// + /// The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + /// + [Output("type")] + public Output Type { get; private set; } = null!; + + /// + /// User ID + /// + [Output("userId")] + public Output UserId { get; private set; } = null!; + + + /// + /// Create a OncallUserNotificationRule resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public OncallUserNotificationRule(string name, OncallUserNotificationRuleArgs args, CustomResourceOptions? options = null) + : base("grafana:index/oncallUserNotificationRule:OncallUserNotificationRule", name, args ?? new OncallUserNotificationRuleArgs(), MakeResourceOptions(options, "")) + { + } + + private OncallUserNotificationRule(string name, Input id, OncallUserNotificationRuleState? state = null, CustomResourceOptions? options = null) + : base("grafana:index/oncallUserNotificationRule:OncallUserNotificationRule", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + PluginDownloadURL = "github://api.github.com/pulumiverse", + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing OncallUserNotificationRule resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static OncallUserNotificationRule Get(string name, Input id, OncallUserNotificationRuleState? state = null, CustomResourceOptions? options = null) + { + return new OncallUserNotificationRule(name, id, state, options); + } + } + + public sealed class OncallUserNotificationRuleArgs : global::Pulumi.ResourceArgs + { + /// + /// A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + /// + [Input("duration")] + public Input? Duration { get; set; } + + /// + /// Boolean value which indicates if a rule is “important” + /// + [Input("important")] + public Input? Important { get; set; } + + /// + /// Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + /// + [Input("position")] + public Input? Position { get; set; } + + /// + /// The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + /// + [Input("type", required: true)] + public Input Type { get; set; } = null!; + + /// + /// User ID + /// + [Input("userId", required: true)] + public Input UserId { get; set; } = null!; + + public OncallUserNotificationRuleArgs() + { + } + public static new OncallUserNotificationRuleArgs Empty => new OncallUserNotificationRuleArgs(); + } + + public sealed class OncallUserNotificationRuleState : global::Pulumi.ResourceArgs + { + /// + /// A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + /// + [Input("duration")] + public Input? Duration { get; set; } + + /// + /// Boolean value which indicates if a rule is “important” + /// + [Input("important")] + public Input? Important { get; set; } + + /// + /// Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + /// + [Input("position")] + public Input? Position { get; set; } + + /// + /// The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + /// + [Input("type")] + public Input? Type { get; set; } + + /// + /// User ID + /// + [Input("userId")] + public Input? UserId { get; set; } + + public OncallUserNotificationRuleState() + { + } + public static new OncallUserNotificationRuleState Empty => new OncallUserNotificationRuleState(); + } +} diff --git a/sdk/dotnet/Outputs/GetSlosSloAlertingAdvancedOptionsResult.cs b/sdk/dotnet/Outputs/GetSlosSloAlertingAdvancedOptionsResult.cs new file mode 100644 index 00000000..9168529d --- /dev/null +++ b/sdk/dotnet/Outputs/GetSlosSloAlertingAdvancedOptionsResult.cs @@ -0,0 +1,28 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Outputs +{ + + [OutputType] + public sealed class GetSlosSloAlertingAdvancedOptionsResult + { + /// + /// Minimum number of failed events to trigger an alert + /// + public readonly int? MinFailures; + + [OutputConstructor] + private GetSlosSloAlertingAdvancedOptionsResult(int? minFailures) + { + MinFailures = minFailures; + } + } +} diff --git a/sdk/dotnet/Outputs/GetSlosSloAlertingResult.cs b/sdk/dotnet/Outputs/GetSlosSloAlertingResult.cs index 417e4d74..32b20b21 100644 --- a/sdk/dotnet/Outputs/GetSlosSloAlertingResult.cs +++ b/sdk/dotnet/Outputs/GetSlosSloAlertingResult.cs @@ -14,6 +14,10 @@ namespace Pulumiverse.Grafana.Outputs [OutputType] public sealed class GetSlosSloAlertingResult { + /// + /// Advanced Options for Alert Rules + /// + public readonly Outputs.GetSlosSloAlertingAdvancedOptionsResult? AdvancedOptions; /// /// Annotations will be attached to all alerts generated by any of these rules. /// @@ -33,6 +37,8 @@ public sealed class GetSlosSloAlertingResult [OutputConstructor] private GetSlosSloAlertingResult( + Outputs.GetSlosSloAlertingAdvancedOptionsResult? advancedOptions, + ImmutableArray annotations, Outputs.GetSlosSloAlertingFastburnResult? fastburn, @@ -41,6 +47,7 @@ private GetSlosSloAlertingResult( Outputs.GetSlosSloAlertingSlowburnResult? slowburn) { + AdvancedOptions = advancedOptions; Annotations = annotations; Fastburn = fastburn; Labels = labels; diff --git a/sdk/dotnet/Outputs/SLOAlerting.cs b/sdk/dotnet/Outputs/SLOAlerting.cs index 267f97d5..ff780b6a 100644 --- a/sdk/dotnet/Outputs/SLOAlerting.cs +++ b/sdk/dotnet/Outputs/SLOAlerting.cs @@ -14,6 +14,10 @@ namespace Pulumiverse.Grafana.Outputs [OutputType] public sealed class SLOAlerting { + /// + /// Advanced Options for Alert Rules + /// + public readonly Outputs.SLOAlertingAdvancedOptions? AdvancedOptions; /// /// Annotations will be attached to all alerts generated by any of these rules. /// @@ -33,6 +37,8 @@ public sealed class SLOAlerting [OutputConstructor] private SLOAlerting( + Outputs.SLOAlertingAdvancedOptions? advancedOptions, + ImmutableArray annotations, ImmutableArray fastburns, @@ -41,6 +47,7 @@ private SLOAlerting( ImmutableArray slowburns) { + AdvancedOptions = advancedOptions; Annotations = annotations; Fastburns = fastburns; Labels = labels; diff --git a/sdk/dotnet/Outputs/SLOAlertingAdvancedOptions.cs b/sdk/dotnet/Outputs/SLOAlertingAdvancedOptions.cs new file mode 100644 index 00000000..4242c9d8 --- /dev/null +++ b/sdk/dotnet/Outputs/SLOAlertingAdvancedOptions.cs @@ -0,0 +1,28 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Outputs +{ + + [OutputType] + public sealed class SLOAlertingAdvancedOptions + { + /// + /// Minimum number of failed events to trigger an alert + /// + public readonly int? MinFailures; + + [OutputConstructor] + private SLOAlertingAdvancedOptions(int? minFailures) + { + MinFailures = minFailures; + } + } +} diff --git a/sdk/dotnet/Slo/Inputs/SLOAlertingAdvancedOptionsArgs.cs b/sdk/dotnet/Slo/Inputs/SLOAlertingAdvancedOptionsArgs.cs new file mode 100644 index 00000000..a4d4d15e --- /dev/null +++ b/sdk/dotnet/Slo/Inputs/SLOAlertingAdvancedOptionsArgs.cs @@ -0,0 +1,27 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Slo.Inputs +{ + + public sealed class SLOAlertingAdvancedOptionsArgs : global::Pulumi.ResourceArgs + { + /// + /// Minimum number of failed events to trigger an alert + /// + [Input("minFailures")] + public Input? MinFailures { get; set; } + + public SLOAlertingAdvancedOptionsArgs() + { + } + public static new SLOAlertingAdvancedOptionsArgs Empty => new SLOAlertingAdvancedOptionsArgs(); + } +} diff --git a/sdk/dotnet/Slo/Inputs/SLOAlertingAdvancedOptionsGetArgs.cs b/sdk/dotnet/Slo/Inputs/SLOAlertingAdvancedOptionsGetArgs.cs new file mode 100644 index 00000000..4cd036f5 --- /dev/null +++ b/sdk/dotnet/Slo/Inputs/SLOAlertingAdvancedOptionsGetArgs.cs @@ -0,0 +1,27 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Slo.Inputs +{ + + public sealed class SLOAlertingAdvancedOptionsGetArgs : global::Pulumi.ResourceArgs + { + /// + /// Minimum number of failed events to trigger an alert + /// + [Input("minFailures")] + public Input? MinFailures { get; set; } + + public SLOAlertingAdvancedOptionsGetArgs() + { + } + public static new SLOAlertingAdvancedOptionsGetArgs Empty => new SLOAlertingAdvancedOptionsGetArgs(); + } +} diff --git a/sdk/dotnet/Slo/Inputs/SLOAlertingArgs.cs b/sdk/dotnet/Slo/Inputs/SLOAlertingArgs.cs index dbe85d2f..08048c60 100644 --- a/sdk/dotnet/Slo/Inputs/SLOAlertingArgs.cs +++ b/sdk/dotnet/Slo/Inputs/SLOAlertingArgs.cs @@ -13,6 +13,12 @@ namespace Pulumiverse.Grafana.Slo.Inputs public sealed class SLOAlertingArgs : global::Pulumi.ResourceArgs { + /// + /// Advanced Options for Alert Rules + /// + [Input("advancedOptions")] + public Input? AdvancedOptions { get; set; } + [Input("annotations")] private InputList? _annotations; diff --git a/sdk/dotnet/Slo/Inputs/SLOAlertingGetArgs.cs b/sdk/dotnet/Slo/Inputs/SLOAlertingGetArgs.cs index e8739c71..c8b8cb75 100644 --- a/sdk/dotnet/Slo/Inputs/SLOAlertingGetArgs.cs +++ b/sdk/dotnet/Slo/Inputs/SLOAlertingGetArgs.cs @@ -13,6 +13,12 @@ namespace Pulumiverse.Grafana.Slo.Inputs public sealed class SLOAlertingGetArgs : global::Pulumi.ResourceArgs { + /// + /// Advanced Options for Alert Rules + /// + [Input("advancedOptions")] + public Input? AdvancedOptions { get; set; } + [Input("annotations")] private InputList? _annotations; diff --git a/sdk/dotnet/Slo/Outputs/GetSlosSloAlertingAdvancedOptionsResult.cs b/sdk/dotnet/Slo/Outputs/GetSlosSloAlertingAdvancedOptionsResult.cs new file mode 100644 index 00000000..2bdb23ef --- /dev/null +++ b/sdk/dotnet/Slo/Outputs/GetSlosSloAlertingAdvancedOptionsResult.cs @@ -0,0 +1,28 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Slo.Outputs +{ + + [OutputType] + public sealed class GetSlosSloAlertingAdvancedOptionsResult + { + /// + /// Minimum number of failed events to trigger an alert + /// + public readonly int? MinFailures; + + [OutputConstructor] + private GetSlosSloAlertingAdvancedOptionsResult(int? minFailures) + { + MinFailures = minFailures; + } + } +} diff --git a/sdk/dotnet/Slo/Outputs/GetSlosSloAlertingResult.cs b/sdk/dotnet/Slo/Outputs/GetSlosSloAlertingResult.cs index aea7f254..88e5954f 100644 --- a/sdk/dotnet/Slo/Outputs/GetSlosSloAlertingResult.cs +++ b/sdk/dotnet/Slo/Outputs/GetSlosSloAlertingResult.cs @@ -14,6 +14,10 @@ namespace Pulumiverse.Grafana.Slo.Outputs [OutputType] public sealed class GetSlosSloAlertingResult { + /// + /// Advanced Options for Alert Rules + /// + public readonly Outputs.GetSlosSloAlertingAdvancedOptionsResult? AdvancedOptions; /// /// Annotations will be attached to all alerts generated by any of these rules. /// @@ -33,6 +37,8 @@ public sealed class GetSlosSloAlertingResult [OutputConstructor] private GetSlosSloAlertingResult( + Outputs.GetSlosSloAlertingAdvancedOptionsResult? advancedOptions, + ImmutableArray annotations, ImmutableArray fastburns, @@ -41,6 +47,7 @@ private GetSlosSloAlertingResult( ImmutableArray slowburns) { + AdvancedOptions = advancedOptions; Annotations = annotations; Fastburns = fastburns; Labels = labels; diff --git a/sdk/dotnet/Slo/Outputs/SLOAlerting.cs b/sdk/dotnet/Slo/Outputs/SLOAlerting.cs index 91cf6296..10869f80 100644 --- a/sdk/dotnet/Slo/Outputs/SLOAlerting.cs +++ b/sdk/dotnet/Slo/Outputs/SLOAlerting.cs @@ -14,6 +14,10 @@ namespace Pulumiverse.Grafana.Slo.Outputs [OutputType] public sealed class SLOAlerting { + /// + /// Advanced Options for Alert Rules + /// + public readonly Outputs.SLOAlertingAdvancedOptions? AdvancedOptions; /// /// Annotations will be attached to all alerts generated by any of these rules. /// @@ -33,6 +37,8 @@ public sealed class SLOAlerting [OutputConstructor] private SLOAlerting( + Outputs.SLOAlertingAdvancedOptions? advancedOptions, + ImmutableArray annotations, ImmutableArray fastburns, @@ -41,6 +47,7 @@ private SLOAlerting( ImmutableArray slowburns) { + AdvancedOptions = advancedOptions; Annotations = annotations; Fastburns = fastburns; Labels = labels; diff --git a/sdk/dotnet/Slo/Outputs/SLOAlertingAdvancedOptions.cs b/sdk/dotnet/Slo/Outputs/SLOAlertingAdvancedOptions.cs new file mode 100644 index 00000000..d873aabf --- /dev/null +++ b/sdk/dotnet/Slo/Outputs/SLOAlertingAdvancedOptions.cs @@ -0,0 +1,28 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace Pulumiverse.Grafana.Slo.Outputs +{ + + [OutputType] + public sealed class SLOAlertingAdvancedOptions + { + /// + /// Minimum number of failed events to trigger an alert + /// + public readonly int? MinFailures; + + [OutputConstructor] + private SLOAlertingAdvancedOptions(int? minFailures) + { + MinFailures = minFailures; + } + } +} diff --git a/sdk/go/grafana/init.go b/sdk/go/grafana/init.go index 0a563b59..80664d12 100644 --- a/sdk/go/grafana/init.go +++ b/sdk/go/grafana/init.go @@ -89,6 +89,8 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &OncallRoute{} case "grafana:index/oncallSchedule:OncallSchedule": r = &OncallSchedule{} + case "grafana:index/oncallUserNotificationRule:OncallUserNotificationRule": + r = &OncallUserNotificationRule{} case "grafana:index/organization:Organization": r = &Organization{} case "grafana:index/organizationPreferences:OrganizationPreferences": @@ -330,6 +332,11 @@ func init() { "index/oncallSchedule", &module{version}, ) + pulumi.RegisterResourceModule( + "grafana", + "index/oncallUserNotificationRule", + &module{version}, + ) pulumi.RegisterResourceModule( "grafana", "index/organization", diff --git a/sdk/go/grafana/oncallUserNotificationRule.go b/sdk/go/grafana/oncallUserNotificationRule.go new file mode 100644 index 00000000..93e18df3 --- /dev/null +++ b/sdk/go/grafana/oncallUserNotificationRule.go @@ -0,0 +1,387 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package grafana + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/internal" +) + +// * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/) +// +// **Note**: you must be running Grafana OnCall >= v1.8.0 to use this resource. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumiverse/pulumi-grafana/sdk/go/grafana" +// "github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/onCall" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// myUser, err := onCall.GetUser(ctx, &oncall.GetUserArgs{ +// Username: "my_username", +// }, nil) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_step_1", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Position: pulumi.Int(0), +// Type: pulumi.String("notify_by_mobile_app"), +// }) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_step_2", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Position: pulumi.Int(1), +// Duration: pulumi.Int(600), +// Type: pulumi.String("wait"), +// }) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_step_3", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Position: pulumi.Int(2), +// Type: pulumi.String("notify_by_phone_call"), +// }) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_step_4", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Position: pulumi.Int(3), +// Duration: pulumi.Int(300), +// Type: pulumi.String("wait"), +// }) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_step_5", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Position: pulumi.Int(4), +// Type: pulumi.String("notify_by_slack"), +// }) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_important_step_1", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Important: pulumi.Bool(true), +// Position: pulumi.Int(0), +// Type: pulumi.String("notify_by_mobile_app_critical"), +// }) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_important_step_2", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Important: pulumi.Bool(true), +// Position: pulumi.Int(1), +// Duration: pulumi.Int(300), +// Type: pulumi.String("wait"), +// }) +// if err != nil { +// return err +// } +// _, err = grafana.NewOncallUserNotificationRule(ctx, "my_user_important_step_3", &grafana.OncallUserNotificationRuleArgs{ +// UserId: pulumi.String(myUser.Id), +// Important: pulumi.Bool(true), +// Position: pulumi.Int(2), +// Type: pulumi.String("notify_by_mobile_app_critical"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// ```sh +// $ pulumi import grafana:index/oncallUserNotificationRule:OncallUserNotificationRule name "{{ id }}" +// ``` +type OncallUserNotificationRule struct { + pulumi.CustomResourceState + + // A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + Duration pulumi.IntPtrOutput `pulumi:"duration"` + // Boolean value which indicates if a rule is “important” + Important pulumi.BoolOutput `pulumi:"important"` + // Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + Position pulumi.IntPtrOutput `pulumi:"position"` + // The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + Type pulumi.StringOutput `pulumi:"type"` + // User ID + UserId pulumi.StringOutput `pulumi:"userId"` +} + +// NewOncallUserNotificationRule registers a new resource with the given unique name, arguments, and options. +func NewOncallUserNotificationRule(ctx *pulumi.Context, + name string, args *OncallUserNotificationRuleArgs, opts ...pulumi.ResourceOption) (*OncallUserNotificationRule, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Type == nil { + return nil, errors.New("invalid value for required argument 'Type'") + } + if args.UserId == nil { + return nil, errors.New("invalid value for required argument 'UserId'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource OncallUserNotificationRule + err := ctx.RegisterResource("grafana:index/oncallUserNotificationRule:OncallUserNotificationRule", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetOncallUserNotificationRule gets an existing OncallUserNotificationRule resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetOncallUserNotificationRule(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *OncallUserNotificationRuleState, opts ...pulumi.ResourceOption) (*OncallUserNotificationRule, error) { + var resource OncallUserNotificationRule + err := ctx.ReadResource("grafana:index/oncallUserNotificationRule:OncallUserNotificationRule", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering OncallUserNotificationRule resources. +type oncallUserNotificationRuleState struct { + // A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + Duration *int `pulumi:"duration"` + // Boolean value which indicates if a rule is “important” + Important *bool `pulumi:"important"` + // Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + Position *int `pulumi:"position"` + // The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + Type *string `pulumi:"type"` + // User ID + UserId *string `pulumi:"userId"` +} + +type OncallUserNotificationRuleState struct { + // A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + Duration pulumi.IntPtrInput + // Boolean value which indicates if a rule is “important” + Important pulumi.BoolPtrInput + // Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + Position pulumi.IntPtrInput + // The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + Type pulumi.StringPtrInput + // User ID + UserId pulumi.StringPtrInput +} + +func (OncallUserNotificationRuleState) ElementType() reflect.Type { + return reflect.TypeOf((*oncallUserNotificationRuleState)(nil)).Elem() +} + +type oncallUserNotificationRuleArgs struct { + // A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + Duration *int `pulumi:"duration"` + // Boolean value which indicates if a rule is “important” + Important *bool `pulumi:"important"` + // Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + Position *int `pulumi:"position"` + // The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + Type string `pulumi:"type"` + // User ID + UserId string `pulumi:"userId"` +} + +// The set of arguments for constructing a OncallUserNotificationRule resource. +type OncallUserNotificationRuleArgs struct { + // A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + Duration pulumi.IntPtrInput + // Boolean value which indicates if a rule is “important” + Important pulumi.BoolPtrInput + // Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + Position pulumi.IntPtrInput + // The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + Type pulumi.StringInput + // User ID + UserId pulumi.StringInput +} + +func (OncallUserNotificationRuleArgs) ElementType() reflect.Type { + return reflect.TypeOf((*oncallUserNotificationRuleArgs)(nil)).Elem() +} + +type OncallUserNotificationRuleInput interface { + pulumi.Input + + ToOncallUserNotificationRuleOutput() OncallUserNotificationRuleOutput + ToOncallUserNotificationRuleOutputWithContext(ctx context.Context) OncallUserNotificationRuleOutput +} + +func (*OncallUserNotificationRule) ElementType() reflect.Type { + return reflect.TypeOf((**OncallUserNotificationRule)(nil)).Elem() +} + +func (i *OncallUserNotificationRule) ToOncallUserNotificationRuleOutput() OncallUserNotificationRuleOutput { + return i.ToOncallUserNotificationRuleOutputWithContext(context.Background()) +} + +func (i *OncallUserNotificationRule) ToOncallUserNotificationRuleOutputWithContext(ctx context.Context) OncallUserNotificationRuleOutput { + return pulumi.ToOutputWithContext(ctx, i).(OncallUserNotificationRuleOutput) +} + +// OncallUserNotificationRuleArrayInput is an input type that accepts OncallUserNotificationRuleArray and OncallUserNotificationRuleArrayOutput values. +// You can construct a concrete instance of `OncallUserNotificationRuleArrayInput` via: +// +// OncallUserNotificationRuleArray{ OncallUserNotificationRuleArgs{...} } +type OncallUserNotificationRuleArrayInput interface { + pulumi.Input + + ToOncallUserNotificationRuleArrayOutput() OncallUserNotificationRuleArrayOutput + ToOncallUserNotificationRuleArrayOutputWithContext(context.Context) OncallUserNotificationRuleArrayOutput +} + +type OncallUserNotificationRuleArray []OncallUserNotificationRuleInput + +func (OncallUserNotificationRuleArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*OncallUserNotificationRule)(nil)).Elem() +} + +func (i OncallUserNotificationRuleArray) ToOncallUserNotificationRuleArrayOutput() OncallUserNotificationRuleArrayOutput { + return i.ToOncallUserNotificationRuleArrayOutputWithContext(context.Background()) +} + +func (i OncallUserNotificationRuleArray) ToOncallUserNotificationRuleArrayOutputWithContext(ctx context.Context) OncallUserNotificationRuleArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(OncallUserNotificationRuleArrayOutput) +} + +// OncallUserNotificationRuleMapInput is an input type that accepts OncallUserNotificationRuleMap and OncallUserNotificationRuleMapOutput values. +// You can construct a concrete instance of `OncallUserNotificationRuleMapInput` via: +// +// OncallUserNotificationRuleMap{ "key": OncallUserNotificationRuleArgs{...} } +type OncallUserNotificationRuleMapInput interface { + pulumi.Input + + ToOncallUserNotificationRuleMapOutput() OncallUserNotificationRuleMapOutput + ToOncallUserNotificationRuleMapOutputWithContext(context.Context) OncallUserNotificationRuleMapOutput +} + +type OncallUserNotificationRuleMap map[string]OncallUserNotificationRuleInput + +func (OncallUserNotificationRuleMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*OncallUserNotificationRule)(nil)).Elem() +} + +func (i OncallUserNotificationRuleMap) ToOncallUserNotificationRuleMapOutput() OncallUserNotificationRuleMapOutput { + return i.ToOncallUserNotificationRuleMapOutputWithContext(context.Background()) +} + +func (i OncallUserNotificationRuleMap) ToOncallUserNotificationRuleMapOutputWithContext(ctx context.Context) OncallUserNotificationRuleMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(OncallUserNotificationRuleMapOutput) +} + +type OncallUserNotificationRuleOutput struct{ *pulumi.OutputState } + +func (OncallUserNotificationRuleOutput) ElementType() reflect.Type { + return reflect.TypeOf((**OncallUserNotificationRule)(nil)).Elem() +} + +func (o OncallUserNotificationRuleOutput) ToOncallUserNotificationRuleOutput() OncallUserNotificationRuleOutput { + return o +} + +func (o OncallUserNotificationRuleOutput) ToOncallUserNotificationRuleOutputWithContext(ctx context.Context) OncallUserNotificationRuleOutput { + return o +} + +// A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 +func (o OncallUserNotificationRuleOutput) Duration() pulumi.IntPtrOutput { + return o.ApplyT(func(v *OncallUserNotificationRule) pulumi.IntPtrOutput { return v.Duration }).(pulumi.IntPtrOutput) +} + +// Boolean value which indicates if a rule is “important” +func (o OncallUserNotificationRuleOutput) Important() pulumi.BoolOutput { + return o.ApplyT(func(v *OncallUserNotificationRule) pulumi.BoolOutput { return v.Important }).(pulumi.BoolOutput) +} + +// Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. +func (o OncallUserNotificationRuleOutput) Position() pulumi.IntPtrOutput { + return o.ApplyT(func(v *OncallUserNotificationRule) pulumi.IntPtrOutput { return v.Position }).(pulumi.IntPtrOutput) +} + +// The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. +func (o OncallUserNotificationRuleOutput) Type() pulumi.StringOutput { + return o.ApplyT(func(v *OncallUserNotificationRule) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput) +} + +// User ID +func (o OncallUserNotificationRuleOutput) UserId() pulumi.StringOutput { + return o.ApplyT(func(v *OncallUserNotificationRule) pulumi.StringOutput { return v.UserId }).(pulumi.StringOutput) +} + +type OncallUserNotificationRuleArrayOutput struct{ *pulumi.OutputState } + +func (OncallUserNotificationRuleArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*OncallUserNotificationRule)(nil)).Elem() +} + +func (o OncallUserNotificationRuleArrayOutput) ToOncallUserNotificationRuleArrayOutput() OncallUserNotificationRuleArrayOutput { + return o +} + +func (o OncallUserNotificationRuleArrayOutput) ToOncallUserNotificationRuleArrayOutputWithContext(ctx context.Context) OncallUserNotificationRuleArrayOutput { + return o +} + +func (o OncallUserNotificationRuleArrayOutput) Index(i pulumi.IntInput) OncallUserNotificationRuleOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *OncallUserNotificationRule { + return vs[0].([]*OncallUserNotificationRule)[vs[1].(int)] + }).(OncallUserNotificationRuleOutput) +} + +type OncallUserNotificationRuleMapOutput struct{ *pulumi.OutputState } + +func (OncallUserNotificationRuleMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*OncallUserNotificationRule)(nil)).Elem() +} + +func (o OncallUserNotificationRuleMapOutput) ToOncallUserNotificationRuleMapOutput() OncallUserNotificationRuleMapOutput { + return o +} + +func (o OncallUserNotificationRuleMapOutput) ToOncallUserNotificationRuleMapOutputWithContext(ctx context.Context) OncallUserNotificationRuleMapOutput { + return o +} + +func (o OncallUserNotificationRuleMapOutput) MapIndex(k pulumi.StringInput) OncallUserNotificationRuleOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *OncallUserNotificationRule { + return vs[0].(map[string]*OncallUserNotificationRule)[vs[1].(string)] + }).(OncallUserNotificationRuleOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*OncallUserNotificationRuleInput)(nil)).Elem(), &OncallUserNotificationRule{}) + pulumi.RegisterInputType(reflect.TypeOf((*OncallUserNotificationRuleArrayInput)(nil)).Elem(), OncallUserNotificationRuleArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*OncallUserNotificationRuleMapInput)(nil)).Elem(), OncallUserNotificationRuleMap{}) + pulumi.RegisterOutputType(OncallUserNotificationRuleOutput{}) + pulumi.RegisterOutputType(OncallUserNotificationRuleArrayOutput{}) + pulumi.RegisterOutputType(OncallUserNotificationRuleMapOutput{}) +} diff --git a/sdk/go/grafana/pulumiTypes.go b/sdk/go/grafana/pulumiTypes.go index 1f7e7df5..0095769f 100644 --- a/sdk/go/grafana/pulumiTypes.go +++ b/sdk/go/grafana/pulumiTypes.go @@ -10313,6 +10313,8 @@ func (o RuleGroupRuleNotificationSettingsPtrOutput) RepeatInterval() pulumi.Stri } type SLOAlerting struct { + // Advanced Options for Alert Rules + AdvancedOptions *SLOAlertingAdvancedOptions `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations []SLOAlertingAnnotation `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -10335,6 +10337,8 @@ type SLOAlertingInput interface { } type SLOAlertingArgs struct { + // Advanced Options for Alert Rules + AdvancedOptions SLOAlertingAdvancedOptionsPtrInput `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations SLOAlertingAnnotationArrayInput `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -10396,6 +10400,11 @@ func (o SLOAlertingOutput) ToSLOAlertingOutputWithContext(ctx context.Context) S return o } +// Advanced Options for Alert Rules +func (o SLOAlertingOutput) AdvancedOptions() SLOAlertingAdvancedOptionsPtrOutput { + return o.ApplyT(func(v SLOAlerting) *SLOAlertingAdvancedOptions { return v.AdvancedOptions }).(SLOAlertingAdvancedOptionsPtrOutput) +} + // Annotations will be attached to all alerts generated by any of these rules. func (o SLOAlertingOutput) Annotations() SLOAlertingAnnotationArrayOutput { return o.ApplyT(func(v SLOAlerting) []SLOAlertingAnnotation { return v.Annotations }).(SLOAlertingAnnotationArrayOutput) @@ -10436,6 +10445,143 @@ func (o SLOAlertingArrayOutput) Index(i pulumi.IntInput) SLOAlertingOutput { }).(SLOAlertingOutput) } +type SLOAlertingAdvancedOptions struct { + // Minimum number of failed events to trigger an alert + MinFailures *int `pulumi:"minFailures"` +} + +// SLOAlertingAdvancedOptionsInput is an input type that accepts SLOAlertingAdvancedOptionsArgs and SLOAlertingAdvancedOptionsOutput values. +// You can construct a concrete instance of `SLOAlertingAdvancedOptionsInput` via: +// +// SLOAlertingAdvancedOptionsArgs{...} +type SLOAlertingAdvancedOptionsInput interface { + pulumi.Input + + ToSLOAlertingAdvancedOptionsOutput() SLOAlertingAdvancedOptionsOutput + ToSLOAlertingAdvancedOptionsOutputWithContext(context.Context) SLOAlertingAdvancedOptionsOutput +} + +type SLOAlertingAdvancedOptionsArgs struct { + // Minimum number of failed events to trigger an alert + MinFailures pulumi.IntPtrInput `pulumi:"minFailures"` +} + +func (SLOAlertingAdvancedOptionsArgs) ElementType() reflect.Type { + return reflect.TypeOf((*SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsOutput() SLOAlertingAdvancedOptionsOutput { + return i.ToSLOAlertingAdvancedOptionsOutputWithContext(context.Background()) +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsOutput { + return pulumi.ToOutputWithContext(ctx, i).(SLOAlertingAdvancedOptionsOutput) +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return i.ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(SLOAlertingAdvancedOptionsOutput).ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx) +} + +// SLOAlertingAdvancedOptionsPtrInput is an input type that accepts SLOAlertingAdvancedOptionsArgs, SLOAlertingAdvancedOptionsPtr and SLOAlertingAdvancedOptionsPtrOutput values. +// You can construct a concrete instance of `SLOAlertingAdvancedOptionsPtrInput` via: +// +// SLOAlertingAdvancedOptionsArgs{...} +// +// or: +// +// nil +type SLOAlertingAdvancedOptionsPtrInput interface { + pulumi.Input + + ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput + ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Context) SLOAlertingAdvancedOptionsPtrOutput +} + +type sloalertingAdvancedOptionsPtrType SLOAlertingAdvancedOptionsArgs + +func SLOAlertingAdvancedOptionsPtr(v *SLOAlertingAdvancedOptionsArgs) SLOAlertingAdvancedOptionsPtrInput { + return (*sloalertingAdvancedOptionsPtrType)(v) +} + +func (*sloalertingAdvancedOptionsPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (i *sloalertingAdvancedOptionsPtrType) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return i.ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i *sloalertingAdvancedOptionsPtrType) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(SLOAlertingAdvancedOptionsPtrOutput) +} + +type SLOAlertingAdvancedOptionsOutput struct{ *pulumi.OutputState } + +func (SLOAlertingAdvancedOptionsOutput) ElementType() reflect.Type { + return reflect.TypeOf((*SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsOutput() SLOAlertingAdvancedOptionsOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return o.ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v SLOAlertingAdvancedOptions) *SLOAlertingAdvancedOptions { + return &v + }).(SLOAlertingAdvancedOptionsPtrOutput) +} + +// Minimum number of failed events to trigger an alert +func (o SLOAlertingAdvancedOptionsOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v SLOAlertingAdvancedOptions) *int { return v.MinFailures }).(pulumi.IntPtrOutput) +} + +type SLOAlertingAdvancedOptionsPtrOutput struct{ *pulumi.OutputState } + +func (SLOAlertingAdvancedOptionsPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (o SLOAlertingAdvancedOptionsPtrOutput) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsPtrOutput) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsPtrOutput) Elem() SLOAlertingAdvancedOptionsOutput { + return o.ApplyT(func(v *SLOAlertingAdvancedOptions) SLOAlertingAdvancedOptions { + if v != nil { + return *v + } + var ret SLOAlertingAdvancedOptions + return ret + }).(SLOAlertingAdvancedOptionsOutput) +} + +// Minimum number of failed events to trigger an alert +func (o SLOAlertingAdvancedOptionsPtrOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v *SLOAlertingAdvancedOptions) *int { + if v == nil { + return nil + } + return v.MinFailures + }).(pulumi.IntPtrOutput) +} + type SLOAlertingAnnotation struct { Key string `pulumi:"key"` Value string `pulumi:"value"` @@ -19156,6 +19302,8 @@ func (o GetSlosSloArrayOutput) Index(i pulumi.IntInput) GetSlosSloOutput { } type GetSlosSloAlerting struct { + // Advanced Options for Alert Rules + AdvancedOptions *GetSlosSloAlertingAdvancedOptions `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations []GetSlosSloAlertingAnnotation `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -19178,6 +19326,8 @@ type GetSlosSloAlertingInput interface { } type GetSlosSloAlertingArgs struct { + // Advanced Options for Alert Rules + AdvancedOptions GetSlosSloAlertingAdvancedOptionsPtrInput `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations GetSlosSloAlertingAnnotationArrayInput `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -19239,6 +19389,11 @@ func (o GetSlosSloAlertingOutput) ToGetSlosSloAlertingOutputWithContext(ctx cont return o } +// Advanced Options for Alert Rules +func (o GetSlosSloAlertingOutput) AdvancedOptions() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o.ApplyT(func(v GetSlosSloAlerting) *GetSlosSloAlertingAdvancedOptions { return v.AdvancedOptions }).(GetSlosSloAlertingAdvancedOptionsPtrOutput) +} + // Annotations will be attached to all alerts generated by any of these rules. func (o GetSlosSloAlertingOutput) Annotations() GetSlosSloAlertingAnnotationArrayOutput { return o.ApplyT(func(v GetSlosSloAlerting) []GetSlosSloAlertingAnnotation { return v.Annotations }).(GetSlosSloAlertingAnnotationArrayOutput) @@ -19279,6 +19434,143 @@ func (o GetSlosSloAlertingArrayOutput) Index(i pulumi.IntInput) GetSlosSloAlerti }).(GetSlosSloAlertingOutput) } +type GetSlosSloAlertingAdvancedOptions struct { + // Minimum number of failed events to trigger an alert + MinFailures *int `pulumi:"minFailures"` +} + +// GetSlosSloAlertingAdvancedOptionsInput is an input type that accepts GetSlosSloAlertingAdvancedOptionsArgs and GetSlosSloAlertingAdvancedOptionsOutput values. +// You can construct a concrete instance of `GetSlosSloAlertingAdvancedOptionsInput` via: +// +// GetSlosSloAlertingAdvancedOptionsArgs{...} +type GetSlosSloAlertingAdvancedOptionsInput interface { + pulumi.Input + + ToGetSlosSloAlertingAdvancedOptionsOutput() GetSlosSloAlertingAdvancedOptionsOutput + ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(context.Context) GetSlosSloAlertingAdvancedOptionsOutput +} + +type GetSlosSloAlertingAdvancedOptionsArgs struct { + // Minimum number of failed events to trigger an alert + MinFailures pulumi.IntPtrInput `pulumi:"minFailures"` +} + +func (GetSlosSloAlertingAdvancedOptionsArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsOutput() GetSlosSloAlertingAdvancedOptionsOutput { + return i.ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(context.Background()) +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetSlosSloAlertingAdvancedOptionsOutput) +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return i.ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetSlosSloAlertingAdvancedOptionsOutput).ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx) +} + +// GetSlosSloAlertingAdvancedOptionsPtrInput is an input type that accepts GetSlosSloAlertingAdvancedOptionsArgs, GetSlosSloAlertingAdvancedOptionsPtr and GetSlosSloAlertingAdvancedOptionsPtrOutput values. +// You can construct a concrete instance of `GetSlosSloAlertingAdvancedOptionsPtrInput` via: +// +// GetSlosSloAlertingAdvancedOptionsArgs{...} +// +// or: +// +// nil +type GetSlosSloAlertingAdvancedOptionsPtrInput interface { + pulumi.Input + + ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput + ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput +} + +type getSlosSloAlertingAdvancedOptionsPtrType GetSlosSloAlertingAdvancedOptionsArgs + +func GetSlosSloAlertingAdvancedOptionsPtr(v *GetSlosSloAlertingAdvancedOptionsArgs) GetSlosSloAlertingAdvancedOptionsPtrInput { + return (*getSlosSloAlertingAdvancedOptionsPtrType)(v) +} + +func (*getSlosSloAlertingAdvancedOptionsPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (i *getSlosSloAlertingAdvancedOptionsPtrType) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return i.ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i *getSlosSloAlertingAdvancedOptionsPtrType) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetSlosSloAlertingAdvancedOptionsPtrOutput) +} + +type GetSlosSloAlertingAdvancedOptionsOutput struct{ *pulumi.OutputState } + +func (GetSlosSloAlertingAdvancedOptionsOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsOutput() GetSlosSloAlertingAdvancedOptionsOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o.ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v GetSlosSloAlertingAdvancedOptions) *GetSlosSloAlertingAdvancedOptions { + return &v + }).(GetSlosSloAlertingAdvancedOptionsPtrOutput) +} + +// Minimum number of failed events to trigger an alert +func (o GetSlosSloAlertingAdvancedOptionsOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v GetSlosSloAlertingAdvancedOptions) *int { return v.MinFailures }).(pulumi.IntPtrOutput) +} + +type GetSlosSloAlertingAdvancedOptionsPtrOutput struct{ *pulumi.OutputState } + +func (GetSlosSloAlertingAdvancedOptionsPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) Elem() GetSlosSloAlertingAdvancedOptionsOutput { + return o.ApplyT(func(v *GetSlosSloAlertingAdvancedOptions) GetSlosSloAlertingAdvancedOptions { + if v != nil { + return *v + } + var ret GetSlosSloAlertingAdvancedOptions + return ret + }).(GetSlosSloAlertingAdvancedOptionsOutput) +} + +// Minimum number of failed events to trigger an alert +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v *GetSlosSloAlertingAdvancedOptions) *int { + if v == nil { + return nil + } + return v.MinFailures + }).(pulumi.IntPtrOutput) +} + type GetSlosSloAlertingAnnotation struct { Key string `pulumi:"key"` Value string `pulumi:"value"` @@ -21398,6 +21690,8 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*RuleGroupRuleNotificationSettingsPtrInput)(nil)).Elem(), RuleGroupRuleNotificationSettingsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingInput)(nil)).Elem(), SLOAlertingArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingArrayInput)(nil)).Elem(), SLOAlertingArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAdvancedOptionsInput)(nil)).Elem(), SLOAlertingAdvancedOptionsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAdvancedOptionsPtrInput)(nil)).Elem(), SLOAlertingAdvancedOptionsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAnnotationInput)(nil)).Elem(), SLOAlertingAnnotationArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAnnotationArrayInput)(nil)).Elem(), SLOAlertingAnnotationArray{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingFastburnInput)(nil)).Elem(), SLOAlertingFastburnArgs{}) @@ -21498,6 +21792,8 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloArrayInput)(nil)).Elem(), GetSlosSloArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingInput)(nil)).Elem(), GetSlosSloAlertingArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingArrayInput)(nil)).Elem(), GetSlosSloAlertingArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAdvancedOptionsInput)(nil)).Elem(), GetSlosSloAlertingAdvancedOptionsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAdvancedOptionsPtrInput)(nil)).Elem(), GetSlosSloAlertingAdvancedOptionsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAnnotationInput)(nil)).Elem(), GetSlosSloAlertingAnnotationArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAnnotationArrayInput)(nil)).Elem(), GetSlosSloAlertingAnnotationArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingFastburnInput)(nil)).Elem(), GetSlosSloAlertingFastburnArgs{}) @@ -21663,6 +21959,8 @@ func init() { pulumi.RegisterOutputType(RuleGroupRuleNotificationSettingsPtrOutput{}) pulumi.RegisterOutputType(SLOAlertingOutput{}) pulumi.RegisterOutputType(SLOAlertingArrayOutput{}) + pulumi.RegisterOutputType(SLOAlertingAdvancedOptionsOutput{}) + pulumi.RegisterOutputType(SLOAlertingAdvancedOptionsPtrOutput{}) pulumi.RegisterOutputType(SLOAlertingAnnotationOutput{}) pulumi.RegisterOutputType(SLOAlertingAnnotationArrayOutput{}) pulumi.RegisterOutputType(SLOAlertingFastburnOutput{}) @@ -21763,6 +22061,8 @@ func init() { pulumi.RegisterOutputType(GetSlosSloArrayOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingArrayOutput{}) + pulumi.RegisterOutputType(GetSlosSloAlertingAdvancedOptionsOutput{}) + pulumi.RegisterOutputType(GetSlosSloAlertingAdvancedOptionsPtrOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingAnnotationOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingAnnotationArrayOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingFastburnOutput{}) diff --git a/sdk/go/grafana/slo/pulumiTypes.go b/sdk/go/grafana/slo/pulumiTypes.go index 93c012a1..78e44112 100644 --- a/sdk/go/grafana/slo/pulumiTypes.go +++ b/sdk/go/grafana/slo/pulumiTypes.go @@ -14,6 +14,8 @@ import ( var _ = internal.GetEnvOrDefault type SLOAlerting struct { + // Advanced Options for Alert Rules + AdvancedOptions *SLOAlertingAdvancedOptions `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations []SLOAlertingAnnotation `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -36,6 +38,8 @@ type SLOAlertingInput interface { } type SLOAlertingArgs struct { + // Advanced Options for Alert Rules + AdvancedOptions SLOAlertingAdvancedOptionsPtrInput `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations SLOAlertingAnnotationArrayInput `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -97,6 +101,11 @@ func (o SLOAlertingOutput) ToSLOAlertingOutputWithContext(ctx context.Context) S return o } +// Advanced Options for Alert Rules +func (o SLOAlertingOutput) AdvancedOptions() SLOAlertingAdvancedOptionsPtrOutput { + return o.ApplyT(func(v SLOAlerting) *SLOAlertingAdvancedOptions { return v.AdvancedOptions }).(SLOAlertingAdvancedOptionsPtrOutput) +} + // Annotations will be attached to all alerts generated by any of these rules. func (o SLOAlertingOutput) Annotations() SLOAlertingAnnotationArrayOutput { return o.ApplyT(func(v SLOAlerting) []SLOAlertingAnnotation { return v.Annotations }).(SLOAlertingAnnotationArrayOutput) @@ -137,6 +146,143 @@ func (o SLOAlertingArrayOutput) Index(i pulumi.IntInput) SLOAlertingOutput { }).(SLOAlertingOutput) } +type SLOAlertingAdvancedOptions struct { + // Minimum number of failed events to trigger an alert + MinFailures *int `pulumi:"minFailures"` +} + +// SLOAlertingAdvancedOptionsInput is an input type that accepts SLOAlertingAdvancedOptionsArgs and SLOAlertingAdvancedOptionsOutput values. +// You can construct a concrete instance of `SLOAlertingAdvancedOptionsInput` via: +// +// SLOAlertingAdvancedOptionsArgs{...} +type SLOAlertingAdvancedOptionsInput interface { + pulumi.Input + + ToSLOAlertingAdvancedOptionsOutput() SLOAlertingAdvancedOptionsOutput + ToSLOAlertingAdvancedOptionsOutputWithContext(context.Context) SLOAlertingAdvancedOptionsOutput +} + +type SLOAlertingAdvancedOptionsArgs struct { + // Minimum number of failed events to trigger an alert + MinFailures pulumi.IntPtrInput `pulumi:"minFailures"` +} + +func (SLOAlertingAdvancedOptionsArgs) ElementType() reflect.Type { + return reflect.TypeOf((*SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsOutput() SLOAlertingAdvancedOptionsOutput { + return i.ToSLOAlertingAdvancedOptionsOutputWithContext(context.Background()) +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsOutput { + return pulumi.ToOutputWithContext(ctx, i).(SLOAlertingAdvancedOptionsOutput) +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return i.ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i SLOAlertingAdvancedOptionsArgs) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(SLOAlertingAdvancedOptionsOutput).ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx) +} + +// SLOAlertingAdvancedOptionsPtrInput is an input type that accepts SLOAlertingAdvancedOptionsArgs, SLOAlertingAdvancedOptionsPtr and SLOAlertingAdvancedOptionsPtrOutput values. +// You can construct a concrete instance of `SLOAlertingAdvancedOptionsPtrInput` via: +// +// SLOAlertingAdvancedOptionsArgs{...} +// +// or: +// +// nil +type SLOAlertingAdvancedOptionsPtrInput interface { + pulumi.Input + + ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput + ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Context) SLOAlertingAdvancedOptionsPtrOutput +} + +type sloalertingAdvancedOptionsPtrType SLOAlertingAdvancedOptionsArgs + +func SLOAlertingAdvancedOptionsPtr(v *SLOAlertingAdvancedOptionsArgs) SLOAlertingAdvancedOptionsPtrInput { + return (*sloalertingAdvancedOptionsPtrType)(v) +} + +func (*sloalertingAdvancedOptionsPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (i *sloalertingAdvancedOptionsPtrType) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return i.ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i *sloalertingAdvancedOptionsPtrType) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(SLOAlertingAdvancedOptionsPtrOutput) +} + +type SLOAlertingAdvancedOptionsOutput struct{ *pulumi.OutputState } + +func (SLOAlertingAdvancedOptionsOutput) ElementType() reflect.Type { + return reflect.TypeOf((*SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsOutput() SLOAlertingAdvancedOptionsOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return o.ToSLOAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (o SLOAlertingAdvancedOptionsOutput) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v SLOAlertingAdvancedOptions) *SLOAlertingAdvancedOptions { + return &v + }).(SLOAlertingAdvancedOptionsPtrOutput) +} + +// Minimum number of failed events to trigger an alert +func (o SLOAlertingAdvancedOptionsOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v SLOAlertingAdvancedOptions) *int { return v.MinFailures }).(pulumi.IntPtrOutput) +} + +type SLOAlertingAdvancedOptionsPtrOutput struct{ *pulumi.OutputState } + +func (SLOAlertingAdvancedOptionsPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**SLOAlertingAdvancedOptions)(nil)).Elem() +} + +func (o SLOAlertingAdvancedOptionsPtrOutput) ToSLOAlertingAdvancedOptionsPtrOutput() SLOAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsPtrOutput) ToSLOAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) SLOAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o SLOAlertingAdvancedOptionsPtrOutput) Elem() SLOAlertingAdvancedOptionsOutput { + return o.ApplyT(func(v *SLOAlertingAdvancedOptions) SLOAlertingAdvancedOptions { + if v != nil { + return *v + } + var ret SLOAlertingAdvancedOptions + return ret + }).(SLOAlertingAdvancedOptionsOutput) +} + +// Minimum number of failed events to trigger an alert +func (o SLOAlertingAdvancedOptionsPtrOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v *SLOAlertingAdvancedOptions) *int { + if v == nil { + return nil + } + return v.MinFailures + }).(pulumi.IntPtrOutput) +} + type SLOAlertingAnnotation struct { Key string `pulumi:"key"` Value string `pulumi:"value"` @@ -1896,6 +2042,8 @@ func (o GetSlosSloArrayOutput) Index(i pulumi.IntInput) GetSlosSloOutput { } type GetSlosSloAlerting struct { + // Advanced Options for Alert Rules + AdvancedOptions *GetSlosSloAlertingAdvancedOptions `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations []GetSlosSloAlertingAnnotation `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -1918,6 +2066,8 @@ type GetSlosSloAlertingInput interface { } type GetSlosSloAlertingArgs struct { + // Advanced Options for Alert Rules + AdvancedOptions GetSlosSloAlertingAdvancedOptionsPtrInput `pulumi:"advancedOptions"` // Annotations will be attached to all alerts generated by any of these rules. Annotations GetSlosSloAlertingAnnotationArrayInput `pulumi:"annotations"` // Alerting Rules generated for Fast Burn alerts @@ -1979,6 +2129,11 @@ func (o GetSlosSloAlertingOutput) ToGetSlosSloAlertingOutputWithContext(ctx cont return o } +// Advanced Options for Alert Rules +func (o GetSlosSloAlertingOutput) AdvancedOptions() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o.ApplyT(func(v GetSlosSloAlerting) *GetSlosSloAlertingAdvancedOptions { return v.AdvancedOptions }).(GetSlosSloAlertingAdvancedOptionsPtrOutput) +} + // Annotations will be attached to all alerts generated by any of these rules. func (o GetSlosSloAlertingOutput) Annotations() GetSlosSloAlertingAnnotationArrayOutput { return o.ApplyT(func(v GetSlosSloAlerting) []GetSlosSloAlertingAnnotation { return v.Annotations }).(GetSlosSloAlertingAnnotationArrayOutput) @@ -2019,6 +2174,143 @@ func (o GetSlosSloAlertingArrayOutput) Index(i pulumi.IntInput) GetSlosSloAlerti }).(GetSlosSloAlertingOutput) } +type GetSlosSloAlertingAdvancedOptions struct { + // Minimum number of failed events to trigger an alert + MinFailures *int `pulumi:"minFailures"` +} + +// GetSlosSloAlertingAdvancedOptionsInput is an input type that accepts GetSlosSloAlertingAdvancedOptionsArgs and GetSlosSloAlertingAdvancedOptionsOutput values. +// You can construct a concrete instance of `GetSlosSloAlertingAdvancedOptionsInput` via: +// +// GetSlosSloAlertingAdvancedOptionsArgs{...} +type GetSlosSloAlertingAdvancedOptionsInput interface { + pulumi.Input + + ToGetSlosSloAlertingAdvancedOptionsOutput() GetSlosSloAlertingAdvancedOptionsOutput + ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(context.Context) GetSlosSloAlertingAdvancedOptionsOutput +} + +type GetSlosSloAlertingAdvancedOptionsArgs struct { + // Minimum number of failed events to trigger an alert + MinFailures pulumi.IntPtrInput `pulumi:"minFailures"` +} + +func (GetSlosSloAlertingAdvancedOptionsArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsOutput() GetSlosSloAlertingAdvancedOptionsOutput { + return i.ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(context.Background()) +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetSlosSloAlertingAdvancedOptionsOutput) +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return i.ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i GetSlosSloAlertingAdvancedOptionsArgs) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetSlosSloAlertingAdvancedOptionsOutput).ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx) +} + +// GetSlosSloAlertingAdvancedOptionsPtrInput is an input type that accepts GetSlosSloAlertingAdvancedOptionsArgs, GetSlosSloAlertingAdvancedOptionsPtr and GetSlosSloAlertingAdvancedOptionsPtrOutput values. +// You can construct a concrete instance of `GetSlosSloAlertingAdvancedOptionsPtrInput` via: +// +// GetSlosSloAlertingAdvancedOptionsArgs{...} +// +// or: +// +// nil +type GetSlosSloAlertingAdvancedOptionsPtrInput interface { + pulumi.Input + + ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput + ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput +} + +type getSlosSloAlertingAdvancedOptionsPtrType GetSlosSloAlertingAdvancedOptionsArgs + +func GetSlosSloAlertingAdvancedOptionsPtr(v *GetSlosSloAlertingAdvancedOptionsArgs) GetSlosSloAlertingAdvancedOptionsPtrInput { + return (*getSlosSloAlertingAdvancedOptionsPtrType)(v) +} + +func (*getSlosSloAlertingAdvancedOptionsPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (i *getSlosSloAlertingAdvancedOptionsPtrType) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return i.ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (i *getSlosSloAlertingAdvancedOptionsPtrType) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetSlosSloAlertingAdvancedOptionsPtrOutput) +} + +type GetSlosSloAlertingAdvancedOptionsOutput struct{ *pulumi.OutputState } + +func (GetSlosSloAlertingAdvancedOptionsOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsOutput() GetSlosSloAlertingAdvancedOptionsOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o.ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(context.Background()) +} + +func (o GetSlosSloAlertingAdvancedOptionsOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v GetSlosSloAlertingAdvancedOptions) *GetSlosSloAlertingAdvancedOptions { + return &v + }).(GetSlosSloAlertingAdvancedOptionsPtrOutput) +} + +// Minimum number of failed events to trigger an alert +func (o GetSlosSloAlertingAdvancedOptionsOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v GetSlosSloAlertingAdvancedOptions) *int { return v.MinFailures }).(pulumi.IntPtrOutput) +} + +type GetSlosSloAlertingAdvancedOptionsPtrOutput struct{ *pulumi.OutputState } + +func (GetSlosSloAlertingAdvancedOptionsPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**GetSlosSloAlertingAdvancedOptions)(nil)).Elem() +} + +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutput() GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) ToGetSlosSloAlertingAdvancedOptionsPtrOutputWithContext(ctx context.Context) GetSlosSloAlertingAdvancedOptionsPtrOutput { + return o +} + +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) Elem() GetSlosSloAlertingAdvancedOptionsOutput { + return o.ApplyT(func(v *GetSlosSloAlertingAdvancedOptions) GetSlosSloAlertingAdvancedOptions { + if v != nil { + return *v + } + var ret GetSlosSloAlertingAdvancedOptions + return ret + }).(GetSlosSloAlertingAdvancedOptionsOutput) +} + +// Minimum number of failed events to trigger an alert +func (o GetSlosSloAlertingAdvancedOptionsPtrOutput) MinFailures() pulumi.IntPtrOutput { + return o.ApplyT(func(v *GetSlosSloAlertingAdvancedOptions) *int { + if v == nil { + return nil + } + return v.MinFailures + }).(pulumi.IntPtrOutput) +} + type GetSlosSloAlertingAnnotation struct { Key string `pulumi:"key"` Value string `pulumi:"value"` @@ -3558,6 +3850,8 @@ func (o GetSlosSloQueryRatioPtrOutput) TotalMetric() pulumi.StringPtrOutput { func init() { pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingInput)(nil)).Elem(), SLOAlertingArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingArrayInput)(nil)).Elem(), SLOAlertingArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAdvancedOptionsInput)(nil)).Elem(), SLOAlertingAdvancedOptionsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAdvancedOptionsPtrInput)(nil)).Elem(), SLOAlertingAdvancedOptionsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAnnotationInput)(nil)).Elem(), SLOAlertingAnnotationArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingAnnotationArrayInput)(nil)).Elem(), SLOAlertingAnnotationArray{}) pulumi.RegisterInputType(reflect.TypeOf((*SLOAlertingFastburnInput)(nil)).Elem(), SLOAlertingFastburnArgs{}) @@ -3590,6 +3884,8 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloArrayInput)(nil)).Elem(), GetSlosSloArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingInput)(nil)).Elem(), GetSlosSloAlertingArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingArrayInput)(nil)).Elem(), GetSlosSloAlertingArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAdvancedOptionsInput)(nil)).Elem(), GetSlosSloAlertingAdvancedOptionsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAdvancedOptionsPtrInput)(nil)).Elem(), GetSlosSloAlertingAdvancedOptionsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAnnotationInput)(nil)).Elem(), GetSlosSloAlertingAnnotationArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingAnnotationArrayInput)(nil)).Elem(), GetSlosSloAlertingAnnotationArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloAlertingFastburnInput)(nil)).Elem(), GetSlosSloAlertingFastburnArgs{}) @@ -3620,6 +3916,8 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*GetSlosSloQueryRatioPtrInput)(nil)).Elem(), GetSlosSloQueryRatioArgs{}) pulumi.RegisterOutputType(SLOAlertingOutput{}) pulumi.RegisterOutputType(SLOAlertingArrayOutput{}) + pulumi.RegisterOutputType(SLOAlertingAdvancedOptionsOutput{}) + pulumi.RegisterOutputType(SLOAlertingAdvancedOptionsPtrOutput{}) pulumi.RegisterOutputType(SLOAlertingAnnotationOutput{}) pulumi.RegisterOutputType(SLOAlertingAnnotationArrayOutput{}) pulumi.RegisterOutputType(SLOAlertingFastburnOutput{}) @@ -3652,6 +3950,8 @@ func init() { pulumi.RegisterOutputType(GetSlosSloArrayOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingArrayOutput{}) + pulumi.RegisterOutputType(GetSlosSloAlertingAdvancedOptionsOutput{}) + pulumi.RegisterOutputType(GetSlosSloAlertingAdvancedOptionsPtrOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingAnnotationOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingAnnotationArrayOutput{}) pulumi.RegisterOutputType(GetSlosSloAlertingFastburnOutput{}) diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 82c539e2..eb2e06ba 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -310,6 +310,11 @@ export type OncallSchedule = import("./oncallSchedule").OncallSchedule; export const OncallSchedule: typeof import("./oncallSchedule").OncallSchedule = null as any; utilities.lazyLoad(exports, ["OncallSchedule"], () => require("./oncallSchedule")); +export { OncallUserNotificationRuleArgs, OncallUserNotificationRuleState } from "./oncallUserNotificationRule"; +export type OncallUserNotificationRule = import("./oncallUserNotificationRule").OncallUserNotificationRule; +export const OncallUserNotificationRule: typeof import("./oncallUserNotificationRule").OncallUserNotificationRule = null as any; +utilities.lazyLoad(exports, ["OncallUserNotificationRule"], () => require("./oncallUserNotificationRule")); + export { OrganizationArgs, OrganizationState } from "./organization"; export type Organization = import("./organization").Organization; export const Organization: typeof import("./organization").Organization = null as any; @@ -513,6 +518,8 @@ const _module = { return new OncallRoute(name, undefined, { urn }) case "grafana:index/oncallSchedule:OncallSchedule": return new OncallSchedule(name, undefined, { urn }) + case "grafana:index/oncallUserNotificationRule:OncallUserNotificationRule": + return new OncallUserNotificationRule(name, undefined, { urn }) case "grafana:index/organization:Organization": return new Organization(name, undefined, { urn }) case "grafana:index/organizationPreferences:OrganizationPreferences": @@ -592,6 +599,7 @@ pulumi.runtime.registerResourceModule("grafana", "index/oncallOnCallShift", _mod pulumi.runtime.registerResourceModule("grafana", "index/oncallOutgoingWebhook", _module) pulumi.runtime.registerResourceModule("grafana", "index/oncallRoute", _module) pulumi.runtime.registerResourceModule("grafana", "index/oncallSchedule", _module) +pulumi.runtime.registerResourceModule("grafana", "index/oncallUserNotificationRule", _module) pulumi.runtime.registerResourceModule("grafana", "index/organization", _module) pulumi.runtime.registerResourceModule("grafana", "index/organizationPreferences", _module) pulumi.runtime.registerResourceModule("grafana", "index/playlist", _module) diff --git a/sdk/nodejs/oncallUserNotificationRule.ts b/sdk/nodejs/oncallUserNotificationRule.ts new file mode 100644 index 00000000..a2a09822 --- /dev/null +++ b/sdk/nodejs/oncallUserNotificationRule.ts @@ -0,0 +1,212 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as utilities from "./utilities"; + +/** + * * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/) + * + * **Note**: you must be running Grafana OnCall >= v1.8.0 to use this resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as grafana from "@pulumi/grafana"; + * import * as grafana from "@pulumiverse/grafana"; + * + * const myUser = grafana.onCall.getUser({ + * username: "my_username", + * }); + * const myUserStep1 = new grafana.OncallUserNotificationRule("my_user_step_1", { + * userId: myUser.then(myUser => myUser.id), + * position: 0, + * type: "notify_by_mobile_app", + * }); + * const myUserStep2 = new grafana.OncallUserNotificationRule("my_user_step_2", { + * userId: myUser.then(myUser => myUser.id), + * position: 1, + * duration: 600, + * type: "wait", + * }); + * const myUserStep3 = new grafana.OncallUserNotificationRule("my_user_step_3", { + * userId: myUser.then(myUser => myUser.id), + * position: 2, + * type: "notify_by_phone_call", + * }); + * const myUserStep4 = new grafana.OncallUserNotificationRule("my_user_step_4", { + * userId: myUser.then(myUser => myUser.id), + * position: 3, + * duration: 300, + * type: "wait", + * }); + * const myUserStep5 = new grafana.OncallUserNotificationRule("my_user_step_5", { + * userId: myUser.then(myUser => myUser.id), + * position: 4, + * type: "notify_by_slack", + * }); + * const myUserImportantStep1 = new grafana.OncallUserNotificationRule("my_user_important_step_1", { + * userId: myUser.then(myUser => myUser.id), + * important: true, + * position: 0, + * type: "notify_by_mobile_app_critical", + * }); + * const myUserImportantStep2 = new grafana.OncallUserNotificationRule("my_user_important_step_2", { + * userId: myUser.then(myUser => myUser.id), + * important: true, + * position: 1, + * duration: 300, + * type: "wait", + * }); + * const myUserImportantStep3 = new grafana.OncallUserNotificationRule("my_user_important_step_3", { + * userId: myUser.then(myUser => myUser.id), + * important: true, + * position: 2, + * type: "notify_by_mobile_app_critical", + * }); + * ``` + * + * ## Import + * + * ```sh + * $ pulumi import grafana:index/oncallUserNotificationRule:OncallUserNotificationRule name "{{ id }}" + * ``` + */ +export class OncallUserNotificationRule extends pulumi.CustomResource { + /** + * Get an existing OncallUserNotificationRule resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: OncallUserNotificationRuleState, opts?: pulumi.CustomResourceOptions): OncallUserNotificationRule { + return new OncallUserNotificationRule(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'grafana:index/oncallUserNotificationRule:OncallUserNotificationRule'; + + /** + * Returns true if the given object is an instance of OncallUserNotificationRule. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is OncallUserNotificationRule { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === OncallUserNotificationRule.__pulumiType; + } + + /** + * A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + */ + public readonly duration!: pulumi.Output; + /** + * Boolean value which indicates if a rule is “important” + */ + public readonly important!: pulumi.Output; + /** + * Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + */ + public readonly position!: pulumi.Output; + /** + * The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + */ + public readonly type!: pulumi.Output; + /** + * User ID + */ + public readonly userId!: pulumi.Output; + + /** + * Create a OncallUserNotificationRule resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: OncallUserNotificationRuleArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: OncallUserNotificationRuleArgs | OncallUserNotificationRuleState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as OncallUserNotificationRuleState | undefined; + resourceInputs["duration"] = state ? state.duration : undefined; + resourceInputs["important"] = state ? state.important : undefined; + resourceInputs["position"] = state ? state.position : undefined; + resourceInputs["type"] = state ? state.type : undefined; + resourceInputs["userId"] = state ? state.userId : undefined; + } else { + const args = argsOrState as OncallUserNotificationRuleArgs | undefined; + if ((!args || args.type === undefined) && !opts.urn) { + throw new Error("Missing required property 'type'"); + } + if ((!args || args.userId === undefined) && !opts.urn) { + throw new Error("Missing required property 'userId'"); + } + resourceInputs["duration"] = args ? args.duration : undefined; + resourceInputs["important"] = args ? args.important : undefined; + resourceInputs["position"] = args ? args.position : undefined; + resourceInputs["type"] = args ? args.type : undefined; + resourceInputs["userId"] = args ? args.userId : undefined; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(OncallUserNotificationRule.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering OncallUserNotificationRule resources. + */ +export interface OncallUserNotificationRuleState { + /** + * A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + */ + duration?: pulumi.Input; + /** + * Boolean value which indicates if a rule is “important” + */ + important?: pulumi.Input; + /** + * Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + */ + position?: pulumi.Input; + /** + * The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + */ + type?: pulumi.Input; + /** + * User ID + */ + userId?: pulumi.Input; +} + +/** + * The set of arguments for constructing a OncallUserNotificationRule resource. + */ +export interface OncallUserNotificationRuleArgs { + /** + * A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + */ + duration?: pulumi.Input; + /** + * Boolean value which indicates if a rule is “important” + */ + important?: pulumi.Input; + /** + * Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + */ + position?: pulumi.Input; + /** + * The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. + */ + type: pulumi.Input; + /** + * User ID + */ + userId: pulumi.Input; +} diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 53003ea5..2b3fb437 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -123,6 +123,7 @@ "oncallOutgoingWebhook.ts", "oncallRoute.ts", "oncallSchedule.ts", + "oncallUserNotificationRule.ts", "organization.ts", "organizationPreferences.ts", "oss/annotation.ts", diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 01e45e85..2a49fe76 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -1665,6 +1665,10 @@ export interface RuleGroupRuleNotificationSettings { } export interface SLOAlerting { + /** + * Advanced Options for Alert Rules + */ + advancedOptions?: pulumi.Input; /** * Annotations will be attached to all alerts generated by any of these rules. */ @@ -1683,6 +1687,13 @@ export interface SLOAlerting { slowburns?: pulumi.Input[]>; } +export interface SLOAlertingAdvancedOptions { + /** + * Minimum number of failed events to trigger an alert + */ + minFailures?: pulumi.Input; +} + export interface SLOAlertingAnnotation { key: pulumi.Input; value: pulumi.Input; @@ -4625,6 +4636,10 @@ export namespace oss { export namespace slo { export interface SLOAlerting { + /** + * Advanced Options for Alert Rules + */ + advancedOptions?: pulumi.Input; /** * Annotations will be attached to all alerts generated by any of these rules. */ @@ -4643,6 +4658,13 @@ export namespace slo { slowburns?: pulumi.Input[]>; } + export interface SLOAlertingAdvancedOptions { + /** + * Minimum number of failed events to trigger an alert + */ + minFailures?: pulumi.Input; + } + export interface SLOAlertingAnnotation { key: pulumi.Input; value: pulumi.Input; diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 51fef19f..e71d77f2 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -1049,6 +1049,10 @@ export interface GetSlosSlo { } export interface GetSlosSloAlerting { + /** + * Advanced Options for Alert Rules + */ + advancedOptions?: outputs.GetSlosSloAlertingAdvancedOptions; /** * Annotations will be attached to all alerts generated by any of these rules. */ @@ -1067,6 +1071,13 @@ export interface GetSlosSloAlerting { slowburn?: outputs.GetSlosSloAlertingSlowburn; } +export interface GetSlosSloAlertingAdvancedOptions { + /** + * Minimum number of failed events to trigger an alert + */ + minFailures?: number; +} + export interface GetSlosSloAlertingAnnotation { key: string; value: string; @@ -1915,6 +1926,10 @@ export interface RuleGroupRuleNotificationSettings { } export interface SLOAlerting { + /** + * Advanced Options for Alert Rules + */ + advancedOptions?: outputs.SLOAlertingAdvancedOptions; /** * Annotations will be attached to all alerts generated by any of these rules. */ @@ -1933,6 +1948,13 @@ export interface SLOAlerting { slowburns?: outputs.SLOAlertingSlowburn[]; } +export interface SLOAlertingAdvancedOptions { + /** + * Minimum number of failed events to trigger an alert + */ + minFailures?: number; +} + export interface SLOAlertingAnnotation { key: string; value: string; @@ -5007,6 +5029,10 @@ export namespace slo { } export interface GetSlosSloAlerting { + /** + * Advanced Options for Alert Rules + */ + advancedOptions?: outputs.slo.GetSlosSloAlertingAdvancedOptions; /** * Annotations will be attached to all alerts generated by any of these rules. */ @@ -5025,6 +5051,13 @@ export namespace slo { slowburns?: outputs.slo.GetSlosSloAlertingSlowburn[]; } + export interface GetSlosSloAlertingAdvancedOptions { + /** + * Minimum number of failed events to trigger an alert + */ + minFailures?: number; + } + export interface GetSlosSloAlertingAnnotation { key: string; value: string; @@ -5132,6 +5165,10 @@ export namespace slo { } export interface SLOAlerting { + /** + * Advanced Options for Alert Rules + */ + advancedOptions?: outputs.slo.SLOAlertingAdvancedOptions; /** * Annotations will be attached to all alerts generated by any of these rules. */ @@ -5150,6 +5187,13 @@ export namespace slo { slowburns?: outputs.slo.SLOAlertingSlowburn[]; } + export interface SLOAlertingAdvancedOptions { + /** + * Minimum number of failed events to trigger an alert + */ + minFailures?: number; + } + export interface SLOAlertingAnnotation { key: string; value: string; diff --git a/sdk/python/pulumiverse_grafana/__init__.py b/sdk/python/pulumiverse_grafana/__init__.py index f196c2e9..ccc17b08 100644 --- a/sdk/python/pulumiverse_grafana/__init__.py +++ b/sdk/python/pulumiverse_grafana/__init__.py @@ -66,6 +66,7 @@ from .oncall_outgoing_webhook import * from .oncall_route import * from .oncall_schedule import * +from .oncall_user_notification_rule import * from .organization import * from .organization_preferences import * from .playlist import * @@ -548,6 +549,14 @@ "grafana:index/oncallSchedule:OncallSchedule": "OncallSchedule" } }, + { + "pkg": "grafana", + "mod": "index/oncallUserNotificationRule", + "fqn": "pulumiverse_grafana", + "classes": { + "grafana:index/oncallUserNotificationRule:OncallUserNotificationRule": "OncallUserNotificationRule" + } + }, { "pkg": "grafana", "mod": "index/organization", diff --git a/sdk/python/pulumiverse_grafana/_inputs.py b/sdk/python/pulumiverse_grafana/_inputs.py index 41ff446a..986d7d7e 100644 --- a/sdk/python/pulumiverse_grafana/_inputs.py +++ b/sdk/python/pulumiverse_grafana/_inputs.py @@ -76,6 +76,7 @@ 'RuleGroupRuleDataRelativeTimeRangeArgs', 'RuleGroupRuleNotificationSettingsArgs', 'SLOAlertingArgs', + 'SLOAlertingAdvancedOptionsArgs', 'SLOAlertingAnnotationArgs', 'SLOAlertingFastburnArgs', 'SLOAlertingFastburnAnnotationArgs', @@ -6455,16 +6456,20 @@ def repeat_interval(self, value: Optional[pulumi.Input[str]]): @pulumi.input_type class SLOAlertingArgs: def __init__(__self__, *, + advanced_options: Optional[pulumi.Input['SLOAlertingAdvancedOptionsArgs']] = None, annotations: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingAnnotationArgs']]]] = None, fastburns: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingFastburnArgs']]]] = None, labels: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingLabelArgs']]]] = None, slowburns: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingSlowburnArgs']]]] = None): """ + :param pulumi.Input['SLOAlertingAdvancedOptionsArgs'] advanced_options: Advanced Options for Alert Rules :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingAnnotationArgs']]] annotations: Annotations will be attached to all alerts generated by any of these rules. :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingFastburnArgs']]] fastburns: Alerting Rules generated for Fast Burn alerts :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingLabelArgs']]] labels: Labels will be attached to all alerts generated by any of these rules. :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingSlowburnArgs']]] slowburns: Alerting Rules generated for Slow Burn alerts """ + if advanced_options is not None: + pulumi.set(__self__, "advanced_options", advanced_options) if annotations is not None: pulumi.set(__self__, "annotations", annotations) if fastburns is not None: @@ -6474,6 +6479,18 @@ def __init__(__self__, *, if slowburns is not None: pulumi.set(__self__, "slowburns", slowburns) + @property + @pulumi.getter(name="advancedOptions") + def advanced_options(self) -> Optional[pulumi.Input['SLOAlertingAdvancedOptionsArgs']]: + """ + Advanced Options for Alert Rules + """ + return pulumi.get(self, "advanced_options") + + @advanced_options.setter + def advanced_options(self, value: Optional[pulumi.Input['SLOAlertingAdvancedOptionsArgs']]): + pulumi.set(self, "advanced_options", value) + @property @pulumi.getter def annotations(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingAnnotationArgs']]]]: @@ -6523,6 +6540,29 @@ def slowburns(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlert pulumi.set(self, "slowburns", value) +@pulumi.input_type +class SLOAlertingAdvancedOptionsArgs: + def __init__(__self__, *, + min_failures: Optional[pulumi.Input[int]] = None): + """ + :param pulumi.Input[int] min_failures: Minimum number of failed events to trigger an alert + """ + if min_failures is not None: + pulumi.set(__self__, "min_failures", min_failures) + + @property + @pulumi.getter(name="minFailures") + def min_failures(self) -> Optional[pulumi.Input[int]]: + """ + Minimum number of failed events to trigger an alert + """ + return pulumi.get(self, "min_failures") + + @min_failures.setter + def min_failures(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "min_failures", value) + + @pulumi.input_type class SLOAlertingAnnotationArgs: def __init__(__self__, *, diff --git a/sdk/python/pulumiverse_grafana/oncall_user_notification_rule.py b/sdk/python/pulumiverse_grafana/oncall_user_notification_rule.py new file mode 100644 index 00000000..57305150 --- /dev/null +++ b/sdk/python/pulumiverse_grafana/oncall_user_notification_rule.py @@ -0,0 +1,447 @@ +# coding=utf-8 +# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = ['OncallUserNotificationRuleArgs', 'OncallUserNotificationRule'] + +@pulumi.input_type +class OncallUserNotificationRuleArgs: + def __init__(__self__, *, + type: pulumi.Input[str], + user_id: pulumi.Input[str], + duration: Optional[pulumi.Input[int]] = None, + important: Optional[pulumi.Input[bool]] = None, + position: Optional[pulumi.Input[int]] = None): + """ + The set of arguments for constructing a OncallUserNotificationRule resource. + :param pulumi.Input[str] type: The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + :param pulumi.Input[str] user_id: User ID + :param pulumi.Input[int] duration: A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + :param pulumi.Input[bool] important: Boolean value which indicates if a rule is “important” + :param pulumi.Input[int] position: Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + """ + pulumi.set(__self__, "type", type) + pulumi.set(__self__, "user_id", user_id) + if duration is not None: + pulumi.set(__self__, "duration", duration) + if important is not None: + pulumi.set(__self__, "important", important) + if position is not None: + pulumi.set(__self__, "position", position) + + @property + @pulumi.getter + def type(self) -> pulumi.Input[str]: + """ + The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + """ + return pulumi.get(self, "type") + + @type.setter + def type(self, value: pulumi.Input[str]): + pulumi.set(self, "type", value) + + @property + @pulumi.getter(name="userId") + def user_id(self) -> pulumi.Input[str]: + """ + User ID + """ + return pulumi.get(self, "user_id") + + @user_id.setter + def user_id(self, value: pulumi.Input[str]): + pulumi.set(self, "user_id", value) + + @property + @pulumi.getter + def duration(self) -> Optional[pulumi.Input[int]]: + """ + A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + """ + return pulumi.get(self, "duration") + + @duration.setter + def duration(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "duration", value) + + @property + @pulumi.getter + def important(self) -> Optional[pulumi.Input[bool]]: + """ + Boolean value which indicates if a rule is “important” + """ + return pulumi.get(self, "important") + + @important.setter + def important(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "important", value) + + @property + @pulumi.getter + def position(self) -> Optional[pulumi.Input[int]]: + """ + Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + """ + return pulumi.get(self, "position") + + @position.setter + def position(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "position", value) + + +@pulumi.input_type +class _OncallUserNotificationRuleState: + def __init__(__self__, *, + duration: Optional[pulumi.Input[int]] = None, + important: Optional[pulumi.Input[bool]] = None, + position: Optional[pulumi.Input[int]] = None, + type: Optional[pulumi.Input[str]] = None, + user_id: Optional[pulumi.Input[str]] = None): + """ + Input properties used for looking up and filtering OncallUserNotificationRule resources. + :param pulumi.Input[int] duration: A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + :param pulumi.Input[bool] important: Boolean value which indicates if a rule is “important” + :param pulumi.Input[int] position: Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + :param pulumi.Input[str] type: The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + :param pulumi.Input[str] user_id: User ID + """ + if duration is not None: + pulumi.set(__self__, "duration", duration) + if important is not None: + pulumi.set(__self__, "important", important) + if position is not None: + pulumi.set(__self__, "position", position) + if type is not None: + pulumi.set(__self__, "type", type) + if user_id is not None: + pulumi.set(__self__, "user_id", user_id) + + @property + @pulumi.getter + def duration(self) -> Optional[pulumi.Input[int]]: + """ + A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + """ + return pulumi.get(self, "duration") + + @duration.setter + def duration(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "duration", value) + + @property + @pulumi.getter + def important(self) -> Optional[pulumi.Input[bool]]: + """ + Boolean value which indicates if a rule is “important” + """ + return pulumi.get(self, "important") + + @important.setter + def important(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "important", value) + + @property + @pulumi.getter + def position(self) -> Optional[pulumi.Input[int]]: + """ + Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + """ + return pulumi.get(self, "position") + + @position.setter + def position(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "position", value) + + @property + @pulumi.getter + def type(self) -> Optional[pulumi.Input[str]]: + """ + The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + """ + return pulumi.get(self, "type") + + @type.setter + def type(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "type", value) + + @property + @pulumi.getter(name="userId") + def user_id(self) -> Optional[pulumi.Input[str]]: + """ + User ID + """ + return pulumi.get(self, "user_id") + + @user_id.setter + def user_id(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "user_id", value) + + +class OncallUserNotificationRule(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + duration: Optional[pulumi.Input[int]] = None, + important: Optional[pulumi.Input[bool]] = None, + position: Optional[pulumi.Input[int]] = None, + type: Optional[pulumi.Input[str]] = None, + user_id: Optional[pulumi.Input[str]] = None, + __props__=None): + """ + * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/) + + **Note**: you must be running Grafana OnCall >= v1.8.0 to use this resource. + + ## Example Usage + + ```python + import pulumi + import pulumi_grafana as grafana + import pulumiverse_grafana as grafana + + my_user = grafana.onCall.get_user(username="my_username") + my_user_step1 = grafana.OncallUserNotificationRule("my_user_step_1", + user_id=my_user.id, + position=0, + type="notify_by_mobile_app") + my_user_step2 = grafana.OncallUserNotificationRule("my_user_step_2", + user_id=my_user.id, + position=1, + duration=600, + type="wait") + my_user_step3 = grafana.OncallUserNotificationRule("my_user_step_3", + user_id=my_user.id, + position=2, + type="notify_by_phone_call") + my_user_step4 = grafana.OncallUserNotificationRule("my_user_step_4", + user_id=my_user.id, + position=3, + duration=300, + type="wait") + my_user_step5 = grafana.OncallUserNotificationRule("my_user_step_5", + user_id=my_user.id, + position=4, + type="notify_by_slack") + my_user_important_step1 = grafana.OncallUserNotificationRule("my_user_important_step_1", + user_id=my_user.id, + important=True, + position=0, + type="notify_by_mobile_app_critical") + my_user_important_step2 = grafana.OncallUserNotificationRule("my_user_important_step_2", + user_id=my_user.id, + important=True, + position=1, + duration=300, + type="wait") + my_user_important_step3 = grafana.OncallUserNotificationRule("my_user_important_step_3", + user_id=my_user.id, + important=True, + position=2, + type="notify_by_mobile_app_critical") + ``` + + ## Import + + ```sh + $ pulumi import grafana:index/oncallUserNotificationRule:OncallUserNotificationRule name "{{ id }}" + ``` + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[int] duration: A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + :param pulumi.Input[bool] important: Boolean value which indicates if a rule is “important” + :param pulumi.Input[int] position: Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + :param pulumi.Input[str] type: The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + :param pulumi.Input[str] user_id: User ID + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: OncallUserNotificationRuleArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/) + + **Note**: you must be running Grafana OnCall >= v1.8.0 to use this resource. + + ## Example Usage + + ```python + import pulumi + import pulumi_grafana as grafana + import pulumiverse_grafana as grafana + + my_user = grafana.onCall.get_user(username="my_username") + my_user_step1 = grafana.OncallUserNotificationRule("my_user_step_1", + user_id=my_user.id, + position=0, + type="notify_by_mobile_app") + my_user_step2 = grafana.OncallUserNotificationRule("my_user_step_2", + user_id=my_user.id, + position=1, + duration=600, + type="wait") + my_user_step3 = grafana.OncallUserNotificationRule("my_user_step_3", + user_id=my_user.id, + position=2, + type="notify_by_phone_call") + my_user_step4 = grafana.OncallUserNotificationRule("my_user_step_4", + user_id=my_user.id, + position=3, + duration=300, + type="wait") + my_user_step5 = grafana.OncallUserNotificationRule("my_user_step_5", + user_id=my_user.id, + position=4, + type="notify_by_slack") + my_user_important_step1 = grafana.OncallUserNotificationRule("my_user_important_step_1", + user_id=my_user.id, + important=True, + position=0, + type="notify_by_mobile_app_critical") + my_user_important_step2 = grafana.OncallUserNotificationRule("my_user_important_step_2", + user_id=my_user.id, + important=True, + position=1, + duration=300, + type="wait") + my_user_important_step3 = grafana.OncallUserNotificationRule("my_user_important_step_3", + user_id=my_user.id, + important=True, + position=2, + type="notify_by_mobile_app_critical") + ``` + + ## Import + + ```sh + $ pulumi import grafana:index/oncallUserNotificationRule:OncallUserNotificationRule name "{{ id }}" + ``` + + :param str resource_name: The name of the resource. + :param OncallUserNotificationRuleArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(OncallUserNotificationRuleArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + duration: Optional[pulumi.Input[int]] = None, + important: Optional[pulumi.Input[bool]] = None, + position: Optional[pulumi.Input[int]] = None, + type: Optional[pulumi.Input[str]] = None, + user_id: Optional[pulumi.Input[str]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = OncallUserNotificationRuleArgs.__new__(OncallUserNotificationRuleArgs) + + __props__.__dict__["duration"] = duration + __props__.__dict__["important"] = important + __props__.__dict__["position"] = position + if type is None and not opts.urn: + raise TypeError("Missing required property 'type'") + __props__.__dict__["type"] = type + if user_id is None and not opts.urn: + raise TypeError("Missing required property 'user_id'") + __props__.__dict__["user_id"] = user_id + super(OncallUserNotificationRule, __self__).__init__( + 'grafana:index/oncallUserNotificationRule:OncallUserNotificationRule', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + duration: Optional[pulumi.Input[int]] = None, + important: Optional[pulumi.Input[bool]] = None, + position: Optional[pulumi.Input[int]] = None, + type: Optional[pulumi.Input[str]] = None, + user_id: Optional[pulumi.Input[str]] = None) -> 'OncallUserNotificationRule': + """ + Get an existing OncallUserNotificationRule resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[int] duration: A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + :param pulumi.Input[bool] important: Boolean value which indicates if a rule is “important” + :param pulumi.Input[int] position: Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + :param pulumi.Input[str] type: The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + :param pulumi.Input[str] user_id: User ID + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _OncallUserNotificationRuleState.__new__(_OncallUserNotificationRuleState) + + __props__.__dict__["duration"] = duration + __props__.__dict__["important"] = important + __props__.__dict__["position"] = position + __props__.__dict__["type"] = type + __props__.__dict__["user_id"] = user_id + return OncallUserNotificationRule(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def duration(self) -> pulumi.Output[Optional[int]]: + """ + A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 + """ + return pulumi.get(self, "duration") + + @property + @pulumi.getter + def important(self) -> pulumi.Output[bool]: + """ + Boolean value which indicates if a rule is “important” + """ + return pulumi.get(self, "important") + + @property + @pulumi.getter + def position(self) -> pulumi.Output[Optional[int]]: + """ + Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. + """ + return pulumi.get(self, "position") + + @property + @pulumi.getter + def type(self) -> pulumi.Output[str]: + """ + The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notify_by_msteams` is only available for Grafana Cloud customers. + """ + return pulumi.get(self, "type") + + @property + @pulumi.getter(name="userId") + def user_id(self) -> pulumi.Output[str]: + """ + User ID + """ + return pulumi.get(self, "user_id") + diff --git a/sdk/python/pulumiverse_grafana/outputs.py b/sdk/python/pulumiverse_grafana/outputs.py index 93ca205c..c4d064c4 100644 --- a/sdk/python/pulumiverse_grafana/outputs.py +++ b/sdk/python/pulumiverse_grafana/outputs.py @@ -77,6 +77,7 @@ 'RuleGroupRuleDataRelativeTimeRange', 'RuleGroupRuleNotificationSettings', 'SLOAlerting', + 'SLOAlertingAdvancedOptions', 'SLOAlertingAnnotation', 'SLOAlertingFastburn', 'SLOAlertingFastburnAnnotation', @@ -127,6 +128,7 @@ 'GetRolePermissionResult', 'GetSlosSloResult', 'GetSlosSloAlertingResult', + 'GetSlosSloAlertingAdvancedOptionsResult', 'GetSlosSloAlertingAnnotationResult', 'GetSlosSloAlertingFastburnResult', 'GetSlosSloAlertingFastburnAnnotationResult', @@ -6010,17 +6012,38 @@ def repeat_interval(self) -> Optional[str]: @pulumi.output_type class SLOAlerting(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "advancedOptions": + suggest = "advanced_options" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in SLOAlerting. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + SLOAlerting.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + SLOAlerting.__key_warning(key) + return super().get(key, default) + def __init__(__self__, *, + advanced_options: Optional['outputs.SLOAlertingAdvancedOptions'] = None, annotations: Optional[Sequence['outputs.SLOAlertingAnnotation']] = None, fastburns: Optional[Sequence['outputs.SLOAlertingFastburn']] = None, labels: Optional[Sequence['outputs.SLOAlertingLabel']] = None, slowburns: Optional[Sequence['outputs.SLOAlertingSlowburn']] = None): """ + :param 'SLOAlertingAdvancedOptionsArgs' advanced_options: Advanced Options for Alert Rules :param Sequence['SLOAlertingAnnotationArgs'] annotations: Annotations will be attached to all alerts generated by any of these rules. :param Sequence['SLOAlertingFastburnArgs'] fastburns: Alerting Rules generated for Fast Burn alerts :param Sequence['SLOAlertingLabelArgs'] labels: Labels will be attached to all alerts generated by any of these rules. :param Sequence['SLOAlertingSlowburnArgs'] slowburns: Alerting Rules generated for Slow Burn alerts """ + if advanced_options is not None: + pulumi.set(__self__, "advanced_options", advanced_options) if annotations is not None: pulumi.set(__self__, "annotations", annotations) if fastburns is not None: @@ -6030,6 +6053,14 @@ def __init__(__self__, *, if slowburns is not None: pulumi.set(__self__, "slowburns", slowburns) + @property + @pulumi.getter(name="advancedOptions") + def advanced_options(self) -> Optional['outputs.SLOAlertingAdvancedOptions']: + """ + Advanced Options for Alert Rules + """ + return pulumi.get(self, "advanced_options") + @property @pulumi.getter def annotations(self) -> Optional[Sequence['outputs.SLOAlertingAnnotation']]: @@ -6063,6 +6094,42 @@ def slowburns(self) -> Optional[Sequence['outputs.SLOAlertingSlowburn']]: return pulumi.get(self, "slowburns") +@pulumi.output_type +class SLOAlertingAdvancedOptions(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "minFailures": + suggest = "min_failures" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in SLOAlertingAdvancedOptions. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + SLOAlertingAdvancedOptions.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + SLOAlertingAdvancedOptions.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + min_failures: Optional[int] = None): + """ + :param int min_failures: Minimum number of failed events to trigger an alert + """ + if min_failures is not None: + pulumi.set(__self__, "min_failures", min_failures) + + @property + @pulumi.getter(name="minFailures") + def min_failures(self) -> Optional[int]: + """ + Minimum number of failed events to trigger an alert + """ + return pulumi.get(self, "min_failures") + + @pulumi.output_type class SLOAlertingAnnotation(dict): def __init__(__self__, *, @@ -9667,16 +9734,20 @@ def uuid(self) -> str: @pulumi.output_type class GetSlosSloAlertingResult(dict): def __init__(__self__, *, + advanced_options: Optional['outputs.GetSlosSloAlertingAdvancedOptionsResult'] = None, annotations: Optional[Sequence['outputs.GetSlosSloAlertingAnnotationResult']] = None, fastburn: Optional['outputs.GetSlosSloAlertingFastburnResult'] = None, labels: Optional[Sequence['outputs.GetSlosSloAlertingLabelResult']] = None, slowburn: Optional['outputs.GetSlosSloAlertingSlowburnResult'] = None): """ + :param 'GetSlosSloAlertingAdvancedOptionsArgs' advanced_options: Advanced Options for Alert Rules :param Sequence['GetSlosSloAlertingAnnotationArgs'] annotations: Annotations will be attached to all alerts generated by any of these rules. :param 'GetSlosSloAlertingFastburnArgs' fastburn: Alerting Rules generated for Fast Burn alerts :param Sequence['GetSlosSloAlertingLabelArgs'] labels: Labels will be attached to all alerts generated by any of these rules. :param 'GetSlosSloAlertingSlowburnArgs' slowburn: Alerting Rules generated for Slow Burn alerts """ + if advanced_options is not None: + pulumi.set(__self__, "advanced_options", advanced_options) if annotations is not None: pulumi.set(__self__, "annotations", annotations) if fastburn is not None: @@ -9686,6 +9757,14 @@ def __init__(__self__, *, if slowburn is not None: pulumi.set(__self__, "slowburn", slowburn) + @property + @pulumi.getter(name="advancedOptions") + def advanced_options(self) -> Optional['outputs.GetSlosSloAlertingAdvancedOptionsResult']: + """ + Advanced Options for Alert Rules + """ + return pulumi.get(self, "advanced_options") + @property @pulumi.getter def annotations(self) -> Optional[Sequence['outputs.GetSlosSloAlertingAnnotationResult']]: @@ -9719,6 +9798,25 @@ def slowburn(self) -> Optional['outputs.GetSlosSloAlertingSlowburnResult']: return pulumi.get(self, "slowburn") +@pulumi.output_type +class GetSlosSloAlertingAdvancedOptionsResult(dict): + def __init__(__self__, *, + min_failures: Optional[int] = None): + """ + :param int min_failures: Minimum number of failed events to trigger an alert + """ + if min_failures is not None: + pulumi.set(__self__, "min_failures", min_failures) + + @property + @pulumi.getter(name="minFailures") + def min_failures(self) -> Optional[int]: + """ + Minimum number of failed events to trigger an alert + """ + return pulumi.get(self, "min_failures") + + @pulumi.output_type class GetSlosSloAlertingAnnotationResult(dict): def __init__(__self__, *, diff --git a/sdk/python/pulumiverse_grafana/slo/_inputs.py b/sdk/python/pulumiverse_grafana/slo/_inputs.py index ff38c55a..e3cb5cfc 100644 --- a/sdk/python/pulumiverse_grafana/slo/_inputs.py +++ b/sdk/python/pulumiverse_grafana/slo/_inputs.py @@ -11,6 +11,7 @@ __all__ = [ 'SLOAlertingArgs', + 'SLOAlertingAdvancedOptionsArgs', 'SLOAlertingAnnotationArgs', 'SLOAlertingFastburnArgs', 'SLOAlertingFastburnAnnotationArgs', @@ -30,16 +31,20 @@ @pulumi.input_type class SLOAlertingArgs: def __init__(__self__, *, + advanced_options: Optional[pulumi.Input['SLOAlertingAdvancedOptionsArgs']] = None, annotations: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingAnnotationArgs']]]] = None, fastburns: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingFastburnArgs']]]] = None, labels: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingLabelArgs']]]] = None, slowburns: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingSlowburnArgs']]]] = None): """ + :param pulumi.Input['SLOAlertingAdvancedOptionsArgs'] advanced_options: Advanced Options for Alert Rules :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingAnnotationArgs']]] annotations: Annotations will be attached to all alerts generated by any of these rules. :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingFastburnArgs']]] fastburns: Alerting Rules generated for Fast Burn alerts :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingLabelArgs']]] labels: Labels will be attached to all alerts generated by any of these rules. :param pulumi.Input[Sequence[pulumi.Input['SLOAlertingSlowburnArgs']]] slowburns: Alerting Rules generated for Slow Burn alerts """ + if advanced_options is not None: + pulumi.set(__self__, "advanced_options", advanced_options) if annotations is not None: pulumi.set(__self__, "annotations", annotations) if fastburns is not None: @@ -49,6 +54,18 @@ def __init__(__self__, *, if slowburns is not None: pulumi.set(__self__, "slowburns", slowburns) + @property + @pulumi.getter(name="advancedOptions") + def advanced_options(self) -> Optional[pulumi.Input['SLOAlertingAdvancedOptionsArgs']]: + """ + Advanced Options for Alert Rules + """ + return pulumi.get(self, "advanced_options") + + @advanced_options.setter + def advanced_options(self, value: Optional[pulumi.Input['SLOAlertingAdvancedOptionsArgs']]): + pulumi.set(self, "advanced_options", value) + @property @pulumi.getter def annotations(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlertingAnnotationArgs']]]]: @@ -98,6 +115,29 @@ def slowburns(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SLOAlert pulumi.set(self, "slowburns", value) +@pulumi.input_type +class SLOAlertingAdvancedOptionsArgs: + def __init__(__self__, *, + min_failures: Optional[pulumi.Input[int]] = None): + """ + :param pulumi.Input[int] min_failures: Minimum number of failed events to trigger an alert + """ + if min_failures is not None: + pulumi.set(__self__, "min_failures", min_failures) + + @property + @pulumi.getter(name="minFailures") + def min_failures(self) -> Optional[pulumi.Input[int]]: + """ + Minimum number of failed events to trigger an alert + """ + return pulumi.get(self, "min_failures") + + @min_failures.setter + def min_failures(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "min_failures", value) + + @pulumi.input_type class SLOAlertingAnnotationArgs: def __init__(__self__, *, diff --git a/sdk/python/pulumiverse_grafana/slo/outputs.py b/sdk/python/pulumiverse_grafana/slo/outputs.py index 9e6e2220..413b448c 100644 --- a/sdk/python/pulumiverse_grafana/slo/outputs.py +++ b/sdk/python/pulumiverse_grafana/slo/outputs.py @@ -12,6 +12,7 @@ __all__ = [ 'SLOAlerting', + 'SLOAlertingAdvancedOptions', 'SLOAlertingAnnotation', 'SLOAlertingFastburn', 'SLOAlertingFastburnAnnotation', @@ -28,6 +29,7 @@ 'SLOQueryRatio', 'GetSlosSloResult', 'GetSlosSloAlertingResult', + 'GetSlosSloAlertingAdvancedOptionsResult', 'GetSlosSloAlertingAnnotationResult', 'GetSlosSloAlertingFastburnResult', 'GetSlosSloAlertingFastburnAnnotationResult', @@ -46,17 +48,38 @@ @pulumi.output_type class SLOAlerting(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "advancedOptions": + suggest = "advanced_options" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in SLOAlerting. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + SLOAlerting.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + SLOAlerting.__key_warning(key) + return super().get(key, default) + def __init__(__self__, *, + advanced_options: Optional['outputs.SLOAlertingAdvancedOptions'] = None, annotations: Optional[Sequence['outputs.SLOAlertingAnnotation']] = None, fastburns: Optional[Sequence['outputs.SLOAlertingFastburn']] = None, labels: Optional[Sequence['outputs.SLOAlertingLabel']] = None, slowburns: Optional[Sequence['outputs.SLOAlertingSlowburn']] = None): """ + :param 'SLOAlertingAdvancedOptionsArgs' advanced_options: Advanced Options for Alert Rules :param Sequence['SLOAlertingAnnotationArgs'] annotations: Annotations will be attached to all alerts generated by any of these rules. :param Sequence['SLOAlertingFastburnArgs'] fastburns: Alerting Rules generated for Fast Burn alerts :param Sequence['SLOAlertingLabelArgs'] labels: Labels will be attached to all alerts generated by any of these rules. :param Sequence['SLOAlertingSlowburnArgs'] slowburns: Alerting Rules generated for Slow Burn alerts """ + if advanced_options is not None: + pulumi.set(__self__, "advanced_options", advanced_options) if annotations is not None: pulumi.set(__self__, "annotations", annotations) if fastburns is not None: @@ -66,6 +89,14 @@ def __init__(__self__, *, if slowburns is not None: pulumi.set(__self__, "slowburns", slowburns) + @property + @pulumi.getter(name="advancedOptions") + def advanced_options(self) -> Optional['outputs.SLOAlertingAdvancedOptions']: + """ + Advanced Options for Alert Rules + """ + return pulumi.get(self, "advanced_options") + @property @pulumi.getter def annotations(self) -> Optional[Sequence['outputs.SLOAlertingAnnotation']]: @@ -99,6 +130,42 @@ def slowburns(self) -> Optional[Sequence['outputs.SLOAlertingSlowburn']]: return pulumi.get(self, "slowburns") +@pulumi.output_type +class SLOAlertingAdvancedOptions(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "minFailures": + suggest = "min_failures" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in SLOAlertingAdvancedOptions. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + SLOAlertingAdvancedOptions.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + SLOAlertingAdvancedOptions.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + min_failures: Optional[int] = None): + """ + :param int min_failures: Minimum number of failed events to trigger an alert + """ + if min_failures is not None: + pulumi.set(__self__, "min_failures", min_failures) + + @property + @pulumi.getter(name="minFailures") + def min_failures(self) -> Optional[int]: + """ + Minimum number of failed events to trigger an alert + """ + return pulumi.get(self, "min_failures") + + @pulumi.output_type class SLOAlertingAnnotation(dict): def __init__(__self__, *, @@ -573,16 +640,20 @@ def uuid(self) -> str: @pulumi.output_type class GetSlosSloAlertingResult(dict): def __init__(__self__, *, + advanced_options: Optional['outputs.GetSlosSloAlertingAdvancedOptionsResult'] = None, annotations: Optional[Sequence['outputs.GetSlosSloAlertingAnnotationResult']] = None, fastburns: Optional[Sequence['outputs.GetSlosSloAlertingFastburnResult']] = None, labels: Optional[Sequence['outputs.GetSlosSloAlertingLabelResult']] = None, slowburns: Optional[Sequence['outputs.GetSlosSloAlertingSlowburnResult']] = None): """ + :param 'GetSlosSloAlertingAdvancedOptionsArgs' advanced_options: Advanced Options for Alert Rules :param Sequence['GetSlosSloAlertingAnnotationArgs'] annotations: Annotations will be attached to all alerts generated by any of these rules. :param Sequence['GetSlosSloAlertingFastburnArgs'] fastburns: Alerting Rules generated for Fast Burn alerts :param Sequence['GetSlosSloAlertingLabelArgs'] labels: Labels will be attached to all alerts generated by any of these rules. :param Sequence['GetSlosSloAlertingSlowburnArgs'] slowburns: Alerting Rules generated for Slow Burn alerts """ + if advanced_options is not None: + pulumi.set(__self__, "advanced_options", advanced_options) if annotations is not None: pulumi.set(__self__, "annotations", annotations) if fastburns is not None: @@ -592,6 +663,14 @@ def __init__(__self__, *, if slowburns is not None: pulumi.set(__self__, "slowburns", slowburns) + @property + @pulumi.getter(name="advancedOptions") + def advanced_options(self) -> Optional['outputs.GetSlosSloAlertingAdvancedOptionsResult']: + """ + Advanced Options for Alert Rules + """ + return pulumi.get(self, "advanced_options") + @property @pulumi.getter def annotations(self) -> Optional[Sequence['outputs.GetSlosSloAlertingAnnotationResult']]: @@ -625,6 +704,25 @@ def slowburns(self) -> Optional[Sequence['outputs.GetSlosSloAlertingSlowburnResu return pulumi.get(self, "slowburns") +@pulumi.output_type +class GetSlosSloAlertingAdvancedOptionsResult(dict): + def __init__(__self__, *, + min_failures: Optional[int] = None): + """ + :param int min_failures: Minimum number of failed events to trigger an alert + """ + if min_failures is not None: + pulumi.set(__self__, "min_failures", min_failures) + + @property + @pulumi.getter(name="minFailures") + def min_failures(self) -> Optional[int]: + """ + Minimum number of failed events to trigger an alert + """ + return pulumi.get(self, "min_failures") + + @pulumi.output_type class GetSlosSloAlertingAnnotationResult(dict): def __init__(__self__, *,