AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.2 published on Friday, Jun 24, 2022 by Pulumi

RuleGroupNamespace

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var demoWorkspace = new Aws.Amp.Workspace("demoWorkspace", new Aws.Amp.WorkspaceArgs
        {
        });
        var demoRuleGroupNamespace = new Aws.Amp.RuleGroupNamespace("demoRuleGroupNamespace", new Aws.Amp.RuleGroupNamespaceArgs
        {
            WorkspaceId = demoWorkspace.Id,
            Data = @"groups:
  - name: test
    rules:
    - record: metric:recording_rule
      expr: avg(rate(container_cpu_usage_seconds_total[5m]))
",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/amp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		demoWorkspace, err := amp.NewWorkspace(ctx, "demoWorkspace", nil)
		if err != nil {
			return err
		}
		_, err = amp.NewRuleGroupNamespace(ctx, "demoRuleGroupNamespace", &amp.RuleGroupNamespaceArgs{
			WorkspaceId: demoWorkspace.ID(),
			Data:        pulumi.String(fmt.Sprintf("%v%v%v%v%v", "groups:\n", "  - name: test\n", "    rules:\n", "    - record: metric:recording_rule\n", "      expr: avg(rate(container_cpu_usage_seconds_total[5m]))\n")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var demoWorkspace = new Workspace("demoWorkspace");

        var demoRuleGroupNamespace = new RuleGroupNamespace("demoRuleGroupNamespace", RuleGroupNamespaceArgs.builder()        
            .workspaceId(demoWorkspace.id())
            .data("""
groups:
  - name: test
    rules:
    - record: metric:recording_rule
      expr: avg(rate(container_cpu_usage_seconds_total[5m]))
            """)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

demo_workspace = aws.amp.Workspace("demoWorkspace")
demo_rule_group_namespace = aws.amp.RuleGroupNamespace("demoRuleGroupNamespace",
    workspace_id=demo_workspace.id,
    data="""groups:
  - name: test
    rules:
    - record: metric:recording_rule
      expr: avg(rate(container_cpu_usage_seconds_total[5m]))
""")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const demoWorkspace = new aws.amp.Workspace("demoWorkspace", {});
const demoRuleGroupNamespace = new aws.amp.RuleGroupNamespace("demoRuleGroupNamespace", {
    workspaceId: demoWorkspace.id,
    data: `groups:
  - name: test
    rules:
    - record: metric:recording_rule
      expr: avg(rate(container_cpu_usage_seconds_total[5m]))
`,
});
resources:
  demoWorkspace:
    type: aws:amp:Workspace
  demoRuleGroupNamespace:
    type: aws:amp:RuleGroupNamespace
    properties:
      workspaceId: ${demoWorkspace.id}
      data: |
        groups:
          - name: test
            rules:
            - record: metric:recording_rule
              expr: avg(rate(container_cpu_usage_seconds_total[5m]))        

Create a RuleGroupNamespace Resource

new RuleGroupNamespace(name: string, args: RuleGroupNamespaceArgs, opts?: CustomResourceOptions);
@overload
def RuleGroupNamespace(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       data: Optional[str] = None,
                       name: Optional[str] = None,
                       workspace_id: Optional[str] = None)
@overload
def RuleGroupNamespace(resource_name: str,
                       args: RuleGroupNamespaceArgs,
                       opts: Optional[ResourceOptions] = 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.

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.

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

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

The 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

The 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

The 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

The 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

The 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

The 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 an 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

The 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

The 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

The 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

The 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

The 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

The id of the prometheus workspace the rule group namespace should be linked to

Import

The prometheus rule group namespace can be imported using the arn, e.g.,

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

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.