wafregional

package
v1.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package wafregional provides a client for AWS WAF Regional.

Index

Examples

Constants

View Source
const (
	// ChangeActionInsert is a ChangeAction enum value
	ChangeActionInsert = "INSERT"

	// ChangeActionDelete is a ChangeAction enum value
	ChangeActionDelete = "DELETE"
)
View Source
const (
	// ChangeTokenStatusProvisioned is a ChangeTokenStatus enum value
	ChangeTokenStatusProvisioned = "PROVISIONED"

	// ChangeTokenStatusPending is a ChangeTokenStatus enum value
	ChangeTokenStatusPending = "PENDING"

	// ChangeTokenStatusInsync is a ChangeTokenStatus enum value
	ChangeTokenStatusInsync = "INSYNC"
)
View Source
const (
	// ComparisonOperatorEq is a ComparisonOperator enum value
	ComparisonOperatorEq = "EQ"

	// ComparisonOperatorNe is a ComparisonOperator enum value
	ComparisonOperatorNe = "NE"

	// ComparisonOperatorLe is a ComparisonOperator enum value
	ComparisonOperatorLe = "LE"

	// ComparisonOperatorLt is a ComparisonOperator enum value
	ComparisonOperatorLt = "LT"

	// ComparisonOperatorGe is a ComparisonOperator enum value
	ComparisonOperatorGe = "GE"

	// ComparisonOperatorGt is a ComparisonOperator enum value
	ComparisonOperatorGt = "GT"
)
View Source
const (
	// IPSetDescriptorTypeIpv4 is a IPSetDescriptorType enum value
	IPSetDescriptorTypeIpv4 = "IPV4"

	// IPSetDescriptorTypeIpv6 is a IPSetDescriptorType enum value
	IPSetDescriptorTypeIpv6 = "IPV6"
)
View Source
const (
	// MatchFieldTypeUri is a MatchFieldType enum value
	MatchFieldTypeUri = "URI"

	// MatchFieldTypeQueryString is a MatchFieldType enum value
	MatchFieldTypeQueryString = "QUERY_STRING"

	// MatchFieldTypeHeader is a MatchFieldType enum value
	MatchFieldTypeHeader = "HEADER"

	// MatchFieldTypeMethod is a MatchFieldType enum value
	MatchFieldTypeMethod = "METHOD"

	// MatchFieldTypeBody is a MatchFieldType enum value
	MatchFieldTypeBody = "BODY"
)
View Source
const (
	// ParameterExceptionFieldChangeAction is a ParameterExceptionField enum value
	ParameterExceptionFieldChangeAction = "CHANGE_ACTION"

	// ParameterExceptionFieldWafAction is a ParameterExceptionField enum value
	ParameterExceptionFieldWafAction = "WAF_ACTION"

	// ParameterExceptionFieldPredicateType is a ParameterExceptionField enum value
	ParameterExceptionFieldPredicateType = "PREDICATE_TYPE"

	// ParameterExceptionFieldIpsetType is a ParameterExceptionField enum value
	ParameterExceptionFieldIpsetType = "IPSET_TYPE"

	// ParameterExceptionFieldByteMatchFieldType is a ParameterExceptionField enum value
	ParameterExceptionFieldByteMatchFieldType = "BYTE_MATCH_FIELD_TYPE"

	// ParameterExceptionFieldSqlInjectionMatchFieldType is a ParameterExceptionField enum value
	ParameterExceptionFieldSqlInjectionMatchFieldType = "SQL_INJECTION_MATCH_FIELD_TYPE"

	// ParameterExceptionFieldByteMatchTextTransformation is a ParameterExceptionField enum value
	ParameterExceptionFieldByteMatchTextTransformation = "BYTE_MATCH_TEXT_TRANSFORMATION"

	// ParameterExceptionFieldByteMatchPositionalConstraint is a ParameterExceptionField enum value
	ParameterExceptionFieldByteMatchPositionalConstraint = "BYTE_MATCH_POSITIONAL_CONSTRAINT"

	// ParameterExceptionFieldSizeConstraintComparisonOperator is a ParameterExceptionField enum value
	ParameterExceptionFieldSizeConstraintComparisonOperator = "SIZE_CONSTRAINT_COMPARISON_OPERATOR"
)
View Source
const (
	// ParameterExceptionReasonInvalidOption is a ParameterExceptionReason enum value
	ParameterExceptionReasonInvalidOption = "INVALID_OPTION"

	// ParameterExceptionReasonIllegalCombination is a ParameterExceptionReason enum value
	ParameterExceptionReasonIllegalCombination = "ILLEGAL_COMBINATION"
)
View Source
const (
	// PositionalConstraintExactly is a PositionalConstraint enum value
	PositionalConstraintExactly = "EXACTLY"

	// PositionalConstraintStartsWith is a PositionalConstraint enum value
	PositionalConstraintStartsWith = "STARTS_WITH"

	// PositionalConstraintEndsWith is a PositionalConstraint enum value
	PositionalConstraintEndsWith = "ENDS_WITH"

	// PositionalConstraintContains is a PositionalConstraint enum value
	PositionalConstraintContains = "CONTAINS"

	// PositionalConstraintContainsWord is a PositionalConstraint enum value
	PositionalConstraintContainsWord = "CONTAINS_WORD"
)
View Source
const (
	// PredicateTypeIpmatch is a PredicateType enum value
	PredicateTypeIpmatch = "IPMatch"

	// PredicateTypeByteMatch is a PredicateType enum value
	PredicateTypeByteMatch = "ByteMatch"

	// PredicateTypeSqlInjectionMatch is a PredicateType enum value
	PredicateTypeSqlInjectionMatch = "SqlInjectionMatch"

	// PredicateTypeSizeConstraint is a PredicateType enum value
	PredicateTypeSizeConstraint = "SizeConstraint"

	// PredicateTypeXssMatch is a PredicateType enum value
	PredicateTypeXssMatch = "XssMatch"
)
View Source
const (
	// TextTransformationNone is a TextTransformation enum value
	TextTransformationNone = "NONE"

	// TextTransformationCompressWhiteSpace is a TextTransformation enum value
	TextTransformationCompressWhiteSpace = "COMPRESS_WHITE_SPACE"

	// TextTransformationHtmlEntityDecode is a TextTransformation enum value
	TextTransformationHtmlEntityDecode = "HTML_ENTITY_DECODE"

	// TextTransformationLowercase is a TextTransformation enum value
	TextTransformationLowercase = "LOWERCASE"

	// TextTransformationCmdLine is a TextTransformation enum value
	TextTransformationCmdLine = "CMD_LINE"

	// TextTransformationUrlDecode is a TextTransformation enum value
	TextTransformationUrlDecode = "URL_DECODE"
)
View Source
const (
	// WafActionTypeBlock is a WafActionType enum value
	WafActionTypeBlock = "BLOCK"

	// WafActionTypeAllow is a WafActionType enum value
	WafActionTypeAllow = "ALLOW"

	// WafActionTypeCount is a WafActionType enum value
	WafActionTypeCount = "COUNT"
)
View Source
const ServiceName = "waf-regional"

A ServiceName is the name of the service the client will make API calls to.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociateWebACLInput

type AssociateWebACLInput struct {

	// The ARN (Amazon Resource Name) of the resource to be protected.
	//
	// ResourceArn is a required field
	ResourceArn *string `min:"1" type:"string" required:"true"`

	// A unique identifier (ID) for the web ACL.
	//
	// WebACLId is a required field
	WebACLId *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (AssociateWebACLInput) GoString

func (s AssociateWebACLInput) GoString() string

GoString returns the string representation

func (*AssociateWebACLInput) SetResourceArn

func (s *AssociateWebACLInput) SetResourceArn(v string) *AssociateWebACLInput

SetResourceArn sets the ResourceArn field's value.

func (*AssociateWebACLInput) SetWebACLId

SetWebACLId sets the WebACLId field's value.

func (AssociateWebACLInput) String

func (s AssociateWebACLInput) String() string

String returns the string representation

func (*AssociateWebACLInput) Validate

func (s *AssociateWebACLInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type AssociateWebACLOutput

type AssociateWebACLOutput struct {
	// contains filtered or unexported fields
}

func (AssociateWebACLOutput) GoString

func (s AssociateWebACLOutput) GoString() string

GoString returns the string representation

func (AssociateWebACLOutput) String

func (s AssociateWebACLOutput) String() string

String returns the string representation

type DisassociateWebACLInput

type DisassociateWebACLInput struct {

	// The ARN (Amazon Resource Name) of the resource from which the web ACL is
	// being removed.
	//
	// ResourceArn is a required field
	ResourceArn *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DisassociateWebACLInput) GoString

func (s DisassociateWebACLInput) GoString() string

GoString returns the string representation

func (*DisassociateWebACLInput) SetResourceArn

SetResourceArn sets the ResourceArn field's value.

func (DisassociateWebACLInput) String

func (s DisassociateWebACLInput) String() string

String returns the string representation

func (*DisassociateWebACLInput) Validate

func (s *DisassociateWebACLInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DisassociateWebACLOutput

type DisassociateWebACLOutput struct {
	// contains filtered or unexported fields
}

func (DisassociateWebACLOutput) GoString

func (s DisassociateWebACLOutput) GoString() string

GoString returns the string representation

func (DisassociateWebACLOutput) String

func (s DisassociateWebACLOutput) String() string

String returns the string representation

type GetWebACLForResourceInput

type GetWebACLForResourceInput struct {

	// The ARN (Amazon Resource Name) of the resource for which to get the web ACL.
	//
	// ResourceArn is a required field
	ResourceArn *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (GetWebACLForResourceInput) GoString

func (s GetWebACLForResourceInput) GoString() string

GoString returns the string representation

func (*GetWebACLForResourceInput) SetResourceArn

SetResourceArn sets the ResourceArn field's value.

func (GetWebACLForResourceInput) String

func (s GetWebACLForResourceInput) String() string

String returns the string representation

func (*GetWebACLForResourceInput) Validate

func (s *GetWebACLForResourceInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetWebACLForResourceOutput

type GetWebACLForResourceOutput struct {

	// Information about the web ACL that you specified in the GetWebACLForResource
	// request. If there is no associated resource, a null WebACLSummary is returned.
	WebACLSummary *waf.WebACLSummary `type:"structure"`
	// contains filtered or unexported fields
}

func (GetWebACLForResourceOutput) GoString

func (s GetWebACLForResourceOutput) GoString() string

GoString returns the string representation

func (*GetWebACLForResourceOutput) SetWebACLSummary

SetWebACLSummary sets the WebACLSummary field's value.

func (GetWebACLForResourceOutput) String

String returns the string representation

type ListResourcesForWebACLInput

type ListResourcesForWebACLInput struct {

	// The unique identifier (ID) of the web ACL for which to list the associated
	// resources.
	//
	// WebACLId is a required field
	WebACLId *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (ListResourcesForWebACLInput) GoString

func (s ListResourcesForWebACLInput) GoString() string

GoString returns the string representation

func (*ListResourcesForWebACLInput) SetWebACLId

SetWebACLId sets the WebACLId field's value.

func (ListResourcesForWebACLInput) String

String returns the string representation

func (*ListResourcesForWebACLInput) Validate

func (s *ListResourcesForWebACLInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListResourcesForWebACLOutput

type ListResourcesForWebACLOutput struct {

	// An array of ARNs (Amazon Resource Names) of the resources associated with
	// the specified web ACL. An array with zero elements is returned if there are
	// no resources associated with the web ACL.
	ResourceArns []*string `type:"list"`
	// contains filtered or unexported fields
}

func (ListResourcesForWebACLOutput) GoString

func (s ListResourcesForWebACLOutput) GoString() string

GoString returns the string representation

func (*ListResourcesForWebACLOutput) SetResourceArns

SetResourceArns sets the ResourceArns field's value.

func (ListResourcesForWebACLOutput) String

String returns the string representation

type WAFRegional

type WAFRegional struct {
	*client.Client
}

This is the AWS WAF Regional API Reference for using AWS WAF with Elastic Load Balancing (ELB) Application Load Balancers. The AWS WAF actions and data types listed in the reference are available for protecting Application Load Balancers. You can use these actions and data types by means of the endpoints listed in AWS Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#waf_region). This guide is for developers who need detailed information about the AWS WAF API actions, data types, and errors. For detailed information about AWS WAF features and an overview of how to use the AWS WAF API, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). The service client's operations are safe to be used concurrently. It is not safe to mutate any of the client's properties though.

func New

func New(p client.ConfigProvider, cfgs ...*aws.Config) *WAFRegional

New creates a new instance of the WAFRegional client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.

Example:

// Create a WAFRegional client from just a session.
svc := wafregional.New(mySession)

// Create a WAFRegional client with additional configuration
svc := wafregional.New(mySession, aws.NewConfig().WithRegion("us-west-2"))

func (*WAFRegional) AssociateWebACL

func (c *WAFRegional) AssociateWebACL(input *AssociateWebACLInput) (*AssociateWebACLOutput, error)

AssociateWebACL API operation for AWS WAF Regional.

Associates a web ACL with a resource.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation AssociateWebACL for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFUnavailableEntityException The operation failed because the entity referenced is temporarily unavailable. Retry your request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &wafregional.AssociateWebACLInput{
		ResourceArn: aws.String("ResourceArn"), // Required
		WebACLId:    aws.String("ResourceId"),  // Required
	}
	resp, err := svc.AssociateWebACL(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) AssociateWebACLRequest

func (c *WAFRegional) AssociateWebACLRequest(input *AssociateWebACLInput) (req *request.Request, output *AssociateWebACLOutput)

AssociateWebACLRequest generates a "aws/request.Request" representing the client's request for the AssociateWebACL operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See AssociateWebACL for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the AssociateWebACL method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the AssociateWebACLRequest method.
req, resp := client.AssociateWebACLRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) CreateByteMatchSet

func (c *WAFRegional) CreateByteMatchSet(input *waf.CreateByteMatchSetInput) (*waf.CreateByteMatchSetOutput, error)

CreateByteMatchSet API operation for AWS WAF Regional.

Creates a ByteMatchSet. You then use UpdateByteMatchSet to identify the part of a web request that you want AWS WAF to inspect, such as the values of the User-Agent header or the query string. For example, you can create a ByteMatchSet that matches any requests with User-Agent headers that contain the string BadBot. You can then configure AWS WAF to reject those requests.

To create and configure a ByteMatchSet, perform the following steps:

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

Submit a CreateByteMatchSet request.

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

Submit an UpdateByteMatchSet request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the value 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 (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation CreateByteMatchSet for usage and error information.

Returned Error Codes:

  • WAFDisallowedNameException The name specified is invalid.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.CreateByteMatchSetInput{
		ChangeToken: aws.String("ChangeToken"),  // Required
		Name:        aws.String("ResourceName"), // Required
	}
	resp, err := svc.CreateByteMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) CreateByteMatchSetRequest

func (c *WAFRegional) CreateByteMatchSetRequest(input *waf.CreateByteMatchSetInput) (req *request.Request, output *waf.CreateByteMatchSetOutput)

CreateByteMatchSetRequest generates a "aws/request.Request" representing the client's request for the CreateByteMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See CreateByteMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateByteMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateByteMatchSetRequest method.
req, resp := client.CreateByteMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) CreateIPSet

func (c *WAFRegional) CreateIPSet(input *waf.CreateIPSetInput) (*waf.CreateIPSetOutput, error)

CreateIPSet API operation for AWS WAF Regional.

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:

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

Submit a CreateIPSet request.

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

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 (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation CreateIPSet for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFDisallowedNameException The name specified is invalid.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.CreateIPSetInput{
		ChangeToken: aws.String("ChangeToken"),  // Required
		Name:        aws.String("ResourceName"), // Required
	}
	resp, err := svc.CreateIPSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) CreateIPSetRequest

func (c *WAFRegional) CreateIPSetRequest(input *waf.CreateIPSetInput) (req *request.Request, output *waf.CreateIPSetOutput)

CreateIPSetRequest generates a "aws/request.Request" representing the client's request for the CreateIPSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See CreateIPSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateIPSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateIPSetRequest method.
req, resp := client.CreateIPSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) CreateRule

func (c *WAFRegional) CreateRule(input *waf.CreateRuleInput) (*waf.CreateRuleOutput, error)

CreateRule API operation for AWS WAF Regional.

Creates a Rule, which contains the IPSet objects, ByteMatchSet objects, and other predicates that identify the requests that you want to block. If you add more than one predicate to a Rule, a request must match all of the specifications to be allowed or blocked. For example, suppose you add the following to a Rule:

  • An IPSet that matches the IP address 192.0.2.44/32

  • A ByteMatchSet that matches BadBot in the User-Agent header

You then add the Rule to a WebACL and specify that you want to blocks requests that satisfy the Rule. For a request to be blocked, it must come from the IP address 192.0.2.44 and the User-Agent header in the request must contain the value BadBot.

To create and configure a Rule, perform the following steps:

Create and update the predicates that you want to include in the Rule. For more information, see CreateByteMatchSet, CreateIPSet, and CreateSqlInjectionMatchSet.

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

Submit a CreateRule request.

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

Submit an UpdateRule request to specify the predicates that you want to include in the Rule.

Create and update a WebACL that contains the Rule. For more information, see CreateWebACL.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation CreateRule for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFDisallowedNameException The name specified is invalid.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.CreateRuleInput{
		ChangeToken: aws.String("ChangeToken"),  // Required
		MetricName:  aws.String("MetricName"),   // Required
		Name:        aws.String("ResourceName"), // Required
	}
	resp, err := svc.CreateRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) CreateRuleRequest

func (c *WAFRegional) CreateRuleRequest(input *waf.CreateRuleInput) (req *request.Request, output *waf.CreateRuleOutput)

CreateRuleRequest generates a "aws/request.Request" representing the client's request for the CreateRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See CreateRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateRuleRequest method.
req, resp := client.CreateRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) CreateSizeConstraintSet

func (c *WAFRegional) CreateSizeConstraintSet(input *waf.CreateSizeConstraintSetInput) (*waf.CreateSizeConstraintSetOutput, error)

CreateSizeConstraintSet API operation for AWS WAF Regional.

Creates a SizeConstraintSet. You then use UpdateSizeConstraintSet to identify the part of a web request that you want AWS WAF to check for length, such as the length of the User-Agent header or the length of the query string. For example, you can create a SizeConstraintSet that matches any requests that have a query string that is longer than 100 bytes. You can then configure AWS WAF to reject those requests.

To create and configure a SizeConstraintSet, perform the following steps:

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

Submit a CreateSizeConstraintSet request.

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

Submit an UpdateSizeConstraintSet request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the value 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 (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation CreateSizeConstraintSet for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFDisallowedNameException The name specified is invalid.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.CreateSizeConstraintSetInput{
		ChangeToken: aws.String("ChangeToken"),  // Required
		Name:        aws.String("ResourceName"), // Required
	}
	resp, err := svc.CreateSizeConstraintSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) CreateSizeConstraintSetRequest

func (c *WAFRegional) CreateSizeConstraintSetRequest(input *waf.CreateSizeConstraintSetInput) (req *request.Request, output *waf.CreateSizeConstraintSetOutput)

CreateSizeConstraintSetRequest generates a "aws/request.Request" representing the client's request for the CreateSizeConstraintSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See CreateSizeConstraintSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateSizeConstraintSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateSizeConstraintSetRequest method.
req, resp := client.CreateSizeConstraintSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) CreateSqlInjectionMatchSet

CreateSqlInjectionMatchSet API operation for AWS WAF Regional.

Creates a SqlInjectionMatchSet, which you use to allow, block, or count requests that contain snippets of SQL code in a specified part of web requests. AWS WAF searches for character sequences that are likely to be malicious strings.

To create and configure a SqlInjectionMatchSet, perform the following steps:

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

Submit a CreateSqlInjectionMatchSet request.

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

Submit an UpdateSqlInjectionMatchSet request to specify the parts of web requests in which you want to allow, block, or count malicious SQL code.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation CreateSqlInjectionMatchSet for usage and error information.

Returned Error Codes:

  • WAFDisallowedNameException The name specified is invalid.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.CreateSqlInjectionMatchSetInput{
		ChangeToken: aws.String("ChangeToken"),  // Required
		Name:        aws.String("ResourceName"), // Required
	}
	resp, err := svc.CreateSqlInjectionMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) CreateSqlInjectionMatchSetRequest

func (c *WAFRegional) CreateSqlInjectionMatchSetRequest(input *waf.CreateSqlInjectionMatchSetInput) (req *request.Request, output *waf.CreateSqlInjectionMatchSetOutput)

CreateSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the client's request for the CreateSqlInjectionMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See CreateSqlInjectionMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateSqlInjectionMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateSqlInjectionMatchSetRequest method.
req, resp := client.CreateSqlInjectionMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) CreateWebACL

func (c *WAFRegional) CreateWebACL(input *waf.CreateWebACLInput) (*waf.CreateWebACLOutput, error)

CreateWebACL API operation for AWS WAF Regional.

Creates a WebACL, which contains the Rules that identify the CloudFront web requests that you want to allow, block, or count. AWS WAF evaluates Rules in order based on the value of Priority for each Rule.

You also specify a default action, either ALLOW or BLOCK. If a web request doesn't match any of the Rules in a WebACL, AWS WAF responds to the request with the default action.

To create and configure a WebACL, perform the following steps:

Create and update the ByteMatchSet objects and other predicates that you want to include in Rules. For more information, see CreateByteMatchSet, UpdateByteMatchSet, CreateIPSet, UpdateIPSet, CreateSqlInjectionMatchSet, and UpdateSqlInjectionMatchSet.

Create and update the Rules that you want to include in the WebACL. For more information, see CreateRule and UpdateRule.

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

Submit a CreateWebACL request.

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

Submit an UpdateWebACL request to specify the Rules that you want to include in the WebACL, to specify the default action, and to associate the WebACL with a CloudFront distribution.

For more information about how to use the AWS WAF API, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation CreateWebACL for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFDisallowedNameException The name specified is invalid.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.CreateWebACLInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		DefaultAction: &waf.WafAction{ // Required
			Type: aws.String("WafActionType"), // Required
		},
		MetricName: aws.String("MetricName"),   // Required
		Name:       aws.String("ResourceName"), // Required
	}
	resp, err := svc.CreateWebACL(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) CreateWebACLRequest

func (c *WAFRegional) CreateWebACLRequest(input *waf.CreateWebACLInput) (req *request.Request, output *waf.CreateWebACLOutput)

CreateWebACLRequest generates a "aws/request.Request" representing the client's request for the CreateWebACL operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See CreateWebACL for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateWebACL method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateWebACLRequest method.
req, resp := client.CreateWebACLRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) CreateXssMatchSet

func (c *WAFRegional) CreateXssMatchSet(input *waf.CreateXssMatchSetInput) (*waf.CreateXssMatchSetOutput, error)

CreateXssMatchSet API operation for AWS WAF Regional.

Creates an XssMatchSet, which you use to allow, block, or count requests that contain cross-site scripting attacks in the specified part of web requests. AWS WAF searches for character sequences that are likely to be malicious strings.

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

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

Submit a CreateXssMatchSet request.

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

Submit an UpdateXssMatchSet request to specify the parts of web requests in which you want to allow, block, or count cross-site scripting attacks.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation CreateXssMatchSet for usage and error information.

Returned Error Codes:

  • WAFDisallowedNameException The name specified is invalid.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.CreateXssMatchSetInput{
		ChangeToken: aws.String("ChangeToken"),  // Required
		Name:        aws.String("ResourceName"), // Required
	}
	resp, err := svc.CreateXssMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) CreateXssMatchSetRequest

func (c *WAFRegional) CreateXssMatchSetRequest(input *waf.CreateXssMatchSetInput) (req *request.Request, output *waf.CreateXssMatchSetOutput)

CreateXssMatchSetRequest generates a "aws/request.Request" representing the client's request for the CreateXssMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See CreateXssMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateXssMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateXssMatchSetRequest method.
req, resp := client.CreateXssMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DeleteByteMatchSet

func (c *WAFRegional) DeleteByteMatchSet(input *waf.DeleteByteMatchSetInput) (*waf.DeleteByteMatchSetOutput, error)

DeleteByteMatchSet API operation for AWS WAF Regional.

Permanently deletes a ByteMatchSet. You can't delete a ByteMatchSet if it's still used in any Rules or if it still includes any ByteMatchTuple objects (any filters).

If you just want to remove a ByteMatchSet from a Rule, use UpdateRule.

To permanently delete a ByteMatchSet, perform the following steps:

Update the ByteMatchSet to remove filters, if any. For more information, see UpdateByteMatchSet.

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

Submit a DeleteByteMatchSet request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DeleteByteMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFNonEmptyEntityException The operation failed because you tried to delete an object that isn't empty. For example:

  • You tried to delete a WebACL that still contains one or more Rule objects.

  • You tried to delete a Rule that still contains one or more ByteMatchSet objects or other predicates.

  • You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple objects.

  • You tried to delete an IPSet that references one or more IP addresses.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.DeleteByteMatchSetInput{
		ByteMatchSetId: aws.String("ResourceId"),  // Required
		ChangeToken:    aws.String("ChangeToken"), // Required
	}
	resp, err := svc.DeleteByteMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DeleteByteMatchSetRequest

func (c *WAFRegional) DeleteByteMatchSetRequest(input *waf.DeleteByteMatchSetInput) (req *request.Request, output *waf.DeleteByteMatchSetOutput)

DeleteByteMatchSetRequest generates a "aws/request.Request" representing the client's request for the DeleteByteMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteByteMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteByteMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteByteMatchSetRequest method.
req, resp := client.DeleteByteMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DeleteIPSet

func (c *WAFRegional) DeleteIPSet(input *waf.DeleteIPSetInput) (*waf.DeleteIPSetOutput, error)

DeleteIPSet API operation for AWS WAF Regional.

Permanently deletes an IPSet. You can't delete an IPSet if it's still used in any Rules or if it still includes any IP addresses.

If you just want to remove an IPSet from a Rule, use UpdateRule.

To permanently delete an IPSet from AWS WAF, perform the following steps:

Update the IPSet to remove IP address ranges, if any. For more information, see UpdateIPSet.

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

Submit a DeleteIPSet request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DeleteIPSet for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFNonEmptyEntityException The operation failed because you tried to delete an object that isn't empty. For example:

  • You tried to delete a WebACL that still contains one or more Rule objects.

  • You tried to delete a Rule that still contains one or more ByteMatchSet objects or other predicates.

  • You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple objects.

  • You tried to delete an IPSet that references one or more IP addresses.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.DeleteIPSetInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		IPSetId:     aws.String("ResourceId"),  // Required
	}
	resp, err := svc.DeleteIPSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DeleteIPSetRequest

func (c *WAFRegional) DeleteIPSetRequest(input *waf.DeleteIPSetInput) (req *request.Request, output *waf.DeleteIPSetOutput)

DeleteIPSetRequest generates a "aws/request.Request" representing the client's request for the DeleteIPSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteIPSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteIPSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteIPSetRequest method.
req, resp := client.DeleteIPSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DeleteRule

func (c *WAFRegional) DeleteRule(input *waf.DeleteRuleInput) (*waf.DeleteRuleOutput, error)

DeleteRule API operation for AWS WAF Regional.

Permanently deletes a Rule. You can't delete a Rule if it's still used in any WebACL objects or if it still includes any predicates, such as ByteMatchSet objects.

If you just want to remove a Rule from a WebACL, use UpdateWebACL.

To permanently delete a Rule from AWS WAF, perform the following steps:

Update the Rule to remove predicates, if any. For more information, see UpdateRule.

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

Submit a DeleteRule request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DeleteRule for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFNonEmptyEntityException The operation failed because you tried to delete an object that isn't empty. For example:

  • You tried to delete a WebACL that still contains one or more Rule objects.

  • You tried to delete a Rule that still contains one or more ByteMatchSet objects or other predicates.

  • You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple objects.

  • You tried to delete an IPSet that references one or more IP addresses.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.DeleteRuleInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		RuleId:      aws.String("ResourceId"),  // Required
	}
	resp, err := svc.DeleteRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DeleteRuleRequest

func (c *WAFRegional) DeleteRuleRequest(input *waf.DeleteRuleInput) (req *request.Request, output *waf.DeleteRuleOutput)

DeleteRuleRequest generates a "aws/request.Request" representing the client's request for the DeleteRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteRuleRequest method.
req, resp := client.DeleteRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DeleteSizeConstraintSet

func (c *WAFRegional) DeleteSizeConstraintSet(input *waf.DeleteSizeConstraintSetInput) (*waf.DeleteSizeConstraintSetOutput, error)

DeleteSizeConstraintSet API operation for AWS WAF Regional.

Permanently deletes a SizeConstraintSet. You can't delete a SizeConstraintSet if it's still used in any Rules or if it still includes any SizeConstraint objects (any filters).

If you just want to remove a SizeConstraintSet from a Rule, use UpdateRule.

To permanently delete a SizeConstraintSet, perform the following steps:

Update the SizeConstraintSet to remove filters, if any. For more information, see UpdateSizeConstraintSet.

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

Submit a DeleteSizeConstraintSet request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DeleteSizeConstraintSet for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFNonEmptyEntityException The operation failed because you tried to delete an object that isn't empty. For example:

  • You tried to delete a WebACL that still contains one or more Rule objects.

  • You tried to delete a Rule that still contains one or more ByteMatchSet objects or other predicates.

  • You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple objects.

  • You tried to delete an IPSet that references one or more IP addresses.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.DeleteSizeConstraintSetInput{
		ChangeToken:         aws.String("ChangeToken"), // Required
		SizeConstraintSetId: aws.String("ResourceId"),  // Required
	}
	resp, err := svc.DeleteSizeConstraintSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DeleteSizeConstraintSetRequest

func (c *WAFRegional) DeleteSizeConstraintSetRequest(input *waf.DeleteSizeConstraintSetInput) (req *request.Request, output *waf.DeleteSizeConstraintSetOutput)

DeleteSizeConstraintSetRequest generates a "aws/request.Request" representing the client's request for the DeleteSizeConstraintSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteSizeConstraintSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteSizeConstraintSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteSizeConstraintSetRequest method.
req, resp := client.DeleteSizeConstraintSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DeleteSqlInjectionMatchSet

DeleteSqlInjectionMatchSet API operation for AWS WAF Regional.

Permanently deletes a SqlInjectionMatchSet. You can't delete a SqlInjectionMatchSet if it's still used in any Rules or if it still contains any SqlInjectionMatchTuple objects.

If you just want to remove a SqlInjectionMatchSet from a Rule, use UpdateRule.

To permanently delete a SqlInjectionMatchSet from AWS WAF, perform the following steps:

Update the SqlInjectionMatchSet to remove filters, if any. For more information, see UpdateSqlInjectionMatchSet.

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

Submit a DeleteSqlInjectionMatchSet request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DeleteSqlInjectionMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFNonEmptyEntityException The operation failed because you tried to delete an object that isn't empty. For example:

  • You tried to delete a WebACL that still contains one or more Rule objects.

  • You tried to delete a Rule that still contains one or more ByteMatchSet objects or other predicates.

  • You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple objects.

  • You tried to delete an IPSet that references one or more IP addresses.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.DeleteSqlInjectionMatchSetInput{
		ChangeToken:            aws.String("ChangeToken"), // Required
		SqlInjectionMatchSetId: aws.String("ResourceId"),  // Required
	}
	resp, err := svc.DeleteSqlInjectionMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DeleteSqlInjectionMatchSetRequest

func (c *WAFRegional) DeleteSqlInjectionMatchSetRequest(input *waf.DeleteSqlInjectionMatchSetInput) (req *request.Request, output *waf.DeleteSqlInjectionMatchSetOutput)

DeleteSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the client's request for the DeleteSqlInjectionMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteSqlInjectionMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteSqlInjectionMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteSqlInjectionMatchSetRequest method.
req, resp := client.DeleteSqlInjectionMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DeleteWebACL

func (c *WAFRegional) DeleteWebACL(input *waf.DeleteWebACLInput) (*waf.DeleteWebACLOutput, error)

DeleteWebACL API operation for AWS WAF Regional.

Permanently deletes a WebACL. You can't delete a WebACL if it still contains any Rules.

To delete a WebACL, perform the following steps:

Update the WebACL to remove Rules, if any. For more information, see UpdateWebACL.

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

Submit a DeleteWebACL request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DeleteWebACL for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFNonEmptyEntityException The operation failed because you tried to delete an object that isn't empty. For example:

  • You tried to delete a WebACL that still contains one or more Rule objects.

  • You tried to delete a Rule that still contains one or more ByteMatchSet objects or other predicates.

  • You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple objects.

  • You tried to delete an IPSet that references one or more IP addresses.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.DeleteWebACLInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		WebACLId:    aws.String("ResourceId"),  // Required
	}
	resp, err := svc.DeleteWebACL(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DeleteWebACLRequest

func (c *WAFRegional) DeleteWebACLRequest(input *waf.DeleteWebACLInput) (req *request.Request, output *waf.DeleteWebACLOutput)

DeleteWebACLRequest generates a "aws/request.Request" representing the client's request for the DeleteWebACL operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteWebACL for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteWebACL method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteWebACLRequest method.
req, resp := client.DeleteWebACLRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DeleteXssMatchSet

func (c *WAFRegional) DeleteXssMatchSet(input *waf.DeleteXssMatchSetInput) (*waf.DeleteXssMatchSetOutput, error)

DeleteXssMatchSet API operation for AWS WAF Regional.

Permanently deletes an XssMatchSet. You can't delete an XssMatchSet if it's still used in any Rules or if it still contains any XssMatchTuple objects.

If you just want to remove an XssMatchSet from a Rule, use UpdateRule.

To permanently delete an XssMatchSet from AWS WAF, perform the following steps:

Update the XssMatchSet to remove filters, if any. For more information, see UpdateXssMatchSet.

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

Submit a DeleteXssMatchSet request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DeleteXssMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFNonEmptyEntityException The operation failed because you tried to delete an object that isn't empty. For example:

  • You tried to delete a WebACL that still contains one or more Rule objects.

  • You tried to delete a Rule that still contains one or more ByteMatchSet objects or other predicates.

  • You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple objects.

  • You tried to delete an IPSet that references one or more IP addresses.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.DeleteXssMatchSetInput{
		ChangeToken:   aws.String("ChangeToken"), // Required
		XssMatchSetId: aws.String("ResourceId"),  // Required
	}
	resp, err := svc.DeleteXssMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DeleteXssMatchSetRequest

func (c *WAFRegional) DeleteXssMatchSetRequest(input *waf.DeleteXssMatchSetInput) (req *request.Request, output *waf.DeleteXssMatchSetOutput)

DeleteXssMatchSetRequest generates a "aws/request.Request" representing the client's request for the DeleteXssMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteXssMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteXssMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteXssMatchSetRequest method.
req, resp := client.DeleteXssMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) DisassociateWebACL

func (c *WAFRegional) DisassociateWebACL(input *DisassociateWebACLInput) (*DisassociateWebACLOutput, error)

DisassociateWebACL API operation for AWS WAF Regional.

Removes a web ACL from the specified resource.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation DisassociateWebACL for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &wafregional.DisassociateWebACLInput{
		ResourceArn: aws.String("ResourceArn"), // Required
	}
	resp, err := svc.DisassociateWebACL(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) DisassociateWebACLRequest

func (c *WAFRegional) DisassociateWebACLRequest(input *DisassociateWebACLInput) (req *request.Request, output *DisassociateWebACLOutput)

DisassociateWebACLRequest generates a "aws/request.Request" representing the client's request for the DisassociateWebACL operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DisassociateWebACL for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DisassociateWebACL method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DisassociateWebACLRequest method.
req, resp := client.DisassociateWebACLRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetByteMatchSet

func (c *WAFRegional) GetByteMatchSet(input *waf.GetByteMatchSetInput) (*waf.GetByteMatchSetOutput, error)

GetByteMatchSet API operation for AWS WAF Regional.

Returns the ByteMatchSet specified by ByteMatchSetId.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetByteMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetByteMatchSetInput{
		ByteMatchSetId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetByteMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetByteMatchSetRequest

func (c *WAFRegional) GetByteMatchSetRequest(input *waf.GetByteMatchSetInput) (req *request.Request, output *waf.GetByteMatchSetOutput)

GetByteMatchSetRequest generates a "aws/request.Request" representing the client's request for the GetByteMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetByteMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetByteMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetByteMatchSetRequest method.
req, resp := client.GetByteMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetChangeToken

func (c *WAFRegional) GetChangeToken(input *waf.GetChangeTokenInput) (*waf.GetChangeTokenOutput, error)

GetChangeToken API operation for AWS WAF Regional.

When you want to create, update, or delete AWS WAF objects, get a change token and include the change token in the create, update, or delete request. Change tokens ensure that your application doesn't submit conflicting requests to AWS WAF.

Each create, update, or delete request must use a unique change token. If your application submits a GetChangeToken request and then submits a second GetChangeToken request before submitting a create, update, or delete request, the second GetChangeToken request returns the same value as the first GetChangeToken request.

When you use a change token in a create, update, or delete request, the status of the change token changes to PENDING, which indicates that AWS WAF is propagating the change to all AWS WAF servers. Use GetChangeTokenStatus to determine the status of your change token.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetChangeToken for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.
Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	var params *waf.GetChangeTokenInput
	resp, err := svc.GetChangeToken(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetChangeTokenRequest

func (c *WAFRegional) GetChangeTokenRequest(input *waf.GetChangeTokenInput) (req *request.Request, output *waf.GetChangeTokenOutput)

GetChangeTokenRequest generates a "aws/request.Request" representing the client's request for the GetChangeToken operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetChangeToken for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetChangeToken method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetChangeTokenRequest method.
req, resp := client.GetChangeTokenRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetChangeTokenStatus

func (c *WAFRegional) GetChangeTokenStatus(input *waf.GetChangeTokenStatusInput) (*waf.GetChangeTokenStatusOutput, error)

GetChangeTokenStatus API operation for AWS WAF Regional.

Returns the status of a ChangeToken that you got by calling GetChangeToken. ChangeTokenStatus is one of the following values:

  • PROVISIONED: You requested the change token by calling GetChangeToken, but you haven't used it yet in a call to create, update, or delete an AWS WAF object.

  • PENDING: AWS WAF is propagating the create, update, or delete request to all AWS WAF servers.

  • IN_SYNC: Propagation is complete.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetChangeTokenStatus for usage and error information.

Returned Error Codes:

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetChangeTokenStatusInput{
		ChangeToken: aws.String("ChangeToken"), // Required
	}
	resp, err := svc.GetChangeTokenStatus(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetChangeTokenStatusRequest

func (c *WAFRegional) GetChangeTokenStatusRequest(input *waf.GetChangeTokenStatusInput) (req *request.Request, output *waf.GetChangeTokenStatusOutput)

GetChangeTokenStatusRequest generates a "aws/request.Request" representing the client's request for the GetChangeTokenStatus operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetChangeTokenStatus for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetChangeTokenStatus method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetChangeTokenStatusRequest method.
req, resp := client.GetChangeTokenStatusRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetIPSet

func (c *WAFRegional) GetIPSet(input *waf.GetIPSetInput) (*waf.GetIPSetOutput, error)

GetIPSet API operation for AWS WAF Regional.

Returns the IPSet that is specified by IPSetId.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetIPSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetIPSetInput{
		IPSetId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetIPSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetIPSetRequest

func (c *WAFRegional) GetIPSetRequest(input *waf.GetIPSetInput) (req *request.Request, output *waf.GetIPSetOutput)

GetIPSetRequest generates a "aws/request.Request" representing the client's request for the GetIPSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetIPSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetIPSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetIPSetRequest method.
req, resp := client.GetIPSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetRule

func (c *WAFRegional) GetRule(input *waf.GetRuleInput) (*waf.GetRuleOutput, error)

GetRule API operation for AWS WAF Regional.

Returns the Rule that is specified by the RuleId that you included in the GetRule request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetRule for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetRuleInput{
		RuleId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetRuleRequest

func (c *WAFRegional) GetRuleRequest(input *waf.GetRuleInput) (req *request.Request, output *waf.GetRuleOutput)

GetRuleRequest generates a "aws/request.Request" representing the client's request for the GetRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetRuleRequest method.
req, resp := client.GetRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetSampledRequests

func (c *WAFRegional) GetSampledRequests(input *waf.GetSampledRequestsInput) (*waf.GetSampledRequestsOutput, error)

GetSampledRequests API operation for AWS WAF Regional.

Gets detailed information about a specified number of requests--a sample--that AWS WAF randomly selects from among the first 5,000 requests that your AWS resource received during a time range that you choose. You can specify a sample size of up to 100 requests, and you can specify any time range in the previous three hours.

GetSampledRequests returns a time range, which is usually the time range that you specified. However, if your resource (such as a CloudFront distribution) received 5,000 requests before the specified time range elapsed, GetSampledRequests returns an updated time range. This new time range indicates the actual period during which AWS WAF selected the requests in the sample.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetSampledRequests for usage and error information.

Returned Error Codes:

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

Example
package main

import (
	"fmt"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetSampledRequestsInput{
		MaxItems: aws.Int64(1),             // Required
		RuleId:   aws.String("ResourceId"), // Required
		TimeWindow: &waf.TimeWindow{ // Required
			EndTime:   aws.Time(time.Now()), // Required
			StartTime: aws.Time(time.Now()), // Required
		},
		WebAclId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetSampledRequests(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetSampledRequestsRequest

func (c *WAFRegional) GetSampledRequestsRequest(input *waf.GetSampledRequestsInput) (req *request.Request, output *waf.GetSampledRequestsOutput)

GetSampledRequestsRequest generates a "aws/request.Request" representing the client's request for the GetSampledRequests operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetSampledRequests for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetSampledRequests method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetSampledRequestsRequest method.
req, resp := client.GetSampledRequestsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetSizeConstraintSet

func (c *WAFRegional) GetSizeConstraintSet(input *waf.GetSizeConstraintSetInput) (*waf.GetSizeConstraintSetOutput, error)

GetSizeConstraintSet API operation for AWS WAF Regional.

Returns the SizeConstraintSet specified by SizeConstraintSetId.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetSizeConstraintSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetSizeConstraintSetInput{
		SizeConstraintSetId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetSizeConstraintSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetSizeConstraintSetRequest

func (c *WAFRegional) GetSizeConstraintSetRequest(input *waf.GetSizeConstraintSetInput) (req *request.Request, output *waf.GetSizeConstraintSetOutput)

GetSizeConstraintSetRequest generates a "aws/request.Request" representing the client's request for the GetSizeConstraintSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetSizeConstraintSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetSizeConstraintSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetSizeConstraintSetRequest method.
req, resp := client.GetSizeConstraintSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetSqlInjectionMatchSet

func (c *WAFRegional) GetSqlInjectionMatchSet(input *waf.GetSqlInjectionMatchSetInput) (*waf.GetSqlInjectionMatchSetOutput, error)

GetSqlInjectionMatchSet API operation for AWS WAF Regional.

Returns the SqlInjectionMatchSet that is specified by SqlInjectionMatchSetId.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetSqlInjectionMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetSqlInjectionMatchSetInput{
		SqlInjectionMatchSetId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetSqlInjectionMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetSqlInjectionMatchSetRequest

func (c *WAFRegional) GetSqlInjectionMatchSetRequest(input *waf.GetSqlInjectionMatchSetInput) (req *request.Request, output *waf.GetSqlInjectionMatchSetOutput)

GetSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the client's request for the GetSqlInjectionMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetSqlInjectionMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetSqlInjectionMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetSqlInjectionMatchSetRequest method.
req, resp := client.GetSqlInjectionMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetWebACL

func (c *WAFRegional) GetWebACL(input *waf.GetWebACLInput) (*waf.GetWebACLOutput, error)

GetWebACL API operation for AWS WAF Regional.

Returns the WebACL that is specified by WebACLId.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetWebACL for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetWebACLInput{
		WebACLId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetWebACL(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetWebACLForResource

func (c *WAFRegional) GetWebACLForResource(input *GetWebACLForResourceInput) (*GetWebACLForResourceOutput, error)

GetWebACLForResource API operation for AWS WAF Regional.

Returns the web ACL for the specified resource.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetWebACLForResource for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFUnavailableEntityException The operation failed because the entity referenced is temporarily unavailable. Retry your request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &wafregional.GetWebACLForResourceInput{
		ResourceArn: aws.String("ResourceArn"), // Required
	}
	resp, err := svc.GetWebACLForResource(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetWebACLForResourceRequest

func (c *WAFRegional) GetWebACLForResourceRequest(input *GetWebACLForResourceInput) (req *request.Request, output *GetWebACLForResourceOutput)

GetWebACLForResourceRequest generates a "aws/request.Request" representing the client's request for the GetWebACLForResource operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetWebACLForResource for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetWebACLForResource method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetWebACLForResourceRequest method.
req, resp := client.GetWebACLForResourceRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetWebACLRequest

func (c *WAFRegional) GetWebACLRequest(input *waf.GetWebACLInput) (req *request.Request, output *waf.GetWebACLOutput)

GetWebACLRequest generates a "aws/request.Request" representing the client's request for the GetWebACL operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetWebACL for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetWebACL method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetWebACLRequest method.
req, resp := client.GetWebACLRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) GetXssMatchSet

func (c *WAFRegional) GetXssMatchSet(input *waf.GetXssMatchSetInput) (*waf.GetXssMatchSetOutput, error)

GetXssMatchSet API operation for AWS WAF Regional.

Returns the XssMatchSet that is specified by XssMatchSetId.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation GetXssMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.GetXssMatchSetInput{
		XssMatchSetId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.GetXssMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) GetXssMatchSetRequest

func (c *WAFRegional) GetXssMatchSetRequest(input *waf.GetXssMatchSetInput) (req *request.Request, output *waf.GetXssMatchSetOutput)

GetXssMatchSetRequest generates a "aws/request.Request" representing the client's request for the GetXssMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See GetXssMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetXssMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetXssMatchSetRequest method.
req, resp := client.GetXssMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListByteMatchSets

func (c *WAFRegional) ListByteMatchSets(input *waf.ListByteMatchSetsInput) (*waf.ListByteMatchSetsOutput, error)

ListByteMatchSets API operation for AWS WAF Regional.

Returns an array of ByteMatchSetSummary objects.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListByteMatchSets for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.ListByteMatchSetsInput{
		Limit:      aws.Int64(1),
		NextMarker: aws.String("NextMarker"),
	}
	resp, err := svc.ListByteMatchSets(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListByteMatchSetsRequest

func (c *WAFRegional) ListByteMatchSetsRequest(input *waf.ListByteMatchSetsInput) (req *request.Request, output *waf.ListByteMatchSetsOutput)

ListByteMatchSetsRequest generates a "aws/request.Request" representing the client's request for the ListByteMatchSets operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListByteMatchSets for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListByteMatchSets method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListByteMatchSetsRequest method.
req, resp := client.ListByteMatchSetsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListIPSets

func (c *WAFRegional) ListIPSets(input *waf.ListIPSetsInput) (*waf.ListIPSetsOutput, error)

ListIPSets API operation for AWS WAF Regional.

Returns an array of IPSetSummary objects in the response.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListIPSets for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.ListIPSetsInput{
		Limit:      aws.Int64(1),
		NextMarker: aws.String("NextMarker"),
	}
	resp, err := svc.ListIPSets(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListIPSetsRequest

func (c *WAFRegional) ListIPSetsRequest(input *waf.ListIPSetsInput) (req *request.Request, output *waf.ListIPSetsOutput)

ListIPSetsRequest generates a "aws/request.Request" representing the client's request for the ListIPSets operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListIPSets for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListIPSets method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListIPSetsRequest method.
req, resp := client.ListIPSetsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListResourcesForWebACL

func (c *WAFRegional) ListResourcesForWebACL(input *ListResourcesForWebACLInput) (*ListResourcesForWebACLOutput, error)

ListResourcesForWebACL API operation for AWS WAF Regional.

Returns an array of resources associated with the specified web ACL.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListResourcesForWebACL for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &wafregional.ListResourcesForWebACLInput{
		WebACLId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.ListResourcesForWebACL(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListResourcesForWebACLRequest

func (c *WAFRegional) ListResourcesForWebACLRequest(input *ListResourcesForWebACLInput) (req *request.Request, output *ListResourcesForWebACLOutput)

ListResourcesForWebACLRequest generates a "aws/request.Request" representing the client's request for the ListResourcesForWebACL operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListResourcesForWebACL for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListResourcesForWebACL method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListResourcesForWebACLRequest method.
req, resp := client.ListResourcesForWebACLRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListRules

func (c *WAFRegional) ListRules(input *waf.ListRulesInput) (*waf.ListRulesOutput, error)

ListRules API operation for AWS WAF Regional.

Returns an array of RuleSummary objects.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListRules for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.ListRulesInput{
		Limit:      aws.Int64(1),
		NextMarker: aws.String("NextMarker"),
	}
	resp, err := svc.ListRules(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListRulesRequest

func (c *WAFRegional) ListRulesRequest(input *waf.ListRulesInput) (req *request.Request, output *waf.ListRulesOutput)

ListRulesRequest generates a "aws/request.Request" representing the client's request for the ListRules operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListRules for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListRules method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListRulesRequest method.
req, resp := client.ListRulesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListSizeConstraintSets

func (c *WAFRegional) ListSizeConstraintSets(input *waf.ListSizeConstraintSetsInput) (*waf.ListSizeConstraintSetsOutput, error)

ListSizeConstraintSets API operation for AWS WAF Regional.

Returns an array of SizeConstraintSetSummary objects.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListSizeConstraintSets for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.ListSizeConstraintSetsInput{
		Limit:      aws.Int64(1),
		NextMarker: aws.String("NextMarker"),
	}
	resp, err := svc.ListSizeConstraintSets(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListSizeConstraintSetsRequest

func (c *WAFRegional) ListSizeConstraintSetsRequest(input *waf.ListSizeConstraintSetsInput) (req *request.Request, output *waf.ListSizeConstraintSetsOutput)

ListSizeConstraintSetsRequest generates a "aws/request.Request" representing the client's request for the ListSizeConstraintSets operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListSizeConstraintSets for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListSizeConstraintSets method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListSizeConstraintSetsRequest method.
req, resp := client.ListSizeConstraintSetsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListSqlInjectionMatchSets

ListSqlInjectionMatchSets API operation for AWS WAF Regional.

Returns an array of SqlInjectionMatchSet objects.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListSqlInjectionMatchSets for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.ListSqlInjectionMatchSetsInput{
		Limit:      aws.Int64(1),
		NextMarker: aws.String("NextMarker"),
	}
	resp, err := svc.ListSqlInjectionMatchSets(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListSqlInjectionMatchSetsRequest

func (c *WAFRegional) ListSqlInjectionMatchSetsRequest(input *waf.ListSqlInjectionMatchSetsInput) (req *request.Request, output *waf.ListSqlInjectionMatchSetsOutput)

ListSqlInjectionMatchSetsRequest generates a "aws/request.Request" representing the client's request for the ListSqlInjectionMatchSets operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListSqlInjectionMatchSets for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListSqlInjectionMatchSets method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListSqlInjectionMatchSetsRequest method.
req, resp := client.ListSqlInjectionMatchSetsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListWebACLs

func (c *WAFRegional) ListWebACLs(input *waf.ListWebACLsInput) (*waf.ListWebACLsOutput, error)

ListWebACLs API operation for AWS WAF Regional.

Returns an array of WebACLSummary objects in the response.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListWebACLs for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.ListWebACLsInput{
		Limit:      aws.Int64(1),
		NextMarker: aws.String("NextMarker"),
	}
	resp, err := svc.ListWebACLs(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListWebACLsRequest

func (c *WAFRegional) ListWebACLsRequest(input *waf.ListWebACLsInput) (req *request.Request, output *waf.ListWebACLsOutput)

ListWebACLsRequest generates a "aws/request.Request" representing the client's request for the ListWebACLs operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListWebACLs for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListWebACLs method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListWebACLsRequest method.
req, resp := client.ListWebACLsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) ListXssMatchSets

func (c *WAFRegional) ListXssMatchSets(input *waf.ListXssMatchSetsInput) (*waf.ListXssMatchSetsOutput, error)

ListXssMatchSets API operation for AWS WAF Regional.

Returns an array of XssMatchSet objects.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation ListXssMatchSets for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.ListXssMatchSetsInput{
		Limit:      aws.Int64(1),
		NextMarker: aws.String("NextMarker"),
	}
	resp, err := svc.ListXssMatchSets(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) ListXssMatchSetsRequest

func (c *WAFRegional) ListXssMatchSetsRequest(input *waf.ListXssMatchSetsInput) (req *request.Request, output *waf.ListXssMatchSetsOutput)

ListXssMatchSetsRequest generates a "aws/request.Request" representing the client's request for the ListXssMatchSets operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListXssMatchSets for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListXssMatchSets method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListXssMatchSetsRequest method.
req, resp := client.ListXssMatchSetsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) UpdateByteMatchSet

func (c *WAFRegional) UpdateByteMatchSet(input *waf.UpdateByteMatchSetInput) (*waf.UpdateByteMatchSetOutput, error)

UpdateByteMatchSet API operation for AWS WAF Regional.

Inserts or deletes ByteMatchTuple objects (filters) in a ByteMatchSet. For each ByteMatchTuple object, you specify the following values:

  • Whether to insert or delete the object from the array. If you want to change a ByteMatchSetUpdate object, you delete the existing object and add a new one.

  • The part of a web request that you want AWS WAF to inspect, such as a query string or the value of the User-Agent header.

  • The bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to look for. For more information, including how you specify the values for the AWS WAF API and the AWS CLI or SDKs, see TargetString in the ByteMatchTuple data type.

  • Where to look, such as at the beginning or the end of a query string.

  • Whether to perform any conversions on the request, such as converting it to lowercase, before inspecting it for the specified string.

For example, you can add a ByteMatchSetUpdate object that matches web requests in which User-Agent headers contain the string BadBot. You can then configure AWS WAF to block those requests.

To create and configure a ByteMatchSet, perform the following steps:

Create a ByteMatchSet. For more information, see CreateByteMatchSet.

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

Submit an UpdateByteMatchSet request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the value 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 (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation UpdateByteMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidOperationException The operation failed because there was nothing to do. For example:

  • You tried to remove a Rule from a WebACL, but the Rule isn't in the specified WebACL.

  • You tried to remove an IP address from an IPSet, but the IP address isn't in the specified IPSet.

  • You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple isn't in the specified WebACL.

  • You tried to add a Rule to a WebACL, but the Rule already exists in the specified WebACL.

  • You tried to add an IP address to an IPSet, but the IP address already exists in the specified IPSet.

  • You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple already exists in the specified WebACL.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentContainerException The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

  • You tried to add a Rule to or delete a Rule from a WebACL that doesn't exist.

  • You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that doesn't exist.

  • You tried to add an IP address to or delete an IP address from an IPSet that doesn't exist.

  • You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a ByteMatchSet that doesn't exist.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.UpdateByteMatchSetInput{
		ByteMatchSetId: aws.String("ResourceId"),  // Required
		ChangeToken:    aws.String("ChangeToken"), // Required
		Updates: []*waf.ByteMatchSetUpdate{ // Required
			{ // Required
				Action: aws.String("ChangeAction"), // Required
				ByteMatchTuple: &waf.ByteMatchTuple{ // Required
					FieldToMatch: &waf.FieldToMatch{ // Required
						Type: aws.String("MatchFieldType"), // Required
						Data: aws.String("MatchFieldData"),
					},
					PositionalConstraint: aws.String("PositionalConstraint"), // Required
					TargetString:         []byte("PAYLOAD"),                  // Required
					TextTransformation:   aws.String("TextTransformation"),   // Required
				},
			},
			// More values...
		},
	}
	resp, err := svc.UpdateByteMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) UpdateByteMatchSetRequest

func (c *WAFRegional) UpdateByteMatchSetRequest(input *waf.UpdateByteMatchSetInput) (req *request.Request, output *waf.UpdateByteMatchSetOutput)

UpdateByteMatchSetRequest generates a "aws/request.Request" representing the client's request for the UpdateByteMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See UpdateByteMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateByteMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateByteMatchSetRequest method.
req, resp := client.UpdateByteMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) UpdateIPSet

func (c *WAFRegional) UpdateIPSet(input *waf.UpdateIPSetInput) (*waf.UpdateIPSetOutput, error)

UpdateIPSet API operation for AWS WAF Regional.

Inserts or deletes IPSetDescriptor objects in an IPSet. For each IPSetDescriptor object, you specify the following values:

  • Whether to insert or delete the object from the array. If you want to change an IPSetDescriptor object, you delete the existing object and add a new one.

  • The IP address version, IPv4 or IPv6.

  • The IP address in CIDR notation, for example, 192.0.2.0/24 (for the range of IP addresses from 192.0.2.0 to 192.0.2.255) or 192.0.2.44/32 (for the individual IP address 192.0.2.44).

AWS WAF supports /8, /16, /24, and /32 IP address ranges for IPv4, and /24, /32, /48, /56, /64 and /128 for IPv6. For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing).

IPv6 addresses can be represented using any of the following formats:

  • 1111:0000:0000:0000:0000:0000:0000:0111/128

  • 1111:0:0:0:0:0:0:0111/128

  • 1111::0111/128

  • 1111::111/128

You use an IPSet to specify which web requests you want to allow or block based on the IP addresses that the requests originated from. For example, if you're receiving a lot of requests from one or a small number of IP addresses and you want to block the requests, you can create an IPSet that specifies those IP addresses, and then configure AWS WAF to block the requests.

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

Submit a CreateIPSet request.

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

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

When you update an IPSet, you specify the IP addresses that you want to add and/or the IP addresses that you want to delete. If you want to change an IP address, you delete the existing IP address and add the new one.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation UpdateIPSet for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidOperationException The operation failed because there was nothing to do. For example:

  • You tried to remove a Rule from a WebACL, but the Rule isn't in the specified WebACL.

  • You tried to remove an IP address from an IPSet, but the IP address isn't in the specified IPSet.

  • You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple isn't in the specified WebACL.

  • You tried to add a Rule to a WebACL, but the Rule already exists in the specified WebACL.

  • You tried to add an IP address to an IPSet, but the IP address already exists in the specified IPSet.

  • You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple already exists in the specified WebACL.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentContainerException The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

  • You tried to add a Rule to or delete a Rule from a WebACL that doesn't exist.

  • You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that doesn't exist.

  • You tried to add an IP address to or delete an IP address from an IPSet that doesn't exist.

  • You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a ByteMatchSet that doesn't exist.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.UpdateIPSetInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		IPSetId:     aws.String("ResourceId"),  // Required
		Updates: []*waf.IPSetUpdate{ // Required
			{ // Required
				Action: aws.String("ChangeAction"), // Required
				IPSetDescriptor: &waf.IPSetDescriptor{ // Required
					Type:  aws.String("IPSetDescriptorType"),  // Required
					Value: aws.String("IPSetDescriptorValue"), // Required
				},
			},
			// More values...
		},
	}
	resp, err := svc.UpdateIPSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) UpdateIPSetRequest

func (c *WAFRegional) UpdateIPSetRequest(input *waf.UpdateIPSetInput) (req *request.Request, output *waf.UpdateIPSetOutput)

UpdateIPSetRequest generates a "aws/request.Request" representing the client's request for the UpdateIPSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See UpdateIPSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateIPSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateIPSetRequest method.
req, resp := client.UpdateIPSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) UpdateRule

func (c *WAFRegional) UpdateRule(input *waf.UpdateRuleInput) (*waf.UpdateRuleOutput, error)

UpdateRule API operation for AWS WAF Regional.

Inserts or deletes Predicate objects in a Rule. Each Predicate object identifies a predicate, such as a ByteMatchSet or an IPSet, that specifies the web requests that you want to allow, block, or count. If you add more than one predicate to a Rule, a request must match all of the specifications to be allowed, blocked, or counted. For example, suppose you add the following to a Rule:

  • A ByteMatchSet that matches the value BadBot in the User-Agent header

  • An IPSet that matches the IP address 192.0.2.44

You then add the Rule to a WebACL and specify that you want to block requests that satisfy the Rule. For a request to be blocked, the User-Agent header in the request must contain the value BadBotand the request must originate from the IP address 192.0.2.44.

To create and configure a Rule, perform the following steps:

Create and update the predicates that you want to include in the Rule.

Create the Rule. See CreateRule.

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

Submit an UpdateRule request to add predicates to the Rule.

Create and update a WebACL that contains the Rule. See CreateWebACL.

If you want to replace one ByteMatchSet or IPSet with another, you delete the existing one and add the new one.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation UpdateRule for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidOperationException The operation failed because there was nothing to do. For example:

  • You tried to remove a Rule from a WebACL, but the Rule isn't in the specified WebACL.

  • You tried to remove an IP address from an IPSet, but the IP address isn't in the specified IPSet.

  • You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple isn't in the specified WebACL.

  • You tried to add a Rule to a WebACL, but the Rule already exists in the specified WebACL.

  • You tried to add an IP address to an IPSet, but the IP address already exists in the specified IPSet.

  • You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple already exists in the specified WebACL.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentContainerException The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

  • You tried to add a Rule to or delete a Rule from a WebACL that doesn't exist.

  • You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that doesn't exist.

  • You tried to add an IP address to or delete an IP address from an IPSet that doesn't exist.

  • You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a ByteMatchSet that doesn't exist.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.UpdateRuleInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		RuleId:      aws.String("ResourceId"),  // Required
		Updates: []*waf.RuleUpdate{ // Required
			{ // Required
				Action: aws.String("ChangeAction"), // Required
				Predicate: &waf.Predicate{ // Required
					DataId:  aws.String("ResourceId"),    // Required
					Negated: aws.Bool(true),              // Required
					Type:    aws.String("PredicateType"), // Required
				},
			},
			// More values...
		},
	}
	resp, err := svc.UpdateRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) UpdateRuleRequest

func (c *WAFRegional) UpdateRuleRequest(input *waf.UpdateRuleInput) (req *request.Request, output *waf.UpdateRuleOutput)

UpdateRuleRequest generates a "aws/request.Request" representing the client's request for the UpdateRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See UpdateRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateRuleRequest method.
req, resp := client.UpdateRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) UpdateSizeConstraintSet

func (c *WAFRegional) UpdateSizeConstraintSet(input *waf.UpdateSizeConstraintSetInput) (*waf.UpdateSizeConstraintSetOutput, error)

UpdateSizeConstraintSet API operation for AWS WAF Regional.

Inserts or deletes SizeConstraint objects (filters) in a SizeConstraintSet. For each SizeConstraint object, you specify the following values:

  • Whether to insert or delete the object from the array. If you want to change a SizeConstraintSetUpdate object, you delete the existing object and add a new one.

  • The part of a web request that you want AWS WAF to evaluate, such as the length of a query string or the length of the User-Agent header.

  • Whether to perform any transformations on the request, such as converting it to lowercase, before checking its length. Note that transformations of the request body are not supported because the AWS resource forwards only the first 8192 bytes of your request to AWS WAF.

  • A ComparisonOperator used for evaluating the selected part of the request against the specified Size, such as equals, greater than, less than, and so on.

  • The length, in bytes, that you want AWS WAF to watch for in selected part of the request. The length is computed after applying the transformation.

For example, you can add a SizeConstraintSetUpdate object that matches web requests in which the length of the User-Agent header is greater than 100 bytes. You can then configure AWS WAF to block those requests.

To create and configure a SizeConstraintSet, perform the following steps:

Create a SizeConstraintSet. For more information, see CreateSizeConstraintSet.

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

Submit an UpdateSizeConstraintSet request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the value 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 (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation UpdateSizeConstraintSet for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidOperationException The operation failed because there was nothing to do. For example:

  • You tried to remove a Rule from a WebACL, but the Rule isn't in the specified WebACL.

  • You tried to remove an IP address from an IPSet, but the IP address isn't in the specified IPSet.

  • You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple isn't in the specified WebACL.

  • You tried to add a Rule to a WebACL, but the Rule already exists in the specified WebACL.

  • You tried to add an IP address to an IPSet, but the IP address already exists in the specified IPSet.

  • You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple already exists in the specified WebACL.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentContainerException The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

  • You tried to add a Rule to or delete a Rule from a WebACL that doesn't exist.

  • You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that doesn't exist.

  • You tried to add an IP address to or delete an IP address from an IPSet that doesn't exist.

  • You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a ByteMatchSet that doesn't exist.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.UpdateSizeConstraintSetInput{
		ChangeToken:         aws.String("ChangeToken"), // Required
		SizeConstraintSetId: aws.String("ResourceId"),  // Required
		Updates: []*waf.SizeConstraintSetUpdate{ // Required
			{ // Required
				Action: aws.String("ChangeAction"), // Required
				SizeConstraint: &waf.SizeConstraint{ // Required
					ComparisonOperator: aws.String("ComparisonOperator"), // Required
					FieldToMatch: &waf.FieldToMatch{ // Required
						Type: aws.String("MatchFieldType"), // Required
						Data: aws.String("MatchFieldData"),
					},
					Size:               aws.Int64(1),                     // Required
					TextTransformation: aws.String("TextTransformation"), // Required
				},
			},
			// More values...
		},
	}
	resp, err := svc.UpdateSizeConstraintSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) UpdateSizeConstraintSetRequest

func (c *WAFRegional) UpdateSizeConstraintSetRequest(input *waf.UpdateSizeConstraintSetInput) (req *request.Request, output *waf.UpdateSizeConstraintSetOutput)

UpdateSizeConstraintSetRequest generates a "aws/request.Request" representing the client's request for the UpdateSizeConstraintSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See UpdateSizeConstraintSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateSizeConstraintSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateSizeConstraintSetRequest method.
req, resp := client.UpdateSizeConstraintSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) UpdateSqlInjectionMatchSet

UpdateSqlInjectionMatchSet API operation for AWS WAF Regional.

Inserts or deletes SqlInjectionMatchTuple objects (filters) in a SqlInjectionMatchSet. For each SqlInjectionMatchTuple object, you specify the following values:

  • Action: Whether to insert the object into or delete the object from the array. To change a SqlInjectionMatchTuple, you delete the existing object and add a new one.

  • FieldToMatch: The part of web requests that you want AWS WAF to inspect and, if you want AWS WAF to inspect a header, the name of the header.

  • TextTransformation: Which text transformation, if any, to perform on the web request before inspecting the request for snippets of malicious SQL code.

You use SqlInjectionMatchSet objects to specify which CloudFront requests you want to allow, block, or count. For example, if you're receiving requests that contain snippets of SQL code in the query string and you want to block the requests, you can create a SqlInjectionMatchSet with the applicable settings, and then configure AWS WAF to block the requests.

To create and configure a SqlInjectionMatchSet, perform the following steps:

Submit a CreateSqlInjectionMatchSet request.

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

Submit an UpdateSqlInjectionMatchSet request to specify the parts of web requests that you want AWS WAF to inspect for snippets of SQL code.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation UpdateSqlInjectionMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidOperationException The operation failed because there was nothing to do. For example:

  • You tried to remove a Rule from a WebACL, but the Rule isn't in the specified WebACL.

  • You tried to remove an IP address from an IPSet, but the IP address isn't in the specified IPSet.

  • You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple isn't in the specified WebACL.

  • You tried to add a Rule to a WebACL, but the Rule already exists in the specified WebACL.

  • You tried to add an IP address to an IPSet, but the IP address already exists in the specified IPSet.

  • You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple already exists in the specified WebACL.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentContainerException The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

  • You tried to add a Rule to or delete a Rule from a WebACL that doesn't exist.

  • You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that doesn't exist.

  • You tried to add an IP address to or delete an IP address from an IPSet that doesn't exist.

  • You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a ByteMatchSet that doesn't exist.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.UpdateSqlInjectionMatchSetInput{
		ChangeToken:            aws.String("ChangeToken"), // Required
		SqlInjectionMatchSetId: aws.String("ResourceId"),  // Required
		Updates: []*waf.SqlInjectionMatchSetUpdate{ // Required
			{ // Required
				Action: aws.String("ChangeAction"), // Required
				SqlInjectionMatchTuple: &waf.SqlInjectionMatchTuple{ // Required
					FieldToMatch: &waf.FieldToMatch{ // Required
						Type: aws.String("MatchFieldType"), // Required
						Data: aws.String("MatchFieldData"),
					},
					TextTransformation: aws.String("TextTransformation"), // Required
				},
			},
			// More values...
		},
	}
	resp, err := svc.UpdateSqlInjectionMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) UpdateSqlInjectionMatchSetRequest

func (c *WAFRegional) UpdateSqlInjectionMatchSetRequest(input *waf.UpdateSqlInjectionMatchSetInput) (req *request.Request, output *waf.UpdateSqlInjectionMatchSetOutput)

UpdateSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the client's request for the UpdateSqlInjectionMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See UpdateSqlInjectionMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateSqlInjectionMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateSqlInjectionMatchSetRequest method.
req, resp := client.UpdateSqlInjectionMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) UpdateWebACL

func (c *WAFRegional) UpdateWebACL(input *waf.UpdateWebACLInput) (*waf.UpdateWebACLOutput, error)

UpdateWebACL API operation for AWS WAF Regional.

Inserts or deletes ActivatedRule objects in a WebACL. Each Rule identifies web requests that you want to allow, block, or count. When you update a WebACL, you specify the following values:

  • A default action for the WebACL, either ALLOW or BLOCK. AWS WAF performs the default action if a request doesn't match the criteria in any of the Rules in a WebACL.

  • The Rules that you want to add and/or delete. If you want to replace one Rule with another, you delete the existing Rule and add the new one.

  • For each Rule, whether you want AWS WAF to allow requests, block requests, or count requests that match the conditions in the Rule.

  • The order in which you want AWS WAF to evaluate the Rules in a WebACL. If you add more than one Rule to a WebACL, AWS WAF evaluates each request against the Rules in order based on the value of Priority. (The Rule that has the lowest value for Priority is evaluated first.) When a web request matches all of the predicates (such as ByteMatchSets and IPSets) in a Rule, AWS WAF immediately takes the corresponding action, allow or block, and doesn't evaluate the request against the remaining Rules in the WebACL, if any.

  • The CloudFront distribution that you want to associate with the WebACL.

To create and configure a WebACL, perform the following steps:

Create and update the predicates that you want to include in Rules. For more information, see CreateByteMatchSet, UpdateByteMatchSet, CreateIPSet, UpdateIPSet, CreateSqlInjectionMatchSet, and UpdateSqlInjectionMatchSet.

Create and update the Rules that you want to include in the WebACL. For more information, see CreateRule and UpdateRule.

Create a WebACL. See CreateWebACL.

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

Submit an UpdateWebACL request to specify the Rules that you want to include in the WebACL, to specify the default action, and to associate the WebACL with a CloudFront distribution.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation UpdateWebACL for usage and error information.

Returned Error Codes:

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidOperationException The operation failed because there was nothing to do. For example:

  • You tried to remove a Rule from a WebACL, but the Rule isn't in the specified WebACL.

  • You tried to remove an IP address from an IPSet, but the IP address isn't in the specified IPSet.

  • You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple isn't in the specified WebACL.

  • You tried to add a Rule to a WebACL, but the Rule already exists in the specified WebACL.

  • You tried to add an IP address to an IPSet, but the IP address already exists in the specified IPSet.

  • You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple already exists in the specified WebACL.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentContainerException The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

  • You tried to add a Rule to or delete a Rule from a WebACL that doesn't exist.

  • You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that doesn't exist.

  • You tried to add an IP address to or delete an IP address from an IPSet that doesn't exist.

  • You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a ByteMatchSet that doesn't exist.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFReferencedItemException The operation failed because you tried to delete an object that is still in use. For example:

  • You tried to delete a ByteMatchSet that is still referenced by a Rule.

  • You tried to delete a Rule that is still referenced by a WebACL.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.UpdateWebACLInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		WebACLId:    aws.String("ResourceId"),  // Required
		DefaultAction: &waf.WafAction{
			Type: aws.String("WafActionType"), // Required
		},
		Updates: []*waf.WebACLUpdate{
			{ // Required
				Action: aws.String("ChangeAction"), // Required
				ActivatedRule: &waf.ActivatedRule{ // Required
					Action: &waf.WafAction{ // Required
						Type: aws.String("WafActionType"), // Required
					},
					Priority: aws.Int64(1),             // Required
					RuleId:   aws.String("ResourceId"), // Required
				},
			},
			// More values...
		},
	}
	resp, err := svc.UpdateWebACL(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) UpdateWebACLRequest

func (c *WAFRegional) UpdateWebACLRequest(input *waf.UpdateWebACLInput) (req *request.Request, output *waf.UpdateWebACLOutput)

UpdateWebACLRequest generates a "aws/request.Request" representing the client's request for the UpdateWebACL operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See UpdateWebACL for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateWebACL method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateWebACLRequest method.
req, resp := client.UpdateWebACLRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*WAFRegional) UpdateXssMatchSet

func (c *WAFRegional) UpdateXssMatchSet(input *waf.UpdateXssMatchSetInput) (*waf.UpdateXssMatchSetOutput, error)

UpdateXssMatchSet API operation for AWS WAF Regional.

Inserts or deletes XssMatchTuple objects (filters) in an XssMatchSet. For each XssMatchTuple object, you specify the following values:

  • Action: Whether to insert the object into or delete the object from the array. To change a XssMatchTuple, you delete the existing object and add a new one.

  • FieldToMatch: The part of web requests that you want AWS WAF to inspect and, if you want AWS WAF to inspect a header, the name of the header.

  • TextTransformation: Which text transformation, if any, to perform on the web request before inspecting the request for cross-site scripting attacks.

You use XssMatchSet objects to specify which CloudFront requests you want to allow, block, or count. For example, if you're receiving requests that contain cross-site scripting attacks in the request body and you want to block the requests, you can create an XssMatchSet with the applicable settings, and then configure AWS WAF to block the requests.

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

Submit a CreateXssMatchSet request.

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

Submit an UpdateXssMatchSet request to specify the parts of web requests that you want AWS WAF to inspect for cross-site scripting attacks.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS WAF Regional's API operation UpdateXssMatchSet for usage and error information.

Returned Error Codes:

  • WAFInternalErrorException The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidOperationException The operation failed because there was nothing to do. For example:

  • You tried to remove a Rule from a WebACL, but the Rule isn't in the specified WebACL.

  • You tried to remove an IP address from an IPSet, but the IP address isn't in the specified IPSet.

  • You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple isn't in the specified WebACL.

  • You tried to add a Rule to a WebACL, but the Rule already exists in the specified WebACL.

  • You tried to add an IP address to an IPSet, but the IP address already exists in the specified IPSet.

  • You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple already exists in the specified WebACL.

  • WAFInvalidParameterException The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

  • You specified an invalid parameter name.

  • You specified an invalid value.

  • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

  • You tried to create a WebACL with a DefaultActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a WebACL with a WafActionType other than ALLOW, BLOCK, or COUNT.

  • You tried to update a ByteMatchSet with a FieldToMatchType other than HEADER, QUERY_STRING, or URI.

  • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentContainerException The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

  • You tried to add a Rule to or delete a Rule from a WebACL that doesn't exist.

  • You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that doesn't exist.

  • You tried to add an IP address to or delete an IP address from an IPSet that doesn't exist.

  • You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a ByteMatchSet that doesn't exist.

  • WAFNonexistentItemException The operation failed because the referenced object doesn't exist.

  • WAFStaleDataException The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

  • WAFLimitsExceededException The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create for an AWS account. For more information, see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the AWS WAF Developer Guide.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/waf"
	"github.com/aws/aws-sdk-go/service/wafregional"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := wafregional.New(sess)

	params := &waf.UpdateXssMatchSetInput{
		ChangeToken: aws.String("ChangeToken"), // Required
		Updates: []*waf.XssMatchSetUpdate{ // Required
			{ // Required
				Action: aws.String("ChangeAction"), // Required
				XssMatchTuple: &waf.XssMatchTuple{ // Required
					FieldToMatch: &waf.FieldToMatch{ // Required
						Type: aws.String("MatchFieldType"), // Required
						Data: aws.String("MatchFieldData"),
					},
					TextTransformation: aws.String("TextTransformation"), // Required
				},
			},
			// More values...
		},
		XssMatchSetId: aws.String("ResourceId"), // Required
	}
	resp, err := svc.UpdateXssMatchSet(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*WAFRegional) UpdateXssMatchSetRequest

func (c *WAFRegional) UpdateXssMatchSetRequest(input *waf.UpdateXssMatchSetInput) (req *request.Request, output *waf.UpdateXssMatchSetOutput)

UpdateXssMatchSetRequest generates a "aws/request.Request" representing the client's request for the UpdateXssMatchSet operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See UpdateXssMatchSet for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateXssMatchSet method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateXssMatchSetRequest method.
req, resp := client.UpdateXssMatchSetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Directories

Path Synopsis
Package wafregionaliface provides an interface to enable mocking the AWS WAF Regional service client for testing your code.
Package wafregionaliface provides an interface to enable mocking the AWS WAF Regional service client for testing your code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL