

# CreateIPSet
<a name="API_CreateIPSet"></a>

Creates an [IPSet](API_IPSet.md), which you use to identify web requests that originate from specific IP addresses or ranges of IP addresses. For example, if you're receiving a lot of requests from a ranges of IP addresses, you can configure AWS WAF to block them using an IPSet that lists those IP addresses. 

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

```
{
   "Addresses": [ "string" ],
   "Description": "string",
   "IPAddressVersion": "string",
   "Name": "string",
   "Scope": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_CreateIPSet_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [Addresses](#API_CreateIPSet_RequestSyntax) **   <a name="WAF-CreateIPSet-request-Addresses"></a>
Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses that you want AWS WAF to inspect for in incoming requests. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports all IPv4 and IPv6 CIDR ranges except for `/0`.   
Example address strings:   
+ For requests that originated from the IP address 192.0.2.44, specify `192.0.2.44/32`.
+ For requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify `192.0.2.0/24`.
+ For requests that originated from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify `1111:0000:0000:0000:0000:0000:0000:0111/128`.
+ For requests that originated from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify `1111:0000:0000:0000:0000:0000:0000:0000/64`.
For more information about CIDR notation, see the Wikipedia entry [Classless Inter-Domain Routing](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing).  
Example JSON `Addresses` specifications:   
+ Empty array: `"Addresses": []` 
+ Array with one address: `"Addresses": ["192.0.2.44/32"]` 
+ Array with three addresses: `"Addresses": ["192.0.2.44/32", "192.0.2.0/24", "192.0.0.0/16"]` 
+ INVALID specification: `"Addresses": [""]` INVALID 
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `.*\S.*`   
Required: Yes

 ** [Description](#API_CreateIPSet_RequestSyntax) **   <a name="WAF-CreateIPSet-request-Description"></a>
A description of the IP set that helps with identification.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `^[\w+=:#@/\-,\.][\w+=:#@/\-,\.\s]+[\w+=:#@/\-,\.]$`   
Required: No

 ** [IPAddressVersion](#API_CreateIPSet_RequestSyntax) **   <a name="WAF-CreateIPSet-request-IPAddressVersion"></a>
The version of the IP addresses, either `IPV4` or `IPV6`.   
Type: String  
Valid Values: `IPV4 | IPV6`   
Required: Yes

 ** [Name](#API_CreateIPSet_RequestSyntax) **   <a name="WAF-CreateIPSet-request-Name"></a>
The name of the IP set. You cannot change the name of an `IPSet` after you create it.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^[\w\-]+$`   
Required: Yes

 ** [Scope](#API_CreateIPSet_RequestSyntax) **   <a name="WAF-CreateIPSet-request-Scope"></a>
Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an AWS Amplify application, use `CLOUDFRONT`.  
To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:   
+ CLI - Specify the Region when you use the CloudFront scope: `--scope=CLOUDFRONT --region=us-east-1`. 
+ API and SDKs - For all calls, use the Region endpoint us-east-1. 
Type: String  
Valid Values: `CLOUDFRONT | REGIONAL`   
Required: Yes

 ** [Tags](#API_CreateIPSet_RequestSyntax) **   <a name="WAF-CreateIPSet-request-Tags"></a>
An array of key:value pairs to associate with the resource.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 1 item.  
Required: No

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

```
{
   "Summary": { 
      "ARN": "string",
      "Description": "string",
      "Id": "string",
      "LockToken": "string",
      "Name": "string"
   }
}
```

## Response Elements
<a name="API_CreateIPSet_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.

 ** [Summary](#API_CreateIPSet_ResponseSyntax) **   <a name="WAF-CreateIPSet-response-Summary"></a>
High-level information about an [IPSet](API_IPSet.md), returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage an `IPSet`, and the ARN, that you provide to the [IPSetReferenceStatement](API_IPSetReferenceStatement.md) to use the address set in a [Rule](API_Rule.md).  
Type: [IPSetSummary](API_IPSetSummary.md) object

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

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

 ** WAFDuplicateItemException **   
 AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.  
HTTP Status Code: 400

 ** WAFInternalErrorException **   
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.   
HTTP Status Code: 500

 ** WAFInvalidOperationException **   
The operation isn't valid.   
HTTP Status Code: 400

 ** WAFInvalidParameterException **   
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:   
+ You specified a parameter name or value that isn't valid.
+ Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested. 
+ You tried to update a `WebACL` with a `DefaultAction` that isn't among the types available at [DefaultAction](API_DefaultAction.md).
+ Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.  
 ** Field **   
The settings where the invalid parameter was found.   
 ** Parameter **   
The invalid parameter that resulted in the exception.   
 ** Reason **   
Additional information about the exception.
HTTP Status Code: 400

 ** WAFLimitsExceededException **   
 AWS WAF couldn’t perform the operation because you exceeded your resource limit. For example, the maximum number of `WebACL` objects that you can create for an AWS account. For more information, see [AWS WAF quotas](https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the * AWS WAF Developer Guide*.    
 ** SourceType **   
Source type for the exception. 
HTTP Status Code: 400

 ** WAFOptimisticLockException **   
 AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.   
HTTP Status Code: 400

 ** WAFTagOperationException **   
An error occurred during the tagging operation. Retry your request.  
HTTP Status Code: 400

 ** WAFTagOperationInternalErrorException **   
 AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.  
HTTP Status Code: 500

## See Also
<a name="API_CreateIPSet_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/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/wafv2-2019-07-29/CreateIPSet) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/wafv2-2019-07-29/CreateIPSet) 