1. Packages
  2. AWS
  3. API Docs
  4. amp
  5. AlertManagerDefinition
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.amp.AlertManagerDefinition

Explore with Pulumi AI

Manages an Amazon Managed Service for Prometheus (AMP) Alert Manager Definition

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const demo = new aws.amp.Workspace("demo", {});
const demoAlertManagerDefinition = new aws.amp.AlertManagerDefinition("demo", {
    workspaceId: demo.id,
    definition: `alertmanager_config: |
  route:
    receiver: 'default'
  receivers:
    - name: 'default'
`,
});
Copy
import pulumi
import pulumi_aws as aws

demo = aws.amp.Workspace("demo")
demo_alert_manager_definition = aws.amp.AlertManagerDefinition("demo",
    workspace_id=demo.id,
    definition="""alertmanager_config: |
  route:
    receiver: 'default'
  receivers:
    - name: 'default'
""")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/amp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		demo, err := amp.NewWorkspace(ctx, "demo", nil)
		if err != nil {
			return err
		}
		_, err = amp.NewAlertManagerDefinition(ctx, "demo", &amp.AlertManagerDefinitionArgs{
			WorkspaceId: demo.ID(),
			Definition: pulumi.String(`alertmanager_config: |
  route:
    receiver: 'default'
  receivers:
    - name: 'default'
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var demo = new Aws.Amp.Workspace("demo");

    var demoAlertManagerDefinition = new Aws.Amp.AlertManagerDefinition("demo", new()
    {
        WorkspaceId = demo.Id,
        Definition = @"alertmanager_config: |
  route:
    receiver: 'default'
  receivers:
    - name: 'default'
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.amp.Workspace;
import com.pulumi.aws.amp.AlertManagerDefinition;
import com.pulumi.aws.amp.AlertManagerDefinitionArgs;
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 demo = new Workspace("demo");

        var demoAlertManagerDefinition = new AlertManagerDefinition("demoAlertManagerDefinition", AlertManagerDefinitionArgs.builder()
            .workspaceId(demo.id())
            .definition("""
alertmanager_config: |
  route:
    receiver: 'default'
  receivers:
    - name: 'default'
            """)
            .build());

    }
}
Copy
resources:
  demo:
    type: aws:amp:Workspace
  demoAlertManagerDefinition:
    type: aws:amp:AlertManagerDefinition
    name: demo
    properties:
      workspaceId: ${demo.id}
      definition: |
        alertmanager_config: |
          route:
            receiver: 'default'
          receivers:
            - name: 'default'        
Copy

Create AlertManagerDefinition Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new AlertManagerDefinition(name: string, args: AlertManagerDefinitionArgs, opts?: CustomResourceOptions);
@overload
def AlertManagerDefinition(resource_name: str,
                           args: AlertManagerDefinitionArgs,
                           opts: Optional[ResourceOptions] = None)

@overload
def AlertManagerDefinition(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           definition: Optional[str] = None,
                           workspace_id: Optional[str] = None)
func NewAlertManagerDefinition(ctx *Context, name string, args AlertManagerDefinitionArgs, opts ...ResourceOption) (*AlertManagerDefinition, error)
public AlertManagerDefinition(string name, AlertManagerDefinitionArgs args, CustomResourceOptions? opts = null)
public AlertManagerDefinition(String name, AlertManagerDefinitionArgs args)
public AlertManagerDefinition(String name, AlertManagerDefinitionArgs args, CustomResourceOptions options)
type: aws:amp:AlertManagerDefinition
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AlertManagerDefinitionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AlertManagerDefinitionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AlertManagerDefinitionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AlertManagerDefinitionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AlertManagerDefinitionArgs
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 alertManagerDefinitionResource = new Aws.Amp.AlertManagerDefinition("alertManagerDefinitionResource", new()
{
    Definition = "string",
    WorkspaceId = "string",
});
Copy
example, err := amp.NewAlertManagerDefinition(ctx, "alertManagerDefinitionResource", &amp.AlertManagerDefinitionArgs{
	Definition:  pulumi.String("string"),
	WorkspaceId: pulumi.String("string"),
})
Copy
var alertManagerDefinitionResource = new AlertManagerDefinition("alertManagerDefinitionResource", AlertManagerDefinitionArgs.builder()
    .definition("string")
    .workspaceId("string")
    .build());
Copy
alert_manager_definition_resource = aws.amp.AlertManagerDefinition("alertManagerDefinitionResource",
    definition="string",
    workspace_id="string")
Copy
const alertManagerDefinitionResource = new aws.amp.AlertManagerDefinition("alertManagerDefinitionResource", {
    definition: "string",
    workspaceId: "string",
});
Copy
type: aws:amp:AlertManagerDefinition
properties:
    definition: string
    workspaceId: string
Copy

AlertManagerDefinition 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 AlertManagerDefinition resource accepts the following input properties:

Definition This property is required. string
the alert manager definition that you want to be applied. See more in AWS Docs.
WorkspaceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the prometheus workspace the alert manager definition should be linked to
Definition This property is required. string
the alert manager definition that you want to be applied. See more in AWS Docs.
WorkspaceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the prometheus workspace the alert manager definition should be linked to
definition This property is required. String
the alert manager definition that you want to be applied. See more in AWS Docs.
workspaceId
This property is required.
Changes to this property will trigger replacement.
String
ID of the prometheus workspace the alert manager definition should be linked to
definition This property is required. string
the alert manager definition that you want to be applied. See more in AWS Docs.
workspaceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the prometheus workspace the alert manager definition should be linked to
definition This property is required. str
the alert manager definition that you want to be applied. See more in AWS Docs.
workspace_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the prometheus workspace the alert manager definition should be linked to
definition This property is required. String
the alert manager definition that you want to be applied. See more in AWS Docs.
workspaceId
This property is required.
Changes to this property will trigger replacement.
String
ID of the prometheus workspace the alert manager definition should be linked to

Outputs

All input properties are implicitly available as output properties. Additionally, the AlertManagerDefinition resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing AlertManagerDefinition Resource

Get an existing AlertManagerDefinition 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?: AlertManagerDefinitionState, opts?: CustomResourceOptions): AlertManagerDefinition
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        definition: Optional[str] = None,
        workspace_id: Optional[str] = None) -> AlertManagerDefinition
func GetAlertManagerDefinition(ctx *Context, name string, id IDInput, state *AlertManagerDefinitionState, opts ...ResourceOption) (*AlertManagerDefinition, error)
public static AlertManagerDefinition Get(string name, Input<string> id, AlertManagerDefinitionState? state, CustomResourceOptions? opts = null)
public static AlertManagerDefinition get(String name, Output<String> id, AlertManagerDefinitionState state, CustomResourceOptions options)
resources:  _:    type: aws:amp:AlertManagerDefinition    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Definition string
the alert manager definition that you want to be applied. See more in AWS Docs.
WorkspaceId Changes to this property will trigger replacement. string
ID of the prometheus workspace the alert manager definition should be linked to
Definition string
the alert manager definition that you want to be applied. See more in AWS Docs.
WorkspaceId Changes to this property will trigger replacement. string
ID of the prometheus workspace the alert manager definition should be linked to
definition String
the alert manager definition that you want to be applied. See more in AWS Docs.
workspaceId Changes to this property will trigger replacement. String
ID of the prometheus workspace the alert manager definition should be linked to
definition string
the alert manager definition that you want to be applied. See more in AWS Docs.
workspaceId Changes to this property will trigger replacement. string
ID of the prometheus workspace the alert manager definition should be linked to
definition str
the alert manager definition that you want to be applied. See more in AWS Docs.
workspace_id Changes to this property will trigger replacement. str
ID of the prometheus workspace the alert manager definition should be linked to
definition String
the alert manager definition that you want to be applied. See more in AWS Docs.
workspaceId Changes to this property will trigger replacement. String
ID of the prometheus workspace the alert manager definition should be linked to

Import

Using pulumi import, import the prometheus alert manager definition using the workspace identifier. For example:

$ pulumi import aws:amp/alertManagerDefinition:AlertManagerDefinition demo ws-C6DCB907-F2D7-4D96-957B-66691F865D8B
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.