AWS Classic

v5.21.1 published on Thursday, Nov 17, 2022 by Pulumi

AnomalyMonitor

Provides a CE Anomaly Monitor.

Example Usage

Dimensional Example

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var serviceMonitor = new Aws.CostExplorer.AnomalyMonitor("serviceMonitor", new()
    {
        MonitorDimension = "SERVICE",
        MonitorType = "DIMENSIONAL",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/costexplorer"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := costexplorer.NewAnomalyMonitor(ctx, "serviceMonitor", &costexplorer.AnomalyMonitorArgs{
			MonitorDimension: pulumi.String("SERVICE"),
			MonitorType:      pulumi.String("DIMENSIONAL"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.costexplorer.AnomalyMonitor;
import com.pulumi.aws.costexplorer.AnomalyMonitorArgs;
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 serviceMonitor = new AnomalyMonitor("serviceMonitor", AnomalyMonitorArgs.builder()        
            .monitorDimension("SERVICE")
            .monitorType("DIMENSIONAL")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

service_monitor = aws.costexplorer.AnomalyMonitor("serviceMonitor",
    monitor_dimension="SERVICE",
    monitor_type="DIMENSIONAL")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const serviceMonitor = new aws.costexplorer.AnomalyMonitor("service_monitor", {
    monitorDimension: "SERVICE",
    monitorType: "DIMENSIONAL",
});
resources:
  serviceMonitor:
    type: aws:costexplorer:AnomalyMonitor
    properties:
      monitorDimension: SERVICE
      monitorType: DIMENSIONAL

Custom Example

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = new Aws.CostExplorer.AnomalyMonitor("test", new()
    {
        MonitorSpecification = @"{
	""And"": null,
	""CostCategories"": null,
	""Dimensions"": null,
	""Not"": null,
	""Or"": null,
	""Tags"": {
		""Key"": ""CostCenter"",
		""MatchOptions"": null,
		""Values"": [
			""10000""
		]
	}
}

",
        MonitorType = "CUSTOM",
    });

});
package main

import (
	"fmt"

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := costexplorer.NewAnomalyMonitor(ctx, "test", &costexplorer.AnomalyMonitorArgs{
			MonitorSpecification: pulumi.String(fmt.Sprintf(`{
	"And": null,
	"CostCategories": null,
	"Dimensions": null,
	"Not": null,
	"Or": null,
	"Tags": {
		"Key": "CostCenter",
		"MatchOptions": null,
		"Values": [
			"10000"
		]
	}
}

`)),
			MonitorType: pulumi.String("CUSTOM"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.costexplorer.AnomalyMonitor;
import com.pulumi.aws.costexplorer.AnomalyMonitorArgs;
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 AnomalyMonitor("test", AnomalyMonitorArgs.builder()        
            .monitorSpecification("""
{
	"And": null,
	"CostCategories": null,
	"Dimensions": null,
	"Not": null,
	"Or": null,
	"Tags": {
		"Key": "CostCenter",
		"MatchOptions": null,
		"Values": [
			"10000"
		]
	}
}

            """)
            .monitorType("CUSTOM")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

test = aws.costexplorer.AnomalyMonitor("test",
    monitor_specification="""{
	"And": null,
	"CostCategories": null,
	"Dimensions": null,
	"Not": null,
	"Or": null,
	"Tags": {
		"Key": "CostCenter",
		"MatchOptions": null,
		"Values": [
			"10000"
		]
	}
}

""",
    monitor_type="CUSTOM")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.costexplorer.AnomalyMonitor("test", {
    monitorSpecification: `{
	"And": null,
	"CostCategories": null,
	"Dimensions": null,
	"Not": null,
	"Or": null,
	"Tags": {
		"Key": "CostCenter",
		"MatchOptions": null,
		"Values": [
			"10000"
		]
	}
}
`,
    monitorType: "CUSTOM",
});
resources:
  test:
    type: aws:costexplorer:AnomalyMonitor
    properties:
      monitorSpecification: |+
        {
        	"And": null,
        	"CostCategories": null,
        	"Dimensions": null,
        	"Not": null,
        	"Or": null,
        	"Tags": {
        		"Key": "CostCenter",
        		"MatchOptions": null,
        		"Values": [
        			"10000"
        		]
        	}
        }        

      monitorType: CUSTOM

Create AnomalyMonitor Resource

new AnomalyMonitor(name: string, args: AnomalyMonitorArgs, opts?: CustomResourceOptions);
@overload
def AnomalyMonitor(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   monitor_dimension: Optional[str] = None,
                   monitor_specification: Optional[str] = None,
                   monitor_type: Optional[str] = None,
                   name: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None)
@overload
def AnomalyMonitor(resource_name: str,
                   args: AnomalyMonitorArgs,
                   opts: Optional[ResourceOptions] = None)
func NewAnomalyMonitor(ctx *Context, name string, args AnomalyMonitorArgs, opts ...ResourceOption) (*AnomalyMonitor, error)
public AnomalyMonitor(string name, AnomalyMonitorArgs args, CustomResourceOptions? opts = null)
public AnomalyMonitor(String name, AnomalyMonitorArgs args)
public AnomalyMonitor(String name, AnomalyMonitorArgs args, CustomResourceOptions options)
type: aws:costexplorer:AnomalyMonitor
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

MonitorType string

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

MonitorDimension string

The dimensions to evaluate. Valid values: SERVICE.

MonitorSpecification string

A valid JSON representation for the Expression object.

Name string

The name of the monitor.

Tags Dictionary<string, string>

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

MonitorType string

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

MonitorDimension string

The dimensions to evaluate. Valid values: SERVICE.

MonitorSpecification string

A valid JSON representation for the Expression object.

Name string

The name of the monitor.

Tags map[string]string

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

monitorType String

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

monitorDimension String

The dimensions to evaluate. Valid values: SERVICE.

monitorSpecification String

A valid JSON representation for the Expression object.

name String

The name of the monitor.

tags Map<String,String>

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

monitorType string

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

monitorDimension string

The dimensions to evaluate. Valid values: SERVICE.

monitorSpecification string

A valid JSON representation for the Expression object.

name string

The name of the monitor.

tags {[key: string]: string}

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

monitor_type str

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

monitor_dimension str

The dimensions to evaluate. Valid values: SERVICE.

monitor_specification str

A valid JSON representation for the Expression object.

name str

The name of the monitor.

tags Mapping[str, str]

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

monitorType String

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

monitorDimension String

The dimensions to evaluate. Valid values: SERVICE.

monitorSpecification String

A valid JSON representation for the Expression object.

name String

The name of the monitor.

tags Map<String>

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

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

Arn string

ARN of the anomaly monitor.

Id string

The provider-assigned unique ID for this managed resource.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

ARN of the anomaly monitor.

Id string

The provider-assigned unique ID for this managed resource.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the anomaly monitor.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

ARN of the anomaly monitor.

id string

The provider-assigned unique ID for this managed resource.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

ARN of the anomaly monitor.

id str

The provider-assigned unique ID for this managed resource.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the anomaly monitor.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing AnomalyMonitor Resource

Get an existing AnomalyMonitor 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?: AnomalyMonitorState, opts?: CustomResourceOptions): AnomalyMonitor
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        monitor_dimension: Optional[str] = None,
        monitor_specification: Optional[str] = None,
        monitor_type: Optional[str] = None,
        name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> AnomalyMonitor
func GetAnomalyMonitor(ctx *Context, name string, id IDInput, state *AnomalyMonitorState, opts ...ResourceOption) (*AnomalyMonitor, error)
public static AnomalyMonitor Get(string name, Input<string> id, AnomalyMonitorState? state, CustomResourceOptions? opts = null)
public static AnomalyMonitor get(String name, Output<String> id, AnomalyMonitorState 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:
Arn string

ARN of the anomaly monitor.

MonitorDimension string

The dimensions to evaluate. Valid values: SERVICE.

MonitorSpecification string

A valid JSON representation for the Expression object.

MonitorType string

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

Name string

The name of the monitor.

Tags Dictionary<string, string>

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

ARN of the anomaly monitor.

MonitorDimension string

The dimensions to evaluate. Valid values: SERVICE.

MonitorSpecification string

A valid JSON representation for the Expression object.

MonitorType string

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

Name string

The name of the monitor.

Tags map[string]string

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the anomaly monitor.

monitorDimension String

The dimensions to evaluate. Valid values: SERVICE.

monitorSpecification String

A valid JSON representation for the Expression object.

monitorType String

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

name String

The name of the monitor.

tags Map<String,String>

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

ARN of the anomaly monitor.

monitorDimension string

The dimensions to evaluate. Valid values: SERVICE.

monitorSpecification string

A valid JSON representation for the Expression object.

monitorType string

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

name string

The name of the monitor.

tags {[key: string]: string}

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

ARN of the anomaly monitor.

monitor_dimension str

The dimensions to evaluate. Valid values: SERVICE.

monitor_specification str

A valid JSON representation for the Expression object.

monitor_type str

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

name str

The name of the monitor.

tags Mapping[str, str]

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the anomaly monitor.

monitorDimension String

The dimensions to evaluate. Valid values: SERVICE.

monitorSpecification String

A valid JSON representation for the Expression object.

monitorType String

The possible type values. Valid values: DIMENSIONAL | CUSTOM.

name String

The name of the monitor.

tags Map<String>

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Import

aws_ce_anomaly_monitor can be imported using the id, e.g.

 $ pulumi import aws:costexplorer/anomalyMonitor:AnomalyMonitor example costAnomalyMonitorARN

Package Details

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

This Pulumi package is based on the aws Terraform Provider.