AWS Amazon Inspector Resource Group

This page shows how to write Terraform and CloudFormation for Amazon Inspector Resource Group and write them securely.

aws_inspector_resource_group (Terraform)

The Resource Group in Amazon Inspector can be configured in Terraform with the resource name aws_inspector_resource_group. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "aws_inspector_resource_group" "inspector_resource_group" {
  tags = {
    Name = "Name"
    Env  = "inspector_group"
  }
}
inspector.tf#L1
resource "aws_inspector_resource_group" "scheduled_inspector" {
  tags {
    Inspector   = "True"
    Terraformed = "true"
  }
}
inspector.tf#L1
resource "aws_inspector_resource_group" "this" {
  tags = {
    Name = "continuous-assessment-instance"
    Env  = "True"
  }
}

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

  • arn optional computed - string
  • id optional computed - string
  • tags required - map from string to string

Explanation in Terraform Registry

Provides an Amazon Inspector resource group resource.

AWS::Inspector::ResourceGroup (CloudFormation)

The ResourceGroup in Inspector can be configured in CloudFormation with the resource name AWS::Inspector::ResourceGroup. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

nginx-image-builder.yml#L80
    Type: "AWS::Inspector::ResourceGroup"
    Properties:
      ResourceGroupTags:
        - Key: "ResourceGroup"
          Value: "Nginx"

cfn-inspector-sns.yml#L19
    Type: AWS::Inspector::ResourceGroup
    Properties:
      ResourceGroupTags:
        - Key: !Ref ResourceGroupTagKey
          Value: !Ref ResourceGroupTagValue

cfn-inspector-custom-sns.yml#L19
    Type: AWS::Inspector::ResourceGroup
    Properties:
      ResourceGroupTags:
        - Key: !Ref ResourceGroupTagKey
          Value: !Ref ResourceGroupTagValue

AWS_Inspector.yml#L156
    Type: AWS::Inspector::ResourceGroup
    Properties:
      ResourceGroupTags:
       -
         Key: !Ref EC2Tag1Key
         Value: !Ref EC2Tag1Value
cfn-inspector.yml#L15
    Type: AWS::Inspector::ResourceGroup
    Properties:
      ResourceGroupTags:
        - Key: !Ref ResourceGroupTagKey
          Value: !Ref ResourceGroupTagValue

InspectorResourceGroupSpecification.json#L22
    "AWS::Inspector::ResourceGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-resourcegroup.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }
InspectorResourceGroupSpecification.json#L22
    "AWS::Inspector::ResourceGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-resourcegroup.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }
InspectorResourceGroupSpecification.json#L22
    "AWS::Inspector::ResourceGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-resourcegroup.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }
InspectorResourceGroupSpecification.json#L22
    "AWS::Inspector::ResourceGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-resourcegroup.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }
InspectorResourceGroupSpecification.json#L22
    "AWS::Inspector::ResourceGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-resourcegroup.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }

Parameters

Explanation in CloudFormation Registry

The AWS::Inspector::ResourceGroup resource is used to create Amazon Inspector resource groups. A resource group defines a set of tags that, when queried, identify the AWS resources that make up the assessment target.

Frequently asked questions

What is AWS Amazon Inspector Resource Group?

AWS Amazon Inspector Resource Group is a resource for Amazon Inspector of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon Inspector Resource Group?

For Terraform, the Prashant-jumpbyte/terraform-aws-inspector-setup, heldersepu/hs-scripts and sridhartw/golden_ami_scanning source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the aws-samples/deploy-cis-level-1-hardened-ami-with-ec2-image-builder-pipeline, ambasad/devio-blog-cfn and ambasad/devio-blog-cfn source code examples are useful. See the CloudFormation Example section for further details.