1. Packages
  2. AWS
  3. API Docs
  4. amp
  5. RuleGroupNamespace
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.amp.RuleGroupNamespace

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages an Amazon Managed Service for Prometheus (AMP) Rule Group Namespace

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const demo = new aws.amp.Workspace("demo", {});
    const demoRuleGroupNamespace = new aws.amp.RuleGroupNamespace("demo", {
        name: "rules",
        workspaceId: demo.id,
        data: `groups:
      - name: test
        rules:
        - record: metric:recording_rule
          expr: avg(rate(container_cpu_usage_seconds_total[5m]))
    `,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    demo = aws.amp.Workspace("demo")
    demo_rule_group_namespace = aws.amp.RuleGroupNamespace("demo",
        name="rules",
        workspace_id=demo.id,
        data="""groups:
      - name: test
        rules:
        - record: metric:recording_rule
          expr: avg(rate(container_cpu_usage_seconds_total[5m]))
    """)
    
    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.NewRuleGroupNamespace(ctx, "demo", &amp.RuleGroupNamespaceArgs{
    			Name:        pulumi.String("rules"),
    			WorkspaceId: demo.ID(),
    			Data: pulumi.String(`groups:
      - name: test
        rules:
        - record: metric:recording_rule
          expr: avg(rate(container_cpu_usage_seconds_total[5m]))
    `),
    		})
    		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 demoRuleGroupNamespace = new Aws.Amp.RuleGroupNamespace("demo", new()
        {
            Name = "rules",
            WorkspaceId = demo.Id,
            Data = @"groups:
      - name: test
        rules:
        - record: metric:recording_rule
          expr: avg(rate(container_cpu_usage_seconds_total[5m]))
    ",
        });
    
    });
    
    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.RuleGroupNamespace;
    import com.pulumi.aws.amp.RuleGroupNamespaceArgs;
    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 demoRuleGroupNamespace = new RuleGroupNamespace("demoRuleGroupNamespace", RuleGroupNamespaceArgs.builder()
                .name("rules")
                .workspaceId(demo.id())
                .data("""
    groups:
      - name: test
        rules:
        - record: metric:recording_rule
          expr: avg(rate(container_cpu_usage_seconds_total[5m]))
                """)
                .build());
    
        }
    }
    
    resources:
      demo:
        type: aws:amp:Workspace
      demoRuleGroupNamespace:
        type: aws:amp:RuleGroupNamespace
        name: demo
        properties:
          name: rules
          workspaceId: ${demo.id}
          data: |
            groups:
              - name: test
                rules:
                - record: metric:recording_rule
                  expr: avg(rate(container_cpu_usage_seconds_total[5m]))        
    

    Create RuleGroupNamespace Resource

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

    Constructor syntax

    new RuleGroupNamespace(name: string, args: RuleGroupNamespaceArgs, opts?: CustomResourceOptions);
    @overload
    def RuleGroupNamespace(resource_name: str,
                           args: RuleGroupNamespaceArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def RuleGroupNamespace(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           data: Optional[str] = None,
                           workspace_id: Optional[str] = None,
                           name: Optional[str] = None)
    func NewRuleGroupNamespace(ctx *Context, name string, args RuleGroupNamespaceArgs, opts ...ResourceOption) (*RuleGroupNamespace, error)
    public RuleGroupNamespace(string name, RuleGroupNamespaceArgs args, CustomResourceOptions? opts = null)
    public RuleGroupNamespace(String name, RuleGroupNamespaceArgs args)
    public RuleGroupNamespace(String name, RuleGroupNamespaceArgs args, CustomResourceOptions options)
    
    type: aws:amp:RuleGroupNamespace
    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 RuleGroupNamespaceArgs
    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 RuleGroupNamespaceArgs
    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 RuleGroupNamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RuleGroupNamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RuleGroupNamespaceArgs
    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 ruleGroupNamespaceResource = new Aws.Amp.RuleGroupNamespace("ruleGroupNamespaceResource", new()
    {
        Data = "string",
        WorkspaceId = "string",
        Name = "string",
    });
    
    example, err := amp.NewRuleGroupNamespace(ctx, "ruleGroupNamespaceResource", &amp.RuleGroupNamespaceArgs{
    	Data:        pulumi.String("string"),
    	WorkspaceId: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var ruleGroupNamespaceResource = new RuleGroupNamespace("ruleGroupNamespaceResource", RuleGroupNamespaceArgs.builder()
        .data("string")
        .workspaceId("string")
        .name("string")
        .build());
    
    rule_group_namespace_resource = aws.amp.RuleGroupNamespace("ruleGroupNamespaceResource",
        data="string",
        workspace_id="string",
        name="string")
    
    const ruleGroupNamespaceResource = new aws.amp.RuleGroupNamespace("ruleGroupNamespaceResource", {
        data: "string",
        workspaceId: "string",
        name: "string",
    });
    
    type: aws:amp:RuleGroupNamespace
    properties:
        data: string
        name: string
        workspaceId: string
    

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

    Data string
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    WorkspaceId string
    ID of the prometheus workspace the rule group namespace should be linked to
    Name string
    The name of the rule group namespace
    Data string
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    WorkspaceId string
    ID of the prometheus workspace the rule group namespace should be linked to
    Name string
    The name of the rule group namespace
    data String
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    workspaceId String
    ID of the prometheus workspace the rule group namespace should be linked to
    name String
    The name of the rule group namespace
    data string
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    workspaceId string
    ID of the prometheus workspace the rule group namespace should be linked to
    name string
    The name of the rule group namespace
    data str
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    workspace_id str
    ID of the prometheus workspace the rule group namespace should be linked to
    name str
    The name of the rule group namespace
    data String
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    workspaceId String
    ID of the prometheus workspace the rule group namespace should be linked to
    name String
    The name of the rule group namespace

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RuleGroupNamespace 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 RuleGroupNamespace Resource

    Get an existing RuleGroupNamespace 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?: RuleGroupNamespaceState, opts?: CustomResourceOptions): RuleGroupNamespace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data: Optional[str] = None,
            name: Optional[str] = None,
            workspace_id: Optional[str] = None) -> RuleGroupNamespace
    func GetRuleGroupNamespace(ctx *Context, name string, id IDInput, state *RuleGroupNamespaceState, opts ...ResourceOption) (*RuleGroupNamespace, error)
    public static RuleGroupNamespace Get(string name, Input<string> id, RuleGroupNamespaceState? state, CustomResourceOptions? opts = null)
    public static RuleGroupNamespace get(String name, Output<String> id, RuleGroupNamespaceState 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:
    Data string
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    Name string
    The name of the rule group namespace
    WorkspaceId string
    ID of the prometheus workspace the rule group namespace should be linked to
    Data string
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    Name string
    The name of the rule group namespace
    WorkspaceId string
    ID of the prometheus workspace the rule group namespace should be linked to
    data String
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    name String
    The name of the rule group namespace
    workspaceId String
    ID of the prometheus workspace the rule group namespace should be linked to
    data string
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    name string
    The name of the rule group namespace
    workspaceId string
    ID of the prometheus workspace the rule group namespace should be linked to
    data str
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    name str
    The name of the rule group namespace
    workspace_id str
    ID of the prometheus workspace the rule group namespace should be linked to
    data String
    the rule group namespace data that you want to be applied. See more in AWS Docs.
    name String
    The name of the rule group namespace
    workspaceId String
    ID of the prometheus workspace the rule group namespace should be linked to

    Import

    Using pulumi import, import the prometheus rule group namespace using the arn. For example:

    $ pulumi import aws:amp/ruleGroupNamespace:RuleGroupNamespace demo arn:aws:aps:us-west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name
    

    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
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi