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 preconfigured alerts (Recommended)
Use preconfigured alerts to monitor your Scaleway resources with ready-to-use alert rules:
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const project = new scaleway.account.Project("project", {name: "my-observability-project"});
const main = new scaleway.observability.Cockpit("main", {projectId: project.id});
const all = scaleway.observability.getPreconfiguredAlertOutput({
projectId: main.projectId,
});
const mainAlertManager = new scaleway.observability.AlertManager("main", {
projectId: main.projectId,
preconfiguredAlertIds: all.apply(all => .filter(alert => alert.productName == "instance").map(alert => (alert.preconfiguredRuleId))),
contactPoints: [{
email: "alerts@example.com",
}],
});
import pulumi
import pulumi_scaleway as scaleway
import pulumiverse_scaleway as scaleway
project = scaleway.account.Project("project", name="my-observability-project")
main = scaleway.observability.Cockpit("main", project_id=project.id)
all = scaleway.observability.get_preconfigured_alert_output(project_id=main.project_id)
main_alert_manager = scaleway.observability.AlertManager("main",
project_id=main.project_id,
preconfigured_alert_ids=all.apply(lambda all: [alert.preconfigured_rule_id for alert in all.alerts if alert.product_name == "instance"]),
contact_points=[{
"email": "alerts@example.com",
}])
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var project = new Scaleway.Account.Project("project", new()
{
Name = "my-observability-project",
});
var main = new Scaleway.Observability.Cockpit("main", new()
{
ProjectId = project.Id,
});
var all = Scaleway.Observability.GetPreconfiguredAlert.Invoke(new()
{
ProjectId = main.ProjectId,
});
var mainAlertManager = new Scaleway.Observability.AlertManager("main", new()
{
ProjectId = main.ProjectId,
PreconfiguredAlertIds = .Where(alert => alert.ProductName == "instance").Select(alert =>
{
return alert.PreconfiguredRuleId;
}).ToList(),
ContactPoints = new[]
{
new Scaleway.Observability.Inputs.AlertManagerContactPointArgs
{
Email = "alerts@example.com",
},
},
});
});
Example coming soon!
Example coming soon!
Enable the alert manager with contact points
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,
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,
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(),
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,
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())
.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}
contactPoints:
- email: alert1@example.com
- email: alert2@example.com
Legacy: Enable managed alerts (Deprecated)
Deprecated: The
enable_managed_alertsfield is deprecated. Usepreconfigured_alert_idsinstead.
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: "alert@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": "alert@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("alert@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 = "alert@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("alert@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: alert@example.com
Create CockpitAlertManager Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CockpitAlertManager(name: string, args?: CockpitAlertManagerArgs, opts?: CustomResourceOptions);@overload
def CockpitAlertManager(resource_name: str,
args: Optional[CockpitAlertManagerArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def CockpitAlertManager(resource_name: str,
opts: Optional[ResourceOptions] = None,
contact_points: Optional[Sequence[CockpitAlertManagerContactPointArgs]] = None,
enable_managed_alerts: Optional[bool] = None,
preconfigured_alert_ids: Optional[Sequence[str]] = None,
project_id: Optional[str] = None,
region: Optional[str] = None)func NewCockpitAlertManager(ctx *Context, name string, args *CockpitAlertManagerArgs, opts ...ResourceOption) (*CockpitAlertManager, error)public CockpitAlertManager(string name, CockpitAlertManagerArgs? args = null, CustomResourceOptions? opts = null)
public CockpitAlertManager(String name, CockpitAlertManagerArgs args)
public CockpitAlertManager(String name, CockpitAlertManagerArgs args, CustomResourceOptions options)
type: scaleway:CockpitAlertManager
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 CockpitAlertManagerArgs
- 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 CockpitAlertManagerArgs
- 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 CockpitAlertManagerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CockpitAlertManagerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CockpitAlertManagerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CockpitAlertManager 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 CockpitAlertManager resource accepts the following input properties:
- Contact
Points List<Pulumiverse.Scaleway. Inputs. Cockpit Alert Manager Contact Point> - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - Enable
Managed boolAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - Preconfigured
Alert List<string>Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - Project
Id string - ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- Contact
Points []CockpitAlert Manager 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 - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - Preconfigured
Alert []stringIds - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - Project
Id string - ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- contact
Points List<CockpitAlert Manager Contact Point> - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - enable
Managed BooleanAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured
Alert List<String>Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project
Id String - ) The ID of the Project the Cockpit is associated with.
- region String
- ) The region where the alert manager should be enabled.
- contact
Points CockpitAlert Manager Contact Point[] - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - enable
Managed booleanAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured
Alert string[]Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project
Id 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[CockpitAlert Manager 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 - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured_
alert_ Sequence[str]ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project_
id str - ) The ID of the Project the Cockpit is associated with.
- region str
- ) The region where the alert manager should be enabled.
- contact
Points List<Property Map> - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - enable
Managed BooleanAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured
Alert List<String>Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project
Id 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 CockpitAlertManager resource produces the following output properties:
- Alert
Manager stringUrl - The URL of the alert manager.
- Id string
- The provider-assigned unique ID for this managed resource.
- Alert
Manager stringUrl - The URL of the alert manager.
- Id string
- The provider-assigned unique ID for this managed resource.
- alert
Manager StringUrl - The URL of the alert manager.
- id String
- The provider-assigned unique ID for this managed resource.
- alert
Manager 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.
- alert
Manager StringUrl - The URL of the alert manager.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing CockpitAlertManager Resource
Get an existing CockpitAlertManager 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?: CockpitAlertManagerState, opts?: CustomResourceOptions): CockpitAlertManager@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alert_manager_url: Optional[str] = None,
contact_points: Optional[Sequence[CockpitAlertManagerContactPointArgs]] = None,
enable_managed_alerts: Optional[bool] = None,
preconfigured_alert_ids: Optional[Sequence[str]] = None,
project_id: Optional[str] = None,
region: Optional[str] = None) -> CockpitAlertManagerfunc GetCockpitAlertManager(ctx *Context, name string, id IDInput, state *CockpitAlertManagerState, opts ...ResourceOption) (*CockpitAlertManager, error)public static CockpitAlertManager Get(string name, Input<string> id, CockpitAlertManagerState? state, CustomResourceOptions? opts = null)public static CockpitAlertManager get(String name, Output<String> id, CockpitAlertManagerState state, CustomResourceOptions options)resources: _: type: scaleway:CockpitAlertManager 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.
- Alert
Manager stringUrl - The URL of the alert manager.
- Contact
Points List<Pulumiverse.Scaleway. Inputs. Cockpit Alert Manager Contact Point> - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - Enable
Managed boolAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - Preconfigured
Alert List<string>Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - Project
Id string - ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- Alert
Manager stringUrl - The URL of the alert manager.
- Contact
Points []CockpitAlert Manager 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 - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - Preconfigured
Alert []stringIds - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - Project
Id string - ) The ID of the Project the Cockpit is associated with.
- Region string
- ) The region where the alert manager should be enabled.
- alert
Manager StringUrl - The URL of the alert manager.
- contact
Points List<CockpitAlert Manager Contact Point> - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - enable
Managed BooleanAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured
Alert List<String>Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project
Id String - ) The ID of the Project the Cockpit is associated with.
- region String
- ) The region where the alert manager should be enabled.
- alert
Manager stringUrl - The URL of the alert manager.
- contact
Points CockpitAlert Manager Contact Point[] - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - enable
Managed booleanAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured
Alert string[]Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project
Id 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[CockpitAlert Manager 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 - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured_
alert_ Sequence[str]ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project_
id str - ) The ID of the Project the Cockpit is associated with.
- region str
- ) The region where the alert manager should be enabled.
- alert
Manager StringUrl - The URL of the alert manager.
- contact
Points List<Property Map> - A list of contact points with email addresses that will receive alerts. Each map should contain a single key
email. - enable
Managed BooleanAlerts - Deprecated (Optional, Boolean) Use
preconfigured_alert_idsinstead. This field will be removed in a future version. When set totrue, it enables all preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. - preconfigured
Alert List<String>Ids - A set of preconfigured alert rule IDs to enable explicitly. Use the
scaleway.observability.getPreconfiguredAlertdata source to list available alerts. - project
Id String - ) The ID of the Project the Cockpit is associated with.
- region String
- ) The region where the alert manager should be enabled.
Supporting Types
CockpitAlertManagerContactPoint, CockpitAlertManagerContactPointArgs
- 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:index/cockpitAlertManager:CockpitAlertManager 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.
