aws.costexplorer.AnomalyMonitor
Explore with Pulumi AI
Provides a CE Anomaly Monitor.
Example Usage
There are two main types of a Cost Anomaly Monitor: DIMENSIONAL
and CUSTOM
.
Dimensional Example
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const serviceMonitor = new aws.costexplorer.AnomalyMonitor("service_monitor", {
name: "AWSServiceMonitor",
monitorType: "DIMENSIONAL",
monitorDimension: "SERVICE",
});
import pulumi
import pulumi_aws as aws
service_monitor = aws.costexplorer.AnomalyMonitor("service_monitor",
name="AWSServiceMonitor",
monitor_type="DIMENSIONAL",
monitor_dimension="SERVICE")
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, "service_monitor", &costexplorer.AnomalyMonitorArgs{
Name: pulumi.String("AWSServiceMonitor"),
MonitorType: pulumi.String("DIMENSIONAL"),
MonitorDimension: pulumi.String("SERVICE"),
})
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 serviceMonitor = new Aws.CostExplorer.AnomalyMonitor("service_monitor", new()
{
Name = "AWSServiceMonitor",
MonitorType = "DIMENSIONAL",
MonitorDimension = "SERVICE",
});
});
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()
.name("AWSServiceMonitor")
.monitorType("DIMENSIONAL")
.monitorDimension("SERVICE")
.build());
}
}
resources:
serviceMonitor:
type: aws:costexplorer:AnomalyMonitor
name: service_monitor
properties:
name: AWSServiceMonitor
monitorType: DIMENSIONAL
monitorDimension: SERVICE
Custom Example
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.costexplorer.AnomalyMonitor("test", {
name: "AWSCustomAnomalyMonitor",
monitorType: "CUSTOM",
monitorSpecification: JSON.stringify({
And: undefined,
CostCategories: undefined,
Dimensions: undefined,
Not: undefined,
Or: undefined,
Tags: {
Key: "CostCenter",
MatchOptions: undefined,
Values: ["10000"],
},
}),
});
import pulumi
import json
import pulumi_aws as aws
test = aws.costexplorer.AnomalyMonitor("test",
name="AWSCustomAnomalyMonitor",
monitor_type="CUSTOM",
monitor_specification=json.dumps({
"And": None,
"CostCategories": None,
"Dimensions": None,
"Not": None,
"Or": None,
"Tags": {
"Key": "CostCenter",
"MatchOptions": None,
"Values": ["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{
Name: pulumi.String("AWSCustomAnomalyMonitor"),
MonitorType: pulumi.String("CUSTOM"),
MonitorSpecification: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
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()
{
Name = "AWSCustomAnomalyMonitor",
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 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()
.name("AWSCustomAnomalyMonitor")
.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());
}
}
resources:
test:
type: aws:costexplorer:AnomalyMonitor
properties:
name: AWSCustomAnomalyMonitor
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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AnomalyMonitor(name: string, args: AnomalyMonitorArgs, opts?: CustomResourceOptions);
@overload
def AnomalyMonitor(resource_name: str,
args: AnomalyMonitorArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AnomalyMonitor(resource_name: str,
opts: Optional[ResourceOptions] = None,
monitor_type: Optional[str] = None,
monitor_dimension: Optional[str] = None,
monitor_specification: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var anomalyMonitorResource = new Aws.CostExplorer.AnomalyMonitor("anomalyMonitorResource", new()
{
MonitorType = "string",
MonitorDimension = "string",
MonitorSpecification = "string",
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := costexplorer.NewAnomalyMonitor(ctx, "anomalyMonitorResource", &costexplorer.AnomalyMonitorArgs{
MonitorType: pulumi.String("string"),
MonitorDimension: pulumi.String("string"),
MonitorSpecification: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var anomalyMonitorResource = new AnomalyMonitor("anomalyMonitorResource", AnomalyMonitorArgs.builder()
.monitorType("string")
.monitorDimension("string")
.monitorSpecification("string")
.name("string")
.tags(Map.of("string", "string"))
.build());
anomaly_monitor_resource = aws.costexplorer.AnomalyMonitor("anomalyMonitorResource",
monitor_type="string",
monitor_dimension="string",
monitor_specification="string",
name="string",
tags={
"string": "string",
})
const anomalyMonitorResource = new aws.costexplorer.AnomalyMonitor("anomalyMonitorResource", {
monitorType: "string",
monitorDimension: "string",
monitorSpecification: "string",
name: "string",
tags: {
string: "string",
},
});
type: aws:costexplorer:AnomalyMonitor
properties:
monitorDimension: string
monitorSpecification: string
monitorType: string
name: string
tags:
string: string
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.
- 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.
- 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.
- 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.
- 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.
- 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.
Import
Using pulumi import
, import aws_ce_anomaly_monitor
using the id
. For example:
$ pulumi import aws:costexplorer/anomalyMonitor:AnomalyMonitor example costAnomalyMonitorARN
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.