

# CreateMalwareProtectionPlan
<a name="API_CreateMalwareProtectionPlan"></a>

Creates a new Malware Protection plan for the protected resource.

When you create a Malware Protection plan, the AWS service terms for GuardDuty Malware Protection apply. For more information, see [AWS service terms for GuardDuty Malware Protection](http://aws.amazon.com/service-terms/#87._Amazon_GuardDuty).

## Request Syntax
<a name="API_CreateMalwareProtectionPlan_RequestSyntax"></a>

```
POST /malware-protection-plan HTTP/1.1
Content-type: application/json

{
   "actions": { 
      "tagging": { 
         "status": "string"
      }
   },
   "clientToken": "string",
   "protectedResource": { 
      "s3Bucket": { 
         "bucketName": "string",
         "objectPrefixes": [ "string" ]
      }
   },
   "role": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## URI Request Parameters
<a name="API_CreateMalwareProtectionPlan_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_CreateMalwareProtectionPlan_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [actions](#API_CreateMalwareProtectionPlan_RequestSyntax) **   <a name="guardduty-CreateMalwareProtectionPlan-request-actions"></a>
Information about whether the tags will be added to the S3 object after scanning.  
Type: [MalwareProtectionPlanActions](API_MalwareProtectionPlanActions.md) object  
Required: No

 ** [clientToken](#API_CreateMalwareProtectionPlan_RequestSyntax) **   <a name="guardduty-CreateMalwareProtectionPlan-request-clientToken"></a>
The idempotency token for the create request.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 64.  
Required: No

 ** [protectedResource](#API_CreateMalwareProtectionPlan_RequestSyntax) **   <a name="guardduty-CreateMalwareProtectionPlan-request-protectedResource"></a>
Information about the protected resource that is associated with the created Malware Protection plan. Presently, `S3Bucket` is the only supported protected resource.  
Type: [CreateProtectedResource](API_CreateProtectedResource.md) object  
Required: Yes

 ** [role](#API_CreateMalwareProtectionPlan_RequestSyntax) **   <a name="guardduty-CreateMalwareProtectionPlan-request-role"></a>
Amazon Resource Name (ARN) of the IAM role that has the permissions to scan and add tags to the associated protected resource.  
Type: String  
Required: Yes

 ** [tags](#API_CreateMalwareProtectionPlan_RequestSyntax) **   <a name="guardduty-CreateMalwareProtectionPlan-request-tags"></a>
Tags added to the Malware Protection plan resource.   
Type: String to string map  
Map Entries: Maximum number of 200 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `(?!aws:)[a-zA-Z+-=._:/]+`   
Value Length Constraints: Minimum length of 0. Maximum length of 256.  
Required: No

## Response Syntax
<a name="API_CreateMalwareProtectionPlan_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "malwareProtectionPlanId": "string"
}
```

## Response Elements
<a name="API_CreateMalwareProtectionPlan_ResponseElements"></a>

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

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

 ** [malwareProtectionPlanId](#API_CreateMalwareProtectionPlan_ResponseSyntax) **   <a name="guardduty-CreateMalwareProtectionPlan-response-malwareProtectionPlanId"></a>
A unique identifier associated with the Malware Protection plan resource.  
Type: String

## Errors
<a name="API_CreateMalwareProtectionPlan_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
An access denied exception object.    
 ** Message **   
The error message.  
 ** Type **   
The error type.
HTTP Status Code: 403

 ** BadRequestException **   
A bad request exception object.    
 ** Message **   
The error message.  
 ** Type **   
The error type.
HTTP Status Code: 400

 ** ConflictException **   
A request conflict exception object.    
 ** Message **   
The error message.  
 ** Type **   
The error type.
HTTP Status Code: 409

 ** InternalServerErrorException **   
An internal server error exception object.    
 ** Message **   
The error message.  
 ** Type **   
The error type.
HTTP Status Code: 500

## See Also
<a name="API_CreateMalwareProtectionPlan_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/guardduty-2017-11-28/CreateMalwareProtectionPlan) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/guardduty-2017-11-28/CreateMalwareProtectionPlan) 