github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/waf/sqlInjectionMatchSet.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package waf 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides a WAF SQL Injection Match Set Resource 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/waf" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := waf.NewSqlInjectionMatchSet(ctx, "sql_injection_match_set", &waf.SqlInjectionMatchSetArgs{ 32 // Name: pulumi.String("tf-sql_injection_match_set"), 33 // SqlInjectionMatchTuples: waf.SqlInjectionMatchSetSqlInjectionMatchTupleArray{ 34 // &waf.SqlInjectionMatchSetSqlInjectionMatchTupleArgs{ 35 // TextTransformation: pulumi.String("URL_DECODE"), 36 // FieldToMatch: &waf.SqlInjectionMatchSetSqlInjectionMatchTupleFieldToMatchArgs{ 37 // Type: pulumi.String("QUERY_STRING"), 38 // }, 39 // }, 40 // }, 41 // }) 42 // if err != nil { 43 // return err 44 // } 45 // return nil 46 // }) 47 // } 48 // 49 // ``` 50 // <!--End PulumiCodeChooser --> 51 // 52 // ## Import 53 // 54 // Using `pulumi import`, import AWS WAF SQL Injection Match Set using their ID. For example: 55 // 56 // ```sh 57 // $ pulumi import aws:waf/sqlInjectionMatchSet:SqlInjectionMatchSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc 58 // ``` 59 type SqlInjectionMatchSet struct { 60 pulumi.CustomResourceState 61 62 // The name or description of the SQL Injection Match Set. 63 Name pulumi.StringOutput `pulumi:"name"` 64 // 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. 65 SqlInjectionMatchTuples SqlInjectionMatchSetSqlInjectionMatchTupleArrayOutput `pulumi:"sqlInjectionMatchTuples"` 66 } 67 68 // NewSqlInjectionMatchSet registers a new resource with the given unique name, arguments, and options. 69 func NewSqlInjectionMatchSet(ctx *pulumi.Context, 70 name string, args *SqlInjectionMatchSetArgs, opts ...pulumi.ResourceOption) (*SqlInjectionMatchSet, error) { 71 if args == nil { 72 args = &SqlInjectionMatchSetArgs{} 73 } 74 75 opts = internal.PkgResourceDefaultOpts(opts) 76 var resource SqlInjectionMatchSet 77 err := ctx.RegisterResource("aws:waf/sqlInjectionMatchSet:SqlInjectionMatchSet", name, args, &resource, opts...) 78 if err != nil { 79 return nil, err 80 } 81 return &resource, nil 82 } 83 84 // GetSqlInjectionMatchSet gets an existing SqlInjectionMatchSet resource's state with the given name, ID, and optional 85 // state properties that are used to uniquely qualify the lookup (nil if not required). 86 func GetSqlInjectionMatchSet(ctx *pulumi.Context, 87 name string, id pulumi.IDInput, state *SqlInjectionMatchSetState, opts ...pulumi.ResourceOption) (*SqlInjectionMatchSet, error) { 88 var resource SqlInjectionMatchSet 89 err := ctx.ReadResource("aws:waf/sqlInjectionMatchSet:SqlInjectionMatchSet", name, id, state, &resource, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return &resource, nil 94 } 95 96 // Input properties used for looking up and filtering SqlInjectionMatchSet resources. 97 type sqlInjectionMatchSetState struct { 98 // The name or description of the SQL Injection Match Set. 99 Name *string `pulumi:"name"` 100 // 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. 101 SqlInjectionMatchTuples []SqlInjectionMatchSetSqlInjectionMatchTuple `pulumi:"sqlInjectionMatchTuples"` 102 } 103 104 type SqlInjectionMatchSetState struct { 105 // The name or description of the SQL Injection Match Set. 106 Name pulumi.StringPtrInput 107 // 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. 108 SqlInjectionMatchTuples SqlInjectionMatchSetSqlInjectionMatchTupleArrayInput 109 } 110 111 func (SqlInjectionMatchSetState) ElementType() reflect.Type { 112 return reflect.TypeOf((*sqlInjectionMatchSetState)(nil)).Elem() 113 } 114 115 type sqlInjectionMatchSetArgs struct { 116 // The name or description of the SQL Injection Match Set. 117 Name *string `pulumi:"name"` 118 // 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. 119 SqlInjectionMatchTuples []SqlInjectionMatchSetSqlInjectionMatchTuple `pulumi:"sqlInjectionMatchTuples"` 120 } 121 122 // The set of arguments for constructing a SqlInjectionMatchSet resource. 123 type SqlInjectionMatchSetArgs struct { 124 // The name or description of the SQL Injection Match Set. 125 Name pulumi.StringPtrInput 126 // 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. 127 SqlInjectionMatchTuples SqlInjectionMatchSetSqlInjectionMatchTupleArrayInput 128 } 129 130 func (SqlInjectionMatchSetArgs) ElementType() reflect.Type { 131 return reflect.TypeOf((*sqlInjectionMatchSetArgs)(nil)).Elem() 132 } 133 134 type SqlInjectionMatchSetInput interface { 135 pulumi.Input 136 137 ToSqlInjectionMatchSetOutput() SqlInjectionMatchSetOutput 138 ToSqlInjectionMatchSetOutputWithContext(ctx context.Context) SqlInjectionMatchSetOutput 139 } 140 141 func (*SqlInjectionMatchSet) ElementType() reflect.Type { 142 return reflect.TypeOf((**SqlInjectionMatchSet)(nil)).Elem() 143 } 144 145 func (i *SqlInjectionMatchSet) ToSqlInjectionMatchSetOutput() SqlInjectionMatchSetOutput { 146 return i.ToSqlInjectionMatchSetOutputWithContext(context.Background()) 147 } 148 149 func (i *SqlInjectionMatchSet) ToSqlInjectionMatchSetOutputWithContext(ctx context.Context) SqlInjectionMatchSetOutput { 150 return pulumi.ToOutputWithContext(ctx, i).(SqlInjectionMatchSetOutput) 151 } 152 153 // SqlInjectionMatchSetArrayInput is an input type that accepts SqlInjectionMatchSetArray and SqlInjectionMatchSetArrayOutput values. 154 // You can construct a concrete instance of `SqlInjectionMatchSetArrayInput` via: 155 // 156 // SqlInjectionMatchSetArray{ SqlInjectionMatchSetArgs{...} } 157 type SqlInjectionMatchSetArrayInput interface { 158 pulumi.Input 159 160 ToSqlInjectionMatchSetArrayOutput() SqlInjectionMatchSetArrayOutput 161 ToSqlInjectionMatchSetArrayOutputWithContext(context.Context) SqlInjectionMatchSetArrayOutput 162 } 163 164 type SqlInjectionMatchSetArray []SqlInjectionMatchSetInput 165 166 func (SqlInjectionMatchSetArray) ElementType() reflect.Type { 167 return reflect.TypeOf((*[]*SqlInjectionMatchSet)(nil)).Elem() 168 } 169 170 func (i SqlInjectionMatchSetArray) ToSqlInjectionMatchSetArrayOutput() SqlInjectionMatchSetArrayOutput { 171 return i.ToSqlInjectionMatchSetArrayOutputWithContext(context.Background()) 172 } 173 174 func (i SqlInjectionMatchSetArray) ToSqlInjectionMatchSetArrayOutputWithContext(ctx context.Context) SqlInjectionMatchSetArrayOutput { 175 return pulumi.ToOutputWithContext(ctx, i).(SqlInjectionMatchSetArrayOutput) 176 } 177 178 // SqlInjectionMatchSetMapInput is an input type that accepts SqlInjectionMatchSetMap and SqlInjectionMatchSetMapOutput values. 179 // You can construct a concrete instance of `SqlInjectionMatchSetMapInput` via: 180 // 181 // SqlInjectionMatchSetMap{ "key": SqlInjectionMatchSetArgs{...} } 182 type SqlInjectionMatchSetMapInput interface { 183 pulumi.Input 184 185 ToSqlInjectionMatchSetMapOutput() SqlInjectionMatchSetMapOutput 186 ToSqlInjectionMatchSetMapOutputWithContext(context.Context) SqlInjectionMatchSetMapOutput 187 } 188 189 type SqlInjectionMatchSetMap map[string]SqlInjectionMatchSetInput 190 191 func (SqlInjectionMatchSetMap) ElementType() reflect.Type { 192 return reflect.TypeOf((*map[string]*SqlInjectionMatchSet)(nil)).Elem() 193 } 194 195 func (i SqlInjectionMatchSetMap) ToSqlInjectionMatchSetMapOutput() SqlInjectionMatchSetMapOutput { 196 return i.ToSqlInjectionMatchSetMapOutputWithContext(context.Background()) 197 } 198 199 func (i SqlInjectionMatchSetMap) ToSqlInjectionMatchSetMapOutputWithContext(ctx context.Context) SqlInjectionMatchSetMapOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(SqlInjectionMatchSetMapOutput) 201 } 202 203 type SqlInjectionMatchSetOutput struct{ *pulumi.OutputState } 204 205 func (SqlInjectionMatchSetOutput) ElementType() reflect.Type { 206 return reflect.TypeOf((**SqlInjectionMatchSet)(nil)).Elem() 207 } 208 209 func (o SqlInjectionMatchSetOutput) ToSqlInjectionMatchSetOutput() SqlInjectionMatchSetOutput { 210 return o 211 } 212 213 func (o SqlInjectionMatchSetOutput) ToSqlInjectionMatchSetOutputWithContext(ctx context.Context) SqlInjectionMatchSetOutput { 214 return o 215 } 216 217 // The name or description of the SQL Injection Match Set. 218 func (o SqlInjectionMatchSetOutput) Name() pulumi.StringOutput { 219 return o.ApplyT(func(v *SqlInjectionMatchSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 220 } 221 222 // 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. 223 func (o SqlInjectionMatchSetOutput) SqlInjectionMatchTuples() SqlInjectionMatchSetSqlInjectionMatchTupleArrayOutput { 224 return o.ApplyT(func(v *SqlInjectionMatchSet) SqlInjectionMatchSetSqlInjectionMatchTupleArrayOutput { 225 return v.SqlInjectionMatchTuples 226 }).(SqlInjectionMatchSetSqlInjectionMatchTupleArrayOutput) 227 } 228 229 type SqlInjectionMatchSetArrayOutput struct{ *pulumi.OutputState } 230 231 func (SqlInjectionMatchSetArrayOutput) ElementType() reflect.Type { 232 return reflect.TypeOf((*[]*SqlInjectionMatchSet)(nil)).Elem() 233 } 234 235 func (o SqlInjectionMatchSetArrayOutput) ToSqlInjectionMatchSetArrayOutput() SqlInjectionMatchSetArrayOutput { 236 return o 237 } 238 239 func (o SqlInjectionMatchSetArrayOutput) ToSqlInjectionMatchSetArrayOutputWithContext(ctx context.Context) SqlInjectionMatchSetArrayOutput { 240 return o 241 } 242 243 func (o SqlInjectionMatchSetArrayOutput) Index(i pulumi.IntInput) SqlInjectionMatchSetOutput { 244 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlInjectionMatchSet { 245 return vs[0].([]*SqlInjectionMatchSet)[vs[1].(int)] 246 }).(SqlInjectionMatchSetOutput) 247 } 248 249 type SqlInjectionMatchSetMapOutput struct{ *pulumi.OutputState } 250 251 func (SqlInjectionMatchSetMapOutput) ElementType() reflect.Type { 252 return reflect.TypeOf((*map[string]*SqlInjectionMatchSet)(nil)).Elem() 253 } 254 255 func (o SqlInjectionMatchSetMapOutput) ToSqlInjectionMatchSetMapOutput() SqlInjectionMatchSetMapOutput { 256 return o 257 } 258 259 func (o SqlInjectionMatchSetMapOutput) ToSqlInjectionMatchSetMapOutputWithContext(ctx context.Context) SqlInjectionMatchSetMapOutput { 260 return o 261 } 262 263 func (o SqlInjectionMatchSetMapOutput) MapIndex(k pulumi.StringInput) SqlInjectionMatchSetOutput { 264 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlInjectionMatchSet { 265 return vs[0].(map[string]*SqlInjectionMatchSet)[vs[1].(string)] 266 }).(SqlInjectionMatchSetOutput) 267 } 268 269 func init() { 270 pulumi.RegisterInputType(reflect.TypeOf((*SqlInjectionMatchSetInput)(nil)).Elem(), &SqlInjectionMatchSet{}) 271 pulumi.RegisterInputType(reflect.TypeOf((*SqlInjectionMatchSetArrayInput)(nil)).Elem(), SqlInjectionMatchSetArray{}) 272 pulumi.RegisterInputType(reflect.TypeOf((*SqlInjectionMatchSetMapInput)(nil)).Elem(), SqlInjectionMatchSetMap{}) 273 pulumi.RegisterOutputType(SqlInjectionMatchSetOutput{}) 274 pulumi.RegisterOutputType(SqlInjectionMatchSetArrayOutput{}) 275 pulumi.RegisterOutputType(SqlInjectionMatchSetMapOutput{}) 276 }