Container for the parameters to the CreateIPSet operation. Creates an IPSet, which you use to specify which web requests you want to allow or block based on the IP addresses that the requests originate from. For example, if you're receiving a lot of requests from one or more individual IP addresses or one or more ranges of IP addresses and you want to block the requests, you can create an IPSet that contains those IP addresses and then configure AWS WAF to block the requests.

To create and configure an IPSet, perform the following steps:

  1. Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of a CreateIPSet request.

  2. Submit a CreateIPSet request.

  3. Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateIPSet request.

  4. Submit an UpdateIPSet request to specify the IP addresses that you want AWS WAF to watch for.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide.

상속: AmazonWAFRegionalRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.WAFRegional.Model.CreateIPSetRequest();

            if (cmdletContext.ChangeToken != null)
            {
                request.ChangeToken = cmdletContext.ChangeToken;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
예제 #2
0
        /// <summary>
        /// Creates an <a>IPSet</a>, which you use to specify which web requests you want to allow
        /// or block based on the IP addresses that the requests originate from. For example,
        /// if you're receiving a lot of requests from one or more individual IP addresses or
        /// one or more ranges of IP addresses and you want to block the requests, you can create
        /// an <code>IPSet</code> that contains those IP addresses and then configure AWS WAF
        /// to block the requests. 
        /// 
        ///  
        /// <para>
        /// To create and configure an <code>IPSet</code>, perform the following steps:
        /// </para>
        ///  <ol> <li> 
        /// <para>
        /// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
        /// parameter of a <code>CreateIPSet</code> request.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Submit a <code>CreateIPSet</code> request.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
        /// parameter of an <a>UpdateIPSet</a> request.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Submit an <code>UpdateIPSet</code> request to specify the IP addresses that you want
        /// AWS WAF to watch for.
        /// </para>
        ///  </li> </ol> 
        /// <para>
        /// For more information about how to use the AWS WAF API to allow or block HTTP requests,
        /// see the <a href="http://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
        /// Guide</a>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateIPSet service method.</param>
        /// 
        /// <returns>The response from the CreateIPSet service method, as returned by WAFRegional.</returns>
        /// <exception cref="Amazon.WAFRegional.Model.WAFDisallowedNameException">
        /// The name specified is invalid.
        /// </exception>
        /// <exception cref="Amazon.WAFRegional.Model.WAFInternalErrorException">
        /// The operation failed because of a system problem, even though the request was valid.
        /// Retry your request.
        /// </exception>
        /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidAccountException">
        /// The operation failed because you tried to create, update, or delete an object by using
        /// an invalid account identifier.
        /// </exception>
        /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidParameterException">
        /// The operation failed because AWS WAF didn't recognize a parameter in the request.
        /// For example:
        /// 
        ///  <ul> <li> 
        /// <para>
        /// You specified an invalid parameter name.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// You specified an invalid value.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
        /// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
        /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
        /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
        /// other than HEADER, QUERY_STRING, or URI.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
        /// but no value for <code>Data</code>.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Your request references an ARN that is malformed, or corresponds to a resource with
        /// which a web ACL cannot be associated.
        /// </para>
        ///  </li> </ul>
        /// </exception>
        /// <exception cref="Amazon.WAFRegional.Model.WAFLimitsExceededException">
        /// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
        /// objects that you can create for an AWS account. For more information, see <a href="http://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
        /// in the <i>AWS WAF Developer Guide</i>.
        /// </exception>
        /// <exception cref="Amazon.WAFRegional.Model.WAFStaleDataException">
        /// The operation failed because you tried to create, update, or delete an object by using
        /// a change token that has already been used.
        /// </exception>
        public CreateIPSetResponse CreateIPSet(CreateIPSetRequest request)
        {
            var marshaller = new CreateIPSetRequestMarshaller();
            var unmarshaller = CreateIPSetResponseUnmarshaller.Instance;

            return Invoke<CreateIPSetRequest,CreateIPSetResponse>(request, marshaller, unmarshaller);
        }
예제 #3
0
 /// <summary>
 /// Creates an <a>IPSet</a>, which you use to specify which web requests you want to allow
 /// or block based on the IP addresses that the requests originate from. For example,
 /// if you're receiving a lot of requests from one or more individual IP addresses or
 /// one or more ranges of IP addresses and you want to block the requests, you can create
 /// an <code>IPSet</code> that contains those IP addresses and then configure AWS WAF
 /// to block the requests. 
 /// 
 ///  
 /// <para>
 /// To create and configure an <code>IPSet</code>, perform the following steps:
 /// </para>
 ///  <ol> <li> 
 /// <para>
 /// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
 /// parameter of a <code>CreateIPSet</code> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Submit a <code>CreateIPSet</code> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
 /// parameter of an <a>UpdateIPSet</a> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Submit an <code>UpdateIPSet</code> request to specify the IP addresses that you want
 /// AWS WAF to watch for.
 /// </para>
 ///  </li> </ol> 
 /// <para>
 /// For more information about how to use the AWS WAF API to allow or block HTTP requests,
 /// see the <a href="http://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
 /// Guide</a>.
 /// </para>
 /// </summary>
 /// <param name="name">A friendly name or description of the <a>IPSet</a>. You can't change <code>Name</code> after you create the <code>IPSet</code>.</param>
 /// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
 /// 
 /// <returns>The response from the CreateIPSet service method, as returned by WAFRegional.</returns>
 /// <exception cref="Amazon.WAFRegional.Model.WAFDisallowedNameException">
 /// The name specified is invalid.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFInternalErrorException">
 /// The operation failed because of a system problem, even though the request was valid.
 /// Retry your request.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidAccountException">
 /// The operation failed because you tried to create, update, or delete an object by using
 /// an invalid account identifier.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidParameterException">
 /// The operation failed because AWS WAF didn't recognize a parameter in the request.
 /// For example:
 /// 
 ///  <ul> <li> 
 /// <para>
 /// You specified an invalid parameter name.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You specified an invalid value.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
 /// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
 /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
 /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
 /// other than HEADER, QUERY_STRING, or URI.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
 /// but no value for <code>Data</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Your request references an ARN that is malformed, or corresponds to a resource with
 /// which a web ACL cannot be associated.
 /// </para>
 ///  </li> </ul>
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFLimitsExceededException">
 /// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
 /// objects that you can create for an AWS account. For more information, see <a href="http://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
 /// in the <i>AWS WAF Developer Guide</i>.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFStaleDataException">
 /// The operation failed because you tried to create, update, or delete an object by using
 /// a change token that has already been used.
 /// </exception>
 public CreateIPSetResponse CreateIPSet(string name, string changeToken)
 {
     var request = new CreateIPSetRequest();
     request.Name = name;
     request.ChangeToken = changeToken;
     return CreateIPSet(request);
 }
예제 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateIPSet operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateIPSet operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<CreateIPSetResponse> CreateIPSetAsync(CreateIPSetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateIPSetRequestMarshaller();
            var unmarshaller = CreateIPSetResponseUnmarshaller.Instance;

            return InvokeAsync<CreateIPSetRequest,CreateIPSetResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
예제 #5
0
 /// <summary>
 /// Creates an <a>IPSet</a>, which you use to specify which web requests you want to allow
 /// or block based on the IP addresses that the requests originate from. For example,
 /// if you're receiving a lot of requests from one or more individual IP addresses or
 /// one or more ranges of IP addresses and you want to block the requests, you can create
 /// an <code>IPSet</code> that contains those IP addresses and then configure AWS WAF
 /// to block the requests. 
 /// 
 ///  
 /// <para>
 /// To create and configure an <code>IPSet</code>, perform the following steps:
 /// </para>
 ///  <ol> <li> 
 /// <para>
 /// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
 /// parameter of a <code>CreateIPSet</code> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Submit a <code>CreateIPSet</code> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
 /// parameter of an <a>UpdateIPSet</a> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Submit an <code>UpdateIPSet</code> request to specify the IP addresses that you want
 /// AWS WAF to watch for.
 /// </para>
 ///  </li> </ol> 
 /// <para>
 /// For more information about how to use the AWS WAF API to allow or block HTTP requests,
 /// see the <a href="http://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
 /// Guide</a>.
 /// </para>
 /// </summary>
 /// <param name="name">A friendly name or description of the <a>IPSet</a>. You can't change <code>Name</code> after you create the <code>IPSet</code>.</param>
 /// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the CreateIPSet service method, as returned by WAFRegional.</returns>
 /// <exception cref="Amazon.WAFRegional.Model.WAFDisallowedNameException">
 /// The name specified is invalid.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFInternalErrorException">
 /// The operation failed because of a system problem, even though the request was valid.
 /// Retry your request.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidAccountException">
 /// The operation failed because you tried to create, update, or delete an object by using
 /// an invalid account identifier.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidParameterException">
 /// The operation failed because AWS WAF didn't recognize a parameter in the request.
 /// For example:
 /// 
 ///  <ul> <li> 
 /// <para>
 /// You specified an invalid parameter name.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You specified an invalid value.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
 /// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
 /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
 /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
 /// other than HEADER, QUERY_STRING, or URI.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
 /// but no value for <code>Data</code>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Your request references an ARN that is malformed, or corresponds to a resource with
 /// which a web ACL cannot be associated.
 /// </para>
 ///  </li> </ul>
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFLimitsExceededException">
 /// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
 /// objects that you can create for an AWS account. For more information, see <a href="http://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
 /// in the <i>AWS WAF Developer Guide</i>.
 /// </exception>
 /// <exception cref="Amazon.WAFRegional.Model.WAFStaleDataException">
 /// The operation failed because you tried to create, update, or delete an object by using
 /// a change token that has already been used.
 /// </exception>
 public Task<CreateIPSetResponse> CreateIPSetAsync(string name, string changeToken, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new CreateIPSetRequest();
     request.Name = name;
     request.ChangeToken = changeToken;
     return CreateIPSetAsync(request, cancellationToken);
 }
 private Amazon.WAFRegional.Model.CreateIPSetResponse CallAWSServiceOperation(IAmazonWAFRegional client, Amazon.WAFRegional.Model.CreateIPSetRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS WAF Regional", "CreateIPSet");
     try
     {
         #if DESKTOP
         return(client.CreateIPSet(request));
         #elif CORECLR
         return(client.CreateIPSetAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
예제 #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateIPSet operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateIPSet operation on AmazonWAFRegionalClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateIPSet
        ///         operation.</returns>
        public IAsyncResult BeginCreateIPSet(CreateIPSetRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateIPSetRequestMarshaller();
            var unmarshaller = CreateIPSetResponseUnmarshaller.Instance;

            return BeginInvoke<CreateIPSetRequest>(request, marshaller, unmarshaller,
                callback, state);
        }