The aws:devopsguru/resourceCollection:ResourceCollection resource, part of the Pulumi AWS provider, defines which AWS resources DevOps Guru monitors for anomalies and operational insights. This guide focuses on three capabilities: CloudFormation stack monitoring, tag-based resource filtering, and account-wide analysis.
Resource collections reference existing CloudFormation stacks or tagged resources. Only one collection type can be active per account at a time. The examples are intentionally small. Choose the collection type that matches your monitoring boundaries.
Monitor specific CloudFormation stacks
Teams often start by monitoring a subset of their infrastructure, focusing analysis on specific CloudFormation stacks that contain critical services.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.devopsguru.ResourceCollection("example", {
type: "AWS_CLOUD_FORMATION",
cloudformation: {
stackNames: ["ExampleStack"],
},
});
import pulumi
import pulumi_aws as aws
example = aws.devopsguru.ResourceCollection("example",
type="AWS_CLOUD_FORMATION",
cloudformation={
"stack_names": ["ExampleStack"],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/devopsguru"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devopsguru.NewResourceCollection(ctx, "example", &devopsguru.ResourceCollectionArgs{
Type: pulumi.String("AWS_CLOUD_FORMATION"),
Cloudformation: &devopsguru.ResourceCollectionCloudformationArgs{
StackNames: pulumi.StringArray{
pulumi.String("ExampleStack"),
},
},
})
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 example = new Aws.DevOpsGuru.ResourceCollection("example", new()
{
Type = "AWS_CLOUD_FORMATION",
Cloudformation = new Aws.DevOpsGuru.Inputs.ResourceCollectionCloudformationArgs
{
StackNames = new[]
{
"ExampleStack",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.devopsguru.ResourceCollection;
import com.pulumi.aws.devopsguru.ResourceCollectionArgs;
import com.pulumi.aws.devopsguru.inputs.ResourceCollectionCloudformationArgs;
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 example = new ResourceCollection("example", ResourceCollectionArgs.builder()
.type("AWS_CLOUD_FORMATION")
.cloudformation(ResourceCollectionCloudformationArgs.builder()
.stackNames("ExampleStack")
.build())
.build());
}
}
resources:
example:
type: aws:devopsguru:ResourceCollection
properties:
type: AWS_CLOUD_FORMATION
cloudformation:
stackNames:
- ExampleStack
The type property set to AWS_CLOUD_FORMATION tells DevOps Guru to monitor CloudFormation-managed resources. The stackNames array lists which stacks to analyze. DevOps Guru tracks anomalies and generates insights for resources in these stacks.
Monitor resources by tag key and values
Organizations that use tagging standards can scope DevOps Guru to resources with specific tag combinations, enabling team-based or environment-based monitoring boundaries.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.devopsguru.ResourceCollection("example", {
type: "AWS_TAGS",
tags: {
appBoundaryKey: "DevOps-Guru-Example",
tagValues: ["Example-Value"],
},
});
import pulumi
import pulumi_aws as aws
example = aws.devopsguru.ResourceCollection("example",
type="AWS_TAGS",
tags={
"app_boundary_key": "DevOps-Guru-Example",
"tag_values": ["Example-Value"],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/devopsguru"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devopsguru.NewResourceCollection(ctx, "example", &devopsguru.ResourceCollectionArgs{
Type: pulumi.String("AWS_TAGS"),
Tags: &devopsguru.ResourceCollectionTagsArgs{
AppBoundaryKey: pulumi.String("DevOps-Guru-Example"),
TagValues: pulumi.StringArray{
pulumi.String("Example-Value"),
},
},
})
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 example = new Aws.DevOpsGuru.ResourceCollection("example", new()
{
Type = "AWS_TAGS",
Tags = new Aws.DevOpsGuru.Inputs.ResourceCollectionTagsArgs
{
AppBoundaryKey = "DevOps-Guru-Example",
TagValues = new[]
{
"Example-Value",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.devopsguru.ResourceCollection;
import com.pulumi.aws.devopsguru.ResourceCollectionArgs;
import com.pulumi.aws.devopsguru.inputs.ResourceCollectionTagsArgs;
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 example = new ResourceCollection("example", ResourceCollectionArgs.builder()
.type("AWS_TAGS")
.tags(ResourceCollectionTagsArgs.builder()
.appBoundaryKey("DevOps-Guru-Example")
.tagValues("Example-Value")
.build())
.build());
}
}
resources:
example:
type: aws:devopsguru:ResourceCollection
properties:
type: AWS_TAGS
tags:
appBoundaryKey: DevOps-Guru-Example
tagValues:
- Example-Value
The type property set to AWS_TAGS enables tag-based filtering. The appBoundaryKey specifies which tag key to look for, and tagValues lists the specific values to include. DevOps Guru analyzes only resources that match both the key and one of the listed values.
Monitor all resources with a tag key
When you want to analyze all resources that share a tag key regardless of their values, you can use a wildcard to include everything with that key.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.devopsguru.ResourceCollection("example", {
type: "AWS_TAGS",
tags: {
appBoundaryKey: "DevOps-Guru-Example",
tagValues: ["*"],
},
});
import pulumi
import pulumi_aws as aws
example = aws.devopsguru.ResourceCollection("example",
type="AWS_TAGS",
tags={
"app_boundary_key": "DevOps-Guru-Example",
"tag_values": ["*"],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/devopsguru"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devopsguru.NewResourceCollection(ctx, "example", &devopsguru.ResourceCollectionArgs{
Type: pulumi.String("AWS_TAGS"),
Tags: &devopsguru.ResourceCollectionTagsArgs{
AppBoundaryKey: pulumi.String("DevOps-Guru-Example"),
TagValues: pulumi.StringArray{
pulumi.String("*"),
},
},
})
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 example = new Aws.DevOpsGuru.ResourceCollection("example", new()
{
Type = "AWS_TAGS",
Tags = new Aws.DevOpsGuru.Inputs.ResourceCollectionTagsArgs
{
AppBoundaryKey = "DevOps-Guru-Example",
TagValues = new[]
{
"*",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.devopsguru.ResourceCollection;
import com.pulumi.aws.devopsguru.ResourceCollectionArgs;
import com.pulumi.aws.devopsguru.inputs.ResourceCollectionTagsArgs;
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 example = new ResourceCollection("example", ResourceCollectionArgs.builder()
.type("AWS_TAGS")
.tags(ResourceCollectionTagsArgs.builder()
.appBoundaryKey("DevOps-Guru-Example")
.tagValues("*")
.build())
.build());
}
}
resources:
example:
type: aws:devopsguru:ResourceCollection
properties:
type: AWS_TAGS
tags:
appBoundaryKey: DevOps-Guru-Example
tagValues:
- '*'
Setting tagValues to ["*"] tells DevOps Guru to include all resources with the specified appBoundaryKey, regardless of the tag’s value. This is useful when you want to monitor everything tagged with a particular key but don’t want to maintain a list of specific values.
Monitor all account resources
For comprehensive monitoring, DevOps Guru can analyze all resources across your account by using a wildcard stack name with the AWS_SERVICE type.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.devopsguru.ResourceCollection("example", {
type: "AWS_SERVICE",
cloudformation: {
stackNames: ["*"],
},
});
import pulumi
import pulumi_aws as aws
example = aws.devopsguru.ResourceCollection("example",
type="AWS_SERVICE",
cloudformation={
"stack_names": ["*"],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/devopsguru"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devopsguru.NewResourceCollection(ctx, "example", &devopsguru.ResourceCollectionArgs{
Type: pulumi.String("AWS_SERVICE"),
Cloudformation: &devopsguru.ResourceCollectionCloudformationArgs{
StackNames: pulumi.StringArray{
pulumi.String("*"),
},
},
})
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 example = new Aws.DevOpsGuru.ResourceCollection("example", new()
{
Type = "AWS_SERVICE",
Cloudformation = new Aws.DevOpsGuru.Inputs.ResourceCollectionCloudformationArgs
{
StackNames = new[]
{
"*",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.devopsguru.ResourceCollection;
import com.pulumi.aws.devopsguru.ResourceCollectionArgs;
import com.pulumi.aws.devopsguru.inputs.ResourceCollectionCloudformationArgs;
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 example = new ResourceCollection("example", ResourceCollectionArgs.builder()
.type("AWS_SERVICE")
.cloudformation(ResourceCollectionCloudformationArgs.builder()
.stackNames("*")
.build())
.build());
}
}
resources:
example:
type: aws:devopsguru:ResourceCollection
properties:
type: AWS_SERVICE
cloudformation:
stackNames:
- '*'
The type property set to AWS_SERVICE with stackNames set to ["*"] enables account-wide monitoring. DevOps Guru analyzes all supported resources in your account, providing comprehensive anomaly detection and operational insights across your entire infrastructure.
Beyond these examples
These snippets focus on specific resource collection features: CloudFormation stack scoping, tag-based resource filtering, and account-wide monitoring. They’re intentionally minimal rather than complete monitoring configurations.
The examples may reference pre-existing infrastructure such as CloudFormation stacks for stack-based monitoring, and tagged resources for tag-based monitoring. They focus on defining the collection scope rather than provisioning the resources to be monitored.
To keep things focused, collection-level patterns are omitted, including:
- Region-specific configuration (region property)
- Multiple resource collections (only one type allowed per account)
These omissions are intentional: the goal is to illustrate how each collection type is wired, not provide drop-in monitoring modules. See the DevOps Guru ResourceCollection resource reference for all available configuration options.
Let's configure AWS DevOps Guru Resource Collections
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Configuration & Limitations
AWS_SERVICE (all account resources), AWS_CLOUD_FORMATION (specific CloudFormation stacks), and AWS_TAGS (tag-based filtering). Choose the type that matches your monitoring scope.Setup Patterns
type to AWS_SERVICE and configure cloudformation.stackNames to ["*"] to analyze all account resources.type to AWS_CLOUD_FORMATION and list your stack names in cloudformation.stackNames, such as ["ExampleStack"].type to AWS_TAGS, then configure tags.appBoundaryKey with your tag key and tags.tagValues with an array of tag values to filter resources.Advanced Usage
["*"] as a wildcard in either cloudformation.stackNames (for all stacks) or tags.tagValues (for all values of a tag key).Using a different cloud?
Explore monitoring guides for other cloud providers: