1. Packages
  2. AWS Classic
  3. API Docs
  4. amp
  5. AlertManagerDefinition

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.41.0 published on Tuesday, Jun 18, 2024 by Pulumi

aws.amp.AlertManagerDefinition

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.41.0 published on Tuesday, Jun 18, 2024 by Pulumi

    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'
    `,
    });
    
    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'
    """)
    
    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
    	})
    }
    
    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'
    ",
        });
    
    });
    
    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());
    
        }
    }
    
    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'        
    

    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 string
    The unique name of the resource.
    args AlertManagerDefinitionArgs
    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 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 string
    The unique name of the resource.
    args AlertManagerDefinitionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertManagerDefinitionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertManagerDefinitionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var alertManagerDefinitionResource = new Aws.Amp.AlertManagerDefinition("alertManagerDefinitionResource", new()
    {
        Definition = "string",
        WorkspaceId = "string",
    });
    
    example, err := amp.NewAlertManagerDefinition(ctx, "alertManagerDefinitionResource", &amp.AlertManagerDefinitionArgs{
    	Definition:  pulumi.String("string"),
    	WorkspaceId: pulumi.String("string"),
    })
    
    var alertManagerDefinitionResource = new AlertManagerDefinition("alertManagerDefinitionResource", AlertManagerDefinitionArgs.builder()
        .definition("string")
        .workspaceId("string")
        .build());
    
    alert_manager_definition_resource = aws.amp.AlertManagerDefinition("alertManagerDefinitionResource",
        definition="string",
        workspace_id="string")
    
    const alertManagerDefinitionResource = new aws.amp.AlertManagerDefinition("alertManagerDefinitionResource", {
        definition: "string",
        workspaceId: "string",
    });
    
    type: aws:amp:AlertManagerDefinition
    properties:
        definition: string
        workspaceId: string
    

    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

    The AlertManagerDefinition resource accepts the following input properties:

    Definition string
    the alert manager definition that you want to be applied. See more in AWS Docs.
    WorkspaceId 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 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 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 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 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 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)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Definition string
    the alert manager definition that you want to be applied. See more in AWS Docs.
    WorkspaceId 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 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 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 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 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 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
    

    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.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.41.0 published on Tuesday, Jun 18, 2024 by Pulumi