1. Packages
  2. AWS
  3. API Docs
  4. cloudwatch
  5. ContributorInsightRule
AWS v6.78.0 published on Thursday, Apr 24, 2025 by Pulumi

aws.cloudwatch.ContributorInsightRule

Explore with Pulumi AI

Resource for managing an AWS CloudWatch Contributor Insight Rule.

Example Usage

Basic Usage

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

const test = new aws.cloudwatch.ContributorInsightRule("test", {
    ruleName: "testing",
    ruleState: "ENABLED",
    ruleDefinition: "{\"Schema\":{\"Name\":\"CloudWatchLogRule\",\"Version\":1},\"AggregateOn\":\"Count\",\"Contribution\":{\"Filters\":[{\"In\":[\"some-keyword\"],\"Match\":\"$.message\"}],\"Keys\":[\"$.country\"]},\"LogFormat\":\"JSON\",\"LogGroupNames\":[\"/aws/lambda/api-prod\"]}",
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.cloudwatch.ContributorInsightRule("test",
    rule_name="testing",
    rule_state="ENABLED",
    rule_definition="{\"Schema\":{\"Name\":\"CloudWatchLogRule\",\"Version\":1},\"AggregateOn\":\"Count\",\"Contribution\":{\"Filters\":[{\"In\":[\"some-keyword\"],\"Match\":\"$.message\"}],\"Keys\":[\"$.country\"]},\"LogFormat\":\"JSON\",\"LogGroupNames\":[\"/aws/lambda/api-prod\"]}")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudwatch.NewContributorInsightRule(ctx, "test", &cloudwatch.ContributorInsightRuleArgs{
			RuleName:       pulumi.String("testing"),
			RuleState:      pulumi.String("ENABLED"),
			RuleDefinition: pulumi.String("{\"Schema\":{\"Name\":\"CloudWatchLogRule\",\"Version\":1},\"AggregateOn\":\"Count\",\"Contribution\":{\"Filters\":[{\"In\":[\"some-keyword\"],\"Match\":\"$.message\"}],\"Keys\":[\"$.country\"]},\"LogFormat\":\"JSON\",\"LogGroupNames\":[\"/aws/lambda/api-prod\"]}"),
		})
		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 test = new Aws.CloudWatch.ContributorInsightRule("test", new()
    {
        RuleName = "testing",
        RuleState = "ENABLED",
        RuleDefinition = "{\"Schema\":{\"Name\":\"CloudWatchLogRule\",\"Version\":1},\"AggregateOn\":\"Count\",\"Contribution\":{\"Filters\":[{\"In\":[\"some-keyword\"],\"Match\":\"$.message\"}],\"Keys\":[\"$.country\"]},\"LogFormat\":\"JSON\",\"LogGroupNames\":[\"/aws/lambda/api-prod\"]}",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.ContributorInsightRule;
import com.pulumi.aws.cloudwatch.ContributorInsightRuleArgs;
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 test = new ContributorInsightRule("test", ContributorInsightRuleArgs.builder()
            .ruleName("testing")
            .ruleState("ENABLED")
            .ruleDefinition("{\"Schema\":{\"Name\":\"CloudWatchLogRule\",\"Version\":1},\"AggregateOn\":\"Count\",\"Contribution\":{\"Filters\":[{\"In\":[\"some-keyword\"],\"Match\":\"$.message\"}],\"Keys\":[\"$.country\"]},\"LogFormat\":\"JSON\",\"LogGroupNames\":[\"/aws/lambda/api-prod\"]}")
            .build());

    }
}
Copy
resources:
  test:
    type: aws:cloudwatch:ContributorInsightRule
    properties:
      ruleName: testing
      ruleState: ENABLED
      ruleDefinition: '{"Schema":{"Name":"CloudWatchLogRule","Version":1},"AggregateOn":"Count","Contribution":{"Filters":[{"In":["some-keyword"],"Match":"$.message"}],"Keys":["$.country"]},"LogFormat":"JSON","LogGroupNames":["/aws/lambda/api-prod"]}'
Copy

Create ContributorInsightRule Resource

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

Constructor syntax

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

@overload
def ContributorInsightRule(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           rule_definition: Optional[str] = None,
                           rule_name: Optional[str] = None,
                           rule_state: Optional[str] = None,
                           tags: Optional[Mapping[str, str]] = None)
func NewContributorInsightRule(ctx *Context, name string, args ContributorInsightRuleArgs, opts ...ResourceOption) (*ContributorInsightRule, error)
public ContributorInsightRule(string name, ContributorInsightRuleArgs args, CustomResourceOptions? opts = null)
public ContributorInsightRule(String name, ContributorInsightRuleArgs args)
public ContributorInsightRule(String name, ContributorInsightRuleArgs args, CustomResourceOptions options)
type: aws:cloudwatch:ContributorInsightRule
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. ContributorInsightRuleArgs
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. ContributorInsightRuleArgs
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. ContributorInsightRuleArgs
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. ContributorInsightRuleArgs
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. ContributorInsightRuleArgs
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 contributorInsightRuleResource = new Aws.CloudWatch.ContributorInsightRule("contributorInsightRuleResource", new()
{
    RuleDefinition = "string",
    RuleName = "string",
    RuleState = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := cloudwatch.NewContributorInsightRule(ctx, "contributorInsightRuleResource", &cloudwatch.ContributorInsightRuleArgs{
	RuleDefinition: pulumi.String("string"),
	RuleName:       pulumi.String("string"),
	RuleState:      pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var contributorInsightRuleResource = new ContributorInsightRule("contributorInsightRuleResource", ContributorInsightRuleArgs.builder()
    .ruleDefinition("string")
    .ruleName("string")
    .ruleState("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
contributor_insight_rule_resource = aws.cloudwatch.ContributorInsightRule("contributorInsightRuleResource",
    rule_definition="string",
    rule_name="string",
    rule_state="string",
    tags={
        "string": "string",
    })
Copy
const contributorInsightRuleResource = new aws.cloudwatch.ContributorInsightRule("contributorInsightRuleResource", {
    ruleDefinition: "string",
    ruleName: "string",
    ruleState: "string",
    tags: {
        string: "string",
    },
});
Copy
type: aws:cloudwatch:ContributorInsightRule
properties:
    ruleDefinition: string
    ruleName: string
    ruleState: string
    tags:
        string: string
Copy

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

RuleDefinition This property is required. string
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
RuleName This property is required. string

Unique name of the rule.

The following arguments are optional:

RuleState string
State of the rule. Valid values are ENABLED and DISABLED.
Tags Dictionary<string, string>
RuleDefinition This property is required. string
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
RuleName This property is required. string

Unique name of the rule.

The following arguments are optional:

RuleState string
State of the rule. Valid values are ENABLED and DISABLED.
Tags map[string]string
ruleDefinition This property is required. String
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
ruleName This property is required. String

Unique name of the rule.

The following arguments are optional:

ruleState String
State of the rule. Valid values are ENABLED and DISABLED.
tags Map<String,String>
ruleDefinition This property is required. string
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
ruleName This property is required. string

Unique name of the rule.

The following arguments are optional:

ruleState string
State of the rule. Valid values are ENABLED and DISABLED.
tags {[key: string]: string}
rule_definition This property is required. str
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
rule_name This property is required. str

Unique name of the rule.

The following arguments are optional:

rule_state str
State of the rule. Valid values are ENABLED and DISABLED.
tags Mapping[str, str]
ruleDefinition This property is required. String
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
ruleName This property is required. String

Unique name of the rule.

The following arguments are optional:

ruleState String
State of the rule. Valid values are ENABLED and DISABLED.
tags Map<String>

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
ResourceArn string
ARN of the Contributor Insight Rule.
TagsAll Dictionary<string, string>

Deprecated: Please use tags instead.

Id string
The provider-assigned unique ID for this managed resource.
ResourceArn string
ARN of the Contributor Insight Rule.
TagsAll map[string]string

Deprecated: Please use tags instead.

id String
The provider-assigned unique ID for this managed resource.
resourceArn String
ARN of the Contributor Insight Rule.
tagsAll Map<String,String>

Deprecated: Please use tags instead.

id string
The provider-assigned unique ID for this managed resource.
resourceArn string
ARN of the Contributor Insight Rule.
tagsAll {[key: string]: string}

Deprecated: Please use tags instead.

id str
The provider-assigned unique ID for this managed resource.
resource_arn str
ARN of the Contributor Insight Rule.
tags_all Mapping[str, str]

Deprecated: Please use tags instead.

id String
The provider-assigned unique ID for this managed resource.
resourceArn String
ARN of the Contributor Insight Rule.
tagsAll Map<String>

Deprecated: Please use tags instead.

Look up Existing ContributorInsightRule Resource

Get an existing ContributorInsightRule 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?: ContributorInsightRuleState, opts?: CustomResourceOptions): ContributorInsightRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        resource_arn: Optional[str] = None,
        rule_definition: Optional[str] = None,
        rule_name: Optional[str] = None,
        rule_state: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> ContributorInsightRule
func GetContributorInsightRule(ctx *Context, name string, id IDInput, state *ContributorInsightRuleState, opts ...ResourceOption) (*ContributorInsightRule, error)
public static ContributorInsightRule Get(string name, Input<string> id, ContributorInsightRuleState? state, CustomResourceOptions? opts = null)
public static ContributorInsightRule get(String name, Output<String> id, ContributorInsightRuleState state, CustomResourceOptions options)
resources:  _:    type: aws:cloudwatch:ContributorInsightRule    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:
ResourceArn string
ARN of the Contributor Insight Rule.
RuleDefinition string
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
RuleName string

Unique name of the rule.

The following arguments are optional:

RuleState string
State of the rule. Valid values are ENABLED and DISABLED.
Tags Dictionary<string, string>
TagsAll Dictionary<string, string>

Deprecated: Please use tags instead.

ResourceArn string
ARN of the Contributor Insight Rule.
RuleDefinition string
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
RuleName string

Unique name of the rule.

The following arguments are optional:

RuleState string
State of the rule. Valid values are ENABLED and DISABLED.
Tags map[string]string
TagsAll map[string]string

Deprecated: Please use tags instead.

resourceArn String
ARN of the Contributor Insight Rule.
ruleDefinition String
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
ruleName String

Unique name of the rule.

The following arguments are optional:

ruleState String
State of the rule. Valid values are ENABLED and DISABLED.
tags Map<String,String>
tagsAll Map<String,String>

Deprecated: Please use tags instead.

resourceArn string
ARN of the Contributor Insight Rule.
ruleDefinition string
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
ruleName string

Unique name of the rule.

The following arguments are optional:

ruleState string
State of the rule. Valid values are ENABLED and DISABLED.
tags {[key: string]: string}
tagsAll {[key: string]: string}

Deprecated: Please use tags instead.

resource_arn str
ARN of the Contributor Insight Rule.
rule_definition str
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
rule_name str

Unique name of the rule.

The following arguments are optional:

rule_state str
State of the rule. Valid values are ENABLED and DISABLED.
tags Mapping[str, str]
tags_all Mapping[str, str]

Deprecated: Please use tags instead.

resourceArn String
ARN of the Contributor Insight Rule.
ruleDefinition String
Definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
ruleName String

Unique name of the rule.

The following arguments are optional:

ruleState String
State of the rule. Valid values are ENABLED and DISABLED.
tags Map<String>
tagsAll Map<String>

Deprecated: Please use tags instead.

Import

Using pulumi import, import CloudWatch Contributor Insight Rule using the rule_name. For example:

$ pulumi import aws:cloudwatch/contributorInsightRule:ContributorInsightRule example contributor_insight_rule-name
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.