Terraform resource for managing an AWS DevOps Guru Resource Collection.
resource "aws_devopsguru_resource_collection" "example" {
type = "AWS_SERVICE"
cloudformation {
stack_names = ["*"]
}
}
resource "aws_devopsguru_resource_collection" "example" {
type = "AWS_CLOUD_FORMATION"
cloudformation {
stack_names = ["ExampleStack"]
}
}
resource "aws_devopsguru_resource_collection" "example" {
type = "AWS_TAGS"
tags {
app_boundary_key = "DevOps-Guru-Example"
tag_values = ["Example-Value"]
}
}
To analyze all resources with the app_boundary_key
regardless of the corresponding tag value, set tag_values
to ["*"]
.
resource "aws_devopsguru_resource_collection" "example" {
type = "AWS_TAGS"
tags {
app_boundary_key = "DevOps-Guru-Example"
tag_values = ["*"]
}
}
The following arguments are required:
type
- (Required) Type of AWS resource collection to create. Valid values are AWS_CLOUD_FORMATION
, AWS_SERVICE
, and AWS_TAGS
.The following arguments are optional:
cloudformation
- (Optional) A collection of AWS CloudFormation stacks. See cloudformation
below for additional details.tags
- (Optional) AWS tags used to filter the resources in the resource collection. See tags
below for additional details.cloudformation
Argument Referencestack_names
- (Required) Array of the names of the AWS CloudFormation stacks. If type
is AWS_SERVICE
(all acccount resources) this array should be a single item containing a wildcard ("*"
).tags
Argument Referenceapp_boundary_key
- (Required) An AWS tag key that is used to identify the AWS resources that DevOps Guru analyzes. All AWS resources in your account and Region tagged with this key make up your DevOps Guru application and analysis boundary. The key must begin with the prefix DevOps-Guru-
. Any casing can be used for the prefix, but the associated tags __must use the same casing__ in their tag key.tag_values
- (Required) Array of tag values. These can be used to further filter for specific resources within the application boundary. To analyze all resources tagged with the app_boundary_key
regardless of the corresponding tag value, this array should be a single item containing a wildcard ("*"
).This resource exports the following attributes in addition to the arguments above:
id
- Type of AWS resource collection to create (same value as type
).In Terraform v1.5.0 and later, use an import
block to import DevOps Guru Resource Collection using the id
. For example:
import {
to = aws_devopsguru_resource_collection.example
id = "AWS_CLOUD_FORMATION"
}
Using terraform import
, import DevOps Guru Resource Collection using the id
. For example:
% terraform import aws_devopsguru_resource_collection.example AWS_CLOUD_FORMATION