scaleway.observability.AlertManager
Explore with Pulumi AI
The scaleway.observability.AlertManager resource allows you to enable and manage the Scaleway Cockpit alert manager.
Refer to Cockpit’s product documentation and API documentation for more information.
Example Usage
Enable the alert manager and configure managed alerts
The following commands allow you to:
- enable the alert manager in a Project named tf_test_project
- enable managed alerts
- set up contact points to receive alert notifications
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const project = new scaleway.account.Project("project", {name: "tf_test_project"});
const alertManager = new scaleway.observability.AlertManager("alert_manager", {
    projectId: project.id,
    enableManagedAlerts: true,
    contactPoints: [
        {
            email: "alert1@example.com",
        },
        {
            email: "alert2@example.com",
        },
    ],
});
import pulumi
import pulumiverse_scaleway as scaleway
project = scaleway.account.Project("project", name="tf_test_project")
alert_manager = scaleway.observability.AlertManager("alert_manager",
    project_id=project.id,
    enable_managed_alerts=True,
    contact_points=[
        {
            "email": "alert1@example.com",
        },
        {
            "email": "alert2@example.com",
        },
    ])
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/account"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/observability"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := account.NewProject(ctx, "project", &account.ProjectArgs{
			Name: pulumi.String("tf_test_project"),
		})
		if err != nil {
			return err
		}
		_, err = observability.NewAlertManager(ctx, "alert_manager", &observability.AlertManagerArgs{
			ProjectId:           project.ID(),
			EnableManagedAlerts: pulumi.Bool(true),
			ContactPoints: observability.AlertManagerContactPointArray{
				&observability.AlertManagerContactPointArgs{
					Email: pulumi.String("alert1@example.com"),
				},
				&observability.AlertManagerContactPointArgs{
					Email: pulumi.String("alert2@example.com"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() => 
{
    var project = new Scaleway.Account.Project("project", new()
    {
        Name = "tf_test_project",
    });
    var alertManager = new Scaleway.Observability.AlertManager("alert_manager", new()
    {
        ProjectId = project.Id,
        EnableManagedAlerts = true,
        ContactPoints = new[]
        {
            new Scaleway.Observability.Inputs.AlertManagerContactPointArgs
            {
                Email = "alert1@example.com",
            },
            new Scaleway.Observability.Inputs.AlertManagerContactPointArgs
            {
                Email = "alert2@example.com",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.account.Project;
import com.pulumi.scaleway.account.ProjectArgs;
import com.pulumi.scaleway.observability.AlertManager;
import com.pulumi.scaleway.observability.AlertManagerArgs;
import com.pulumi.scaleway.observability.inputs.AlertManagerContactPointArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var project = new Project("project", ProjectArgs.builder()
            .name("tf_test_project")
            .build());
        var alertManager = new AlertManager("alertManager", AlertManagerArgs.builder()
            .projectId(project.id())
            .enableManagedAlerts(true)
            .contactPoints(            
                AlertManagerContactPointArgs.builder()
                    .email("alert1@example.com")
                    .build(),
                AlertManagerContactPointArgs.builder()
                    .email("alert2@example.com")
                    .build())
            .build());
    }
}
resources:
  project:
    type: scaleway:account:Project
    properties:
      name: tf_test_project
  alertManager:
    type: scaleway:observability:AlertManager
    name: alert_manager
    properties:
      projectId: ${project.id}
      enableManagedAlerts: true
      contactPoints:
        - email: alert1@example.com
        - email: alert2@example.com
Create AlertManager Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AlertManager(name: string, args?: AlertManagerArgs, opts?: CustomResourceOptions);@overload
def AlertManager(resource_name: str,
                 args: Optional[AlertManagerArgs] = None,
                 opts: Optional[ResourceOptions] = None)
@overload
def AlertManager(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 contact_points: Optional[Sequence[AlertManagerContactPointArgs]] = None,
                 enable_managed_alerts: Optional[bool] = None,
                 project_id: Optional[str] = None,
                 region: Optional[str] = None)func NewAlertManager(ctx *Context, name string, args *AlertManagerArgs, opts ...ResourceOption) (*AlertManager, error)public AlertManager(string name, AlertManagerArgs? args = null, CustomResourceOptions? opts = null)
public AlertManager(String name, AlertManagerArgs args)
public AlertManager(String name, AlertManagerArgs args, CustomResourceOptions options)
type: scaleway:observability:AlertManager
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AlertManagerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AlertManagerArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AlertManagerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlertManagerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AlertManagerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var alertManagerResource = new Scaleway.Observability.AlertManager("alertManagerResource", new()
{
    ContactPoints = new[]
    {
        new Scaleway.Observability.Inputs.AlertManagerContactPointArgs
        {
            Email = "string",
        },
    },
    EnableManagedAlerts = false,
    ProjectId = "string",
    Region = "string",
});
example, err := observability.NewAlertManager(ctx, "alertManagerResource", &observability.AlertManagerArgs{
	ContactPoints: observability.AlertManagerContactPointArray{
		&observability.AlertManagerContactPointArgs{
			Email: pulumi.String("string"),
		},
	},
	EnableManagedAlerts: pulumi.Bool(false),
	ProjectId:           pulumi.String("string"),
	Region:              pulumi.String("string"),
})
var alertManagerResource = new AlertManager("alertManagerResource", AlertManagerArgs.builder()
    .contactPoints(AlertManagerContactPointArgs.builder()
        .email("string")
        .build())
    .enableManagedAlerts(false)
    .projectId("string")
    .region("string")
    .build());
alert_manager_resource = scaleway.observability.AlertManager("alertManagerResource",
    contact_points=[{
        "email": "string",
    }],
    enable_managed_alerts=False,
    project_id="string",
    region="string")
const alertManagerResource = new scaleway.observability.AlertManager("alertManagerResource", {
    contactPoints: [{
        email: "string",
    }],
    enableManagedAlerts: false,
    projectId: "string",
    region: "string",
});
type: scaleway:observability:AlertManager
properties:
    contactPoints:
        - email: string
    enableManagedAlerts: false
    projectId: string
    region: string
AlertManager Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AlertManager resource accepts the following input properties:
- ContactPoints List<Pulumiverse.Scaleway. Observability. Inputs. Alert Manager Contact Point> 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- EnableManaged boolAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- ProjectId string
- ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- ContactPoints []AlertManager Contact Point Args 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- EnableManaged boolAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- ProjectId string
- ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- contactPoints List<AlertManager Contact Point> 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enableManaged BooleanAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- projectId String
- ) The ID of the Project the Cockpit is associated with.
- region String
- ) The region where the alert manager should be enabled.
- contactPoints AlertManager Contact Point[] 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enableManaged booleanAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- projectId string
- ) The ID of the Project the Cockpit is associated with.
- region string
- ) The region where the alert manager should be enabled.
- contact_points Sequence[AlertManager Contact Point Args] 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enable_managed_ boolalerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- project_id str
- ) The ID of the Project the Cockpit is associated with.
- region str
- ) The region where the alert manager should be enabled.
- contactPoints List<Property Map>
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enableManaged BooleanAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- projectId String
- ) The ID of the Project the Cockpit is associated with.
- region String
- ) The region where the alert manager should be enabled.
Outputs
All input properties are implicitly available as output properties. Additionally, the AlertManager resource produces the following output properties:
- AlertManager stringUrl 
- The URL of the alert manager.
- Id string
- The provider-assigned unique ID for this managed resource.
- AlertManager stringUrl 
- The URL of the alert manager.
- Id string
- The provider-assigned unique ID for this managed resource.
- alertManager StringUrl 
- The URL of the alert manager.
- id String
- The provider-assigned unique ID for this managed resource.
- alertManager stringUrl 
- The URL of the alert manager.
- id string
- The provider-assigned unique ID for this managed resource.
- alert_manager_ strurl 
- The URL of the alert manager.
- id str
- The provider-assigned unique ID for this managed resource.
- alertManager StringUrl 
- The URL of the alert manager.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AlertManager Resource
Get an existing AlertManager resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AlertManagerState, opts?: CustomResourceOptions): AlertManager@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        alert_manager_url: Optional[str] = None,
        contact_points: Optional[Sequence[AlertManagerContactPointArgs]] = None,
        enable_managed_alerts: Optional[bool] = None,
        project_id: Optional[str] = None,
        region: Optional[str] = None) -> AlertManagerfunc GetAlertManager(ctx *Context, name string, id IDInput, state *AlertManagerState, opts ...ResourceOption) (*AlertManager, error)public static AlertManager Get(string name, Input<string> id, AlertManagerState? state, CustomResourceOptions? opts = null)public static AlertManager get(String name, Output<String> id, AlertManagerState state, CustomResourceOptions options)resources:  _:    type: scaleway:observability:AlertManager    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- AlertManager stringUrl 
- The URL of the alert manager.
- ContactPoints List<Pulumiverse.Scaleway. Observability. Inputs. Alert Manager Contact Point> 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- EnableManaged boolAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- ProjectId string
- ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- AlertManager stringUrl 
- The URL of the alert manager.
- ContactPoints []AlertManager Contact Point Args 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- EnableManaged boolAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- ProjectId string
- ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- alertManager StringUrl 
- The URL of the alert manager.
- contactPoints List<AlertManager Contact Point> 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enableManaged BooleanAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- projectId String
- ) The ID of the Project the Cockpit is associated with.
- region String
- ) The region where the alert manager should be enabled.
- alertManager stringUrl 
- The URL of the alert manager.
- contactPoints AlertManager Contact Point[] 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enableManaged booleanAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- projectId string
- ) The ID of the Project the Cockpit is associated with.
- region string
- ) The region where the alert manager should be enabled.
- alert_manager_ strurl 
- The URL of the alert manager.
- contact_points Sequence[AlertManager Contact Point Args] 
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enable_managed_ boolalerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- project_id str
- ) The ID of the Project the Cockpit is associated with.
- region str
- ) The region where the alert manager should be enabled.
- alertManager StringUrl 
- The URL of the alert manager.
- contactPoints List<Property Map>
- A list of contact points with email addresses that will receive alerts. Each map should contain a single key email.
- enableManaged BooleanAlerts 
- Specifies whether the alert manager should be enabled. Defaults to true.
- projectId String
- ) The ID of the Project the Cockpit is associated with.
- region String
- ) The region where the alert manager should be enabled.
Supporting Types
AlertManagerContactPoint, AlertManagerContactPointArgs        
- Email string
- Email addresses for the alert receivers
- Email string
- Email addresses for the alert receivers
- email String
- Email addresses for the alert receivers
- email string
- Email addresses for the alert receivers
- email str
- Email addresses for the alert receivers
- email String
- Email addresses for the alert receivers
Import
This section explains how to import alert managers using the ID of the Project associated with Cockpit.
bash
$ pulumi import scaleway:observability/alertManager:AlertManager main fr-par/11111111-1111-1111-1111-111111111111
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the scalewayTerraform Provider.
