1. Packages
  2. AWS
  3. API Docs
  4. wafregional
  5. SqlInjectionMatchSet
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.wafregional.SqlInjectionMatchSet

Explore with Pulumi AI

Provides a WAF Regional SQL Injection Match Set Resource for use with Application Load Balancer.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const sqlInjectionMatchSet = new aws.wafregional.SqlInjectionMatchSet("sql_injection_match_set", {
    name: "tf-sql_injection_match_set",
    sqlInjectionMatchTuples: [{
        textTransformation: "URL_DECODE",
        fieldToMatch: {
            type: "QUERY_STRING",
        },
    }],
});
Copy
import pulumi
import pulumi_aws as aws

sql_injection_match_set = aws.wafregional.SqlInjectionMatchSet("sql_injection_match_set",
    name="tf-sql_injection_match_set",
    sql_injection_match_tuples=[{
        "text_transformation": "URL_DECODE",
        "field_to_match": {
            "type": "QUERY_STRING",
        },
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafregional"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := wafregional.NewSqlInjectionMatchSet(ctx, "sql_injection_match_set", &wafregional.SqlInjectionMatchSetArgs{
			Name: pulumi.String("tf-sql_injection_match_set"),
			SqlInjectionMatchTuples: wafregional.SqlInjectionMatchSetSqlInjectionMatchTupleArray{
				&wafregional.SqlInjectionMatchSetSqlInjectionMatchTupleArgs{
					TextTransformation: pulumi.String("URL_DECODE"),
					FieldToMatch: &wafregional.SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs{
						Type: pulumi.String("QUERY_STRING"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var sqlInjectionMatchSet = new Aws.WafRegional.SqlInjectionMatchSet("sql_injection_match_set", new()
    {
        Name = "tf-sql_injection_match_set",
        SqlInjectionMatchTuples = new[]
        {
            new Aws.WafRegional.Inputs.SqlInjectionMatchSetSqlInjectionMatchTupleArgs
            {
                TextTransformation = "URL_DECODE",
                FieldToMatch = new Aws.WafRegional.Inputs.SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs
                {
                    Type = "QUERY_STRING",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.wafregional.SqlInjectionMatchSet;
import com.pulumi.aws.wafregional.SqlInjectionMatchSetArgs;
import com.pulumi.aws.wafregional.inputs.SqlInjectionMatchSetSqlInjectionMatchTupleArgs;
import com.pulumi.aws.wafregional.inputs.SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sqlInjectionMatchSet = new SqlInjectionMatchSet("sqlInjectionMatchSet", SqlInjectionMatchSetArgs.builder()
            .name("tf-sql_injection_match_set")
            .sqlInjectionMatchTuples(SqlInjectionMatchSetSqlInjectionMatchTupleArgs.builder()
                .textTransformation("URL_DECODE")
                .fieldToMatch(SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs.builder()
                    .type("QUERY_STRING")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  sqlInjectionMatchSet:
    type: aws:wafregional:SqlInjectionMatchSet
    name: sql_injection_match_set
    properties:
      name: tf-sql_injection_match_set
      sqlInjectionMatchTuples:
        - textTransformation: URL_DECODE
          fieldToMatch:
            type: QUERY_STRING
Copy

Create SqlInjectionMatchSet Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SqlInjectionMatchSet(name: string, args?: SqlInjectionMatchSetArgs, opts?: CustomResourceOptions);
@overload
def SqlInjectionMatchSet(resource_name: str,
                         args: Optional[SqlInjectionMatchSetArgs] = None,
                         opts: Optional[ResourceOptions] = None)

@overload
def SqlInjectionMatchSet(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         name: Optional[str] = None,
                         sql_injection_match_tuples: Optional[Sequence[SqlInjectionMatchSetSqlInjectionMatchTupleArgs]] = None)
func NewSqlInjectionMatchSet(ctx *Context, name string, args *SqlInjectionMatchSetArgs, opts ...ResourceOption) (*SqlInjectionMatchSet, error)
public SqlInjectionMatchSet(string name, SqlInjectionMatchSetArgs? args = null, CustomResourceOptions? opts = null)
public SqlInjectionMatchSet(String name, SqlInjectionMatchSetArgs args)
public SqlInjectionMatchSet(String name, SqlInjectionMatchSetArgs args, CustomResourceOptions options)
type: aws:wafregional:SqlInjectionMatchSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args SqlInjectionMatchSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args SqlInjectionMatchSetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args SqlInjectionMatchSetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args SqlInjectionMatchSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SqlInjectionMatchSetArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var awsSqlInjectionMatchSetResource = new Aws.WafRegional.SqlInjectionMatchSet("awsSqlInjectionMatchSetResource", new()
{
    Name = "string",
    SqlInjectionMatchTuples = new[]
    {
        new Aws.WafRegional.Inputs.SqlInjectionMatchSetSqlInjectionMatchTupleArgs
        {
            FieldToMatch = new Aws.WafRegional.Inputs.SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs
            {
                Type = "string",
                Data = "string",
            },
            TextTransformation = "string",
        },
    },
});
Copy
example, err := wafregional.NewSqlInjectionMatchSet(ctx, "awsSqlInjectionMatchSetResource", &wafregional.SqlInjectionMatchSetArgs{
	Name: pulumi.String("string"),
	SqlInjectionMatchTuples: wafregional.SqlInjectionMatchSetSqlInjectionMatchTupleArray{
		&wafregional.SqlInjectionMatchSetSqlInjectionMatchTupleArgs{
			FieldToMatch: &wafregional.SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs{
				Type: pulumi.String("string"),
				Data: pulumi.String("string"),
			},
			TextTransformation: pulumi.String("string"),
		},
	},
})
Copy
var awsSqlInjectionMatchSetResource = new SqlInjectionMatchSet("awsSqlInjectionMatchSetResource", SqlInjectionMatchSetArgs.builder()
    .name("string")
    .sqlInjectionMatchTuples(SqlInjectionMatchSetSqlInjectionMatchTupleArgs.builder()
        .fieldToMatch(SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs.builder()
            .type("string")
            .data("string")
            .build())
        .textTransformation("string")
        .build())
    .build());
Copy
aws_sql_injection_match_set_resource = aws.wafregional.SqlInjectionMatchSet("awsSqlInjectionMatchSetResource",
    name="string",
    sql_injection_match_tuples=[{
        "field_to_match": {
            "type": "string",
            "data": "string",
        },
        "text_transformation": "string",
    }])
Copy
const awsSqlInjectionMatchSetResource = new aws.wafregional.SqlInjectionMatchSet("awsSqlInjectionMatchSetResource", {
    name: "string",
    sqlInjectionMatchTuples: [{
        fieldToMatch: {
            type: "string",
            data: "string",
        },
        textTransformation: "string",
    }],
});
Copy
type: aws:wafregional:SqlInjectionMatchSet
properties:
    name: string
    sqlInjectionMatchTuples:
        - fieldToMatch:
            data: string
            type: string
          textTransformation: string
Copy

SqlInjectionMatchSet Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SqlInjectionMatchSet resource accepts the following input properties:

Name Changes to this property will trigger replacement. string
The name or description of the SizeConstraintSet.
SqlInjectionMatchTuples List<SqlInjectionMatchSetSqlInjectionMatchTuple>
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
Name Changes to this property will trigger replacement. string
The name or description of the SizeConstraintSet.
SqlInjectionMatchTuples []SqlInjectionMatchSetSqlInjectionMatchTupleArgs
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. String
The name or description of the SizeConstraintSet.
sqlInjectionMatchTuples List<SqlInjectionMatchSetSqlInjectionMatchTuple>
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. string
The name or description of the SizeConstraintSet.
sqlInjectionMatchTuples SqlInjectionMatchSetSqlInjectionMatchTuple[]
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. str
The name or description of the SizeConstraintSet.
sql_injection_match_tuples Sequence[SqlInjectionMatchSetSqlInjectionMatchTupleArgs]
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. String
The name or description of the SizeConstraintSet.
sqlInjectionMatchTuples List<Property Map>
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.

Outputs

All input properties are implicitly available as output properties. Additionally, the SqlInjectionMatchSet resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SqlInjectionMatchSet Resource

Get an existing SqlInjectionMatchSet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SqlInjectionMatchSetState, opts?: CustomResourceOptions): SqlInjectionMatchSet
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        sql_injection_match_tuples: Optional[Sequence[SqlInjectionMatchSetSqlInjectionMatchTupleArgs]] = None) -> SqlInjectionMatchSet
func GetSqlInjectionMatchSet(ctx *Context, name string, id IDInput, state *SqlInjectionMatchSetState, opts ...ResourceOption) (*SqlInjectionMatchSet, error)
public static SqlInjectionMatchSet Get(string name, Input<string> id, SqlInjectionMatchSetState? state, CustomResourceOptions? opts = null)
public static SqlInjectionMatchSet get(String name, Output<String> id, SqlInjectionMatchSetState state, CustomResourceOptions options)
resources:  _:    type: aws:wafregional:SqlInjectionMatchSet    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Name Changes to this property will trigger replacement. string
The name or description of the SizeConstraintSet.
SqlInjectionMatchTuples List<SqlInjectionMatchSetSqlInjectionMatchTuple>
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
Name Changes to this property will trigger replacement. string
The name or description of the SizeConstraintSet.
SqlInjectionMatchTuples []SqlInjectionMatchSetSqlInjectionMatchTupleArgs
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. String
The name or description of the SizeConstraintSet.
sqlInjectionMatchTuples List<SqlInjectionMatchSetSqlInjectionMatchTuple>
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. string
The name or description of the SizeConstraintSet.
sqlInjectionMatchTuples SqlInjectionMatchSetSqlInjectionMatchTuple[]
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. str
The name or description of the SizeConstraintSet.
sql_injection_match_tuples Sequence[SqlInjectionMatchSetSqlInjectionMatchTupleArgs]
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
name Changes to this property will trigger replacement. String
The name or description of the SizeConstraintSet.
sqlInjectionMatchTuples List<Property Map>
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.

Supporting Types

SqlInjectionMatchSetSqlInjectionMatchTuple
, SqlInjectionMatchSetSqlInjectionMatchTupleArgs

FieldToMatch This property is required. SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatch
Specifies where in a web request to look for snippets of malicious SQL code.
TextTransformation This property is required. string
Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.
FieldToMatch This property is required. SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatch
Specifies where in a web request to look for snippets of malicious SQL code.
TextTransformation This property is required. string
Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.
fieldToMatch This property is required. SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatch
Specifies where in a web request to look for snippets of malicious SQL code.
textTransformation This property is required. String
Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.
fieldToMatch This property is required. SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatch
Specifies where in a web request to look for snippets of malicious SQL code.
textTransformation This property is required. string
Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.
field_to_match This property is required. SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatch
Specifies where in a web request to look for snippets of malicious SQL code.
text_transformation This property is required. str
Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.
fieldToMatch This property is required. Property Map
Specifies where in a web request to look for snippets of malicious SQL code.
textTransformation This property is required. String
Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.

SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatch
, SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs

Type This property is required. string
The part of the web request that you want AWS WAF to search for a specified string. e.g., HEADER, METHOD or BODY. See docs for all supported values.
Data string
When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
Type This property is required. string
The part of the web request that you want AWS WAF to search for a specified string. e.g., HEADER, METHOD or BODY. See docs for all supported values.
Data string
When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
type This property is required. String
The part of the web request that you want AWS WAF to search for a specified string. e.g., HEADER, METHOD or BODY. See docs for all supported values.
data String
When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
type This property is required. string
The part of the web request that you want AWS WAF to search for a specified string. e.g., HEADER, METHOD or BODY. See docs for all supported values.
data string
When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
type This property is required. str
The part of the web request that you want AWS WAF to search for a specified string. e.g., HEADER, METHOD or BODY. See docs for all supported values.
data str
When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
type This property is required. String
The part of the web request that you want AWS WAF to search for a specified string. e.g., HEADER, METHOD or BODY. See docs for all supported values.
data String
When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.

Import

Using pulumi import, import WAF Regional Sql Injection Match Set using the id. For example:

$ pulumi import aws:wafregional/sqlInjectionMatchSet:SqlInjectionMatchSet sql_injection_match_set a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.