Try AWS Native preview for resources not in the classic version.
aws.costexplorer.AnomalyMonitor
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides a CE Anomaly Monitor.
Example Usage
Dimensional Example
using System.Collections.Generic;
using System.Linq;
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/v6/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("serviceMonitor", {
monitorDimension: "SERVICE",
monitorType: "DIMENSIONAL",
});
resources:
serviceMonitor:
type: aws:costexplorer:AnomalyMonitor
properties:
monitorDimension: SERVICE
monitorType: DIMENSIONAL
Custom Example
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.CostExplorer.AnomalyMonitor("test", new()
{
MonitorType = "CUSTOM",
MonitorSpecification = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["And"] = null,
["CostCategories"] = null,
["Dimensions"] = null,
["Not"] = null,
["Or"] = null,
["Tags"] = new Dictionary<string, object?>
{
["Key"] = "CostCenter",
["MatchOptions"] = null,
["Values"] = new[]
{
"10000",
},
},
}),
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/costexplorer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"And": nil,
"CostCategories": nil,
"Dimensions": nil,
"Not": nil,
"Or": nil,
"Tags": map[string]interface{}{
"Key": "CostCenter",
"MatchOptions": nil,
"Values": []string{
"10000",
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = costexplorer.NewAnomalyMonitor(ctx, "test", &costexplorer.AnomalyMonitorArgs{
MonitorType: pulumi.String("CUSTOM"),
MonitorSpecification: pulumi.String(json0),
})
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 static com.pulumi.codegen.internal.Serialization.*;
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()
.monitorType("CUSTOM")
.monitorSpecification(serializeJson(
jsonObject(
jsonProperty("And", null),
jsonProperty("CostCategories", null),
jsonProperty("Dimensions", null),
jsonProperty("Not", null),
jsonProperty("Or", null),
jsonProperty("Tags", jsonObject(
jsonProperty("Key", "CostCenter"),
jsonProperty("MatchOptions", null),
jsonProperty("Values", jsonArray("10000"))
))
)))
.build());
}
}
import pulumi
import json
import pulumi_aws as aws
test = aws.costexplorer.AnomalyMonitor("test",
monitor_type="CUSTOM",
monitor_specification=json.dumps({
"And": None,
"CostCategories": None,
"Dimensions": None,
"Not": None,
"Or": None,
"Tags": {
"Key": "CostCenter",
"MatchOptions": None,
"Values": ["10000"],
},
}))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.costexplorer.AnomalyMonitor("test", {
monitorType: "CUSTOM",
monitorSpecification: JSON.stringify({
And: undefined,
CostCategories: undefined,
Dimensions: undefined,
Not: undefined,
Or: undefined,
Tags: {
Key: "CostCenter",
MatchOptions: undefined,
Values: ["10000"],
},
}),
});
resources:
test:
type: aws:costexplorer:AnomalyMonitor
properties:
monitorType: CUSTOM
monitorSpecification:
fn::toJSON:
And: null
CostCategories: null
Dimensions: null
Not: null
Or: null
Tags:
Key: CostCenter
MatchOptions: null
Values:
- '10000'
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:
- Monitor
Type string The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- Monitor
Dimension string The dimensions to evaluate. Valid values:
SERVICE
.- Monitor
Specification string A valid JSON representation for the Expression object.
- Name string
The name of the monitor.
- 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.
- Monitor
Type string The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- Monitor
Dimension string The dimensions to evaluate. Valid values:
SERVICE
.- Monitor
Specification string A valid JSON representation for the Expression object.
- Name string
The name of the monitor.
- 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.
- monitor
Type String The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- monitor
Dimension String The dimensions to evaluate. Valid values:
SERVICE
.- monitor
Specification String A valid JSON representation for the Expression object.
- name String
The name of the monitor.
- 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.
- monitor
Type string The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- monitor
Dimension string The dimensions to evaluate. Valid values:
SERVICE
.- monitor
Specification string A valid JSON representation for the Expression object.
- name string
The name of the monitor.
- {[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.
- 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.
- monitor
Type String The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- monitor
Dimension String The dimensions to evaluate. Valid values:
SERVICE
.- monitor
Specification String A valid JSON representation for the Expression object.
- name String
The name of the monitor.
- 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:
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.
- Arn string
ARN of the anomaly monitor.
- Monitor
Dimension string The dimensions to evaluate. Valid values:
SERVICE
.- Monitor
Specification string A valid JSON representation for the Expression object.
- Monitor
Type string The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- Name string
The name of the monitor.
- 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.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
ARN of the anomaly monitor.
- Monitor
Dimension string The dimensions to evaluate. Valid values:
SERVICE
.- Monitor
Specification string A valid JSON representation for the Expression object.
- Monitor
Type string The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- Name string
The name of the monitor.
- 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.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
ARN of the anomaly monitor.
- monitor
Dimension String The dimensions to evaluate. Valid values:
SERVICE
.- monitor
Specification String A valid JSON representation for the Expression object.
- monitor
Type String The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- name String
The name of the monitor.
- 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.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
ARN of the anomaly monitor.
- monitor
Dimension string The dimensions to evaluate. Valid values:
SERVICE
.- monitor
Specification string A valid JSON representation for the Expression object.
- monitor
Type string The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- name string
The name of the monitor.
- {[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.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- 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.
- 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.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
ARN of the anomaly monitor.
- monitor
Dimension String The dimensions to evaluate. Valid values:
SERVICE
.- monitor
Specification String A valid JSON representation for the Expression object.
- monitor
Type String The possible type values. Valid values:
DIMENSIONAL
|CUSTOM
.- name String
The name of the monitor.
- 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.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Import
Using pulumi import
, import aws_ce_anomaly_monitor
using the id
. For example:
$ pulumi import aws:costexplorer/anomalyMonitor:AnomalyMonitor example costAnomalyMonitorARN
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.