Menu
Amazon Inspector
API Reference (API Version 2016-02-16)

CreateResourceGroup

Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target. For more information, see CreateAssessmentTarget.

Request Syntax

{
   "resourceGroupTags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ]
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

resourceGroupTags

A collection of keys and an array of possible values, '[{"key":"key1","values":["Value1","Value2"]},{"key":"Key2","values":["Value3"]}]'.

For example,'[{"key":"Name","values":["TestEC2Instance"]}]'.

Type: Array of ResourceGroupTag objects

Array Members: Minimum number of 1 item. Maximum number of 10 items.

Required: Yes

Response Syntax

{
   "resourceGroupArn": "string"
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

resourceGroupArn

The ARN that specifies the resource group that is created.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 300.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have required permissions to access the requested resource.

HTTP Status Code: 400

InternalException

Internal server error.

HTTP Status Code: 500

InvalidInputException

The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

HTTP Status Code: 400

LimitExceededException

The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.

HTTP Status Code: 400

Example

Sample Request


               
                  POST / HTTP/1.1
                  Host: inspector.us-west-2.amazonaws.com
                  Accept-Encoding: identity
                  Content-Length: 67
                  X-Amz-Target: InspectorService.CreateResourceGroup
                  X-Amz-Date: 20160331T171757Z
                  User-Agent: aws-cli/1.10.12 Python/2.7.9 Windows/7 botocore/1.4.3
                  Content-Type: application/x-amz-json-1.1
                  Authorization: AUTHPARAMS
                  {
                    "resourceGroupTags": [
                      {
                        "key": "Name",
                        "value": "example"
                      }
                    ]
                  }
               
            

Sample Response


               
                  HTTP/1.1 200 OK
                  x-amzn-RequestId: 8416dfb4-f764-11e5-872a-fde3682789d5
                  Content-Type: application/x-amz-json-1.1
                  Content-Length: 88
                  Date: Thu, 31 Mar 2016 17:17:58 GMT
                  {
                    "resourceGroupArn": "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv"
                  }
               
            

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: