github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/wafregional/geoMatchSet.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 wafregional 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 Regional Geo 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/wafregional" 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 := wafregional.NewGeoMatchSet(ctx, "geo_match_set", &wafregional.GeoMatchSetArgs{ 32 // Name: pulumi.String("geo_match_set"), 33 // GeoMatchConstraints: wafregional.GeoMatchSetGeoMatchConstraintArray{ 34 // &wafregional.GeoMatchSetGeoMatchConstraintArgs{ 35 // Type: pulumi.String("Country"), 36 // Value: pulumi.String("US"), 37 // }, 38 // &wafregional.GeoMatchSetGeoMatchConstraintArgs{ 39 // Type: pulumi.String("Country"), 40 // Value: pulumi.String("CA"), 41 // }, 42 // }, 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 // 54 // ## Import 55 // 56 // Using `pulumi import`, import WAF Regional Geo Match Set using the id. For example: 57 // 58 // ```sh 59 // $ pulumi import aws:wafregional/geoMatchSet:GeoMatchSet geo_match_set a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc 60 // ``` 61 type GeoMatchSet struct { 62 pulumi.CustomResourceState 63 64 // The Geo Match Constraint objects which contain the country that you want AWS WAF to search for. 65 GeoMatchConstraints GeoMatchSetGeoMatchConstraintArrayOutput `pulumi:"geoMatchConstraints"` 66 // The name or description of the Geo Match Set. 67 Name pulumi.StringOutput `pulumi:"name"` 68 } 69 70 // NewGeoMatchSet registers a new resource with the given unique name, arguments, and options. 71 func NewGeoMatchSet(ctx *pulumi.Context, 72 name string, args *GeoMatchSetArgs, opts ...pulumi.ResourceOption) (*GeoMatchSet, error) { 73 if args == nil { 74 args = &GeoMatchSetArgs{} 75 } 76 77 opts = internal.PkgResourceDefaultOpts(opts) 78 var resource GeoMatchSet 79 err := ctx.RegisterResource("aws:wafregional/geoMatchSet:GeoMatchSet", name, args, &resource, opts...) 80 if err != nil { 81 return nil, err 82 } 83 return &resource, nil 84 } 85 86 // GetGeoMatchSet gets an existing GeoMatchSet resource's state with the given name, ID, and optional 87 // state properties that are used to uniquely qualify the lookup (nil if not required). 88 func GetGeoMatchSet(ctx *pulumi.Context, 89 name string, id pulumi.IDInput, state *GeoMatchSetState, opts ...pulumi.ResourceOption) (*GeoMatchSet, error) { 90 var resource GeoMatchSet 91 err := ctx.ReadResource("aws:wafregional/geoMatchSet:GeoMatchSet", name, id, state, &resource, opts...) 92 if err != nil { 93 return nil, err 94 } 95 return &resource, nil 96 } 97 98 // Input properties used for looking up and filtering GeoMatchSet resources. 99 type geoMatchSetState struct { 100 // The Geo Match Constraint objects which contain the country that you want AWS WAF to search for. 101 GeoMatchConstraints []GeoMatchSetGeoMatchConstraint `pulumi:"geoMatchConstraints"` 102 // The name or description of the Geo Match Set. 103 Name *string `pulumi:"name"` 104 } 105 106 type GeoMatchSetState struct { 107 // The Geo Match Constraint objects which contain the country that you want AWS WAF to search for. 108 GeoMatchConstraints GeoMatchSetGeoMatchConstraintArrayInput 109 // The name or description of the Geo Match Set. 110 Name pulumi.StringPtrInput 111 } 112 113 func (GeoMatchSetState) ElementType() reflect.Type { 114 return reflect.TypeOf((*geoMatchSetState)(nil)).Elem() 115 } 116 117 type geoMatchSetArgs struct { 118 // The Geo Match Constraint objects which contain the country that you want AWS WAF to search for. 119 GeoMatchConstraints []GeoMatchSetGeoMatchConstraint `pulumi:"geoMatchConstraints"` 120 // The name or description of the Geo Match Set. 121 Name *string `pulumi:"name"` 122 } 123 124 // The set of arguments for constructing a GeoMatchSet resource. 125 type GeoMatchSetArgs struct { 126 // The Geo Match Constraint objects which contain the country that you want AWS WAF to search for. 127 GeoMatchConstraints GeoMatchSetGeoMatchConstraintArrayInput 128 // The name or description of the Geo Match Set. 129 Name pulumi.StringPtrInput 130 } 131 132 func (GeoMatchSetArgs) ElementType() reflect.Type { 133 return reflect.TypeOf((*geoMatchSetArgs)(nil)).Elem() 134 } 135 136 type GeoMatchSetInput interface { 137 pulumi.Input 138 139 ToGeoMatchSetOutput() GeoMatchSetOutput 140 ToGeoMatchSetOutputWithContext(ctx context.Context) GeoMatchSetOutput 141 } 142 143 func (*GeoMatchSet) ElementType() reflect.Type { 144 return reflect.TypeOf((**GeoMatchSet)(nil)).Elem() 145 } 146 147 func (i *GeoMatchSet) ToGeoMatchSetOutput() GeoMatchSetOutput { 148 return i.ToGeoMatchSetOutputWithContext(context.Background()) 149 } 150 151 func (i *GeoMatchSet) ToGeoMatchSetOutputWithContext(ctx context.Context) GeoMatchSetOutput { 152 return pulumi.ToOutputWithContext(ctx, i).(GeoMatchSetOutput) 153 } 154 155 // GeoMatchSetArrayInput is an input type that accepts GeoMatchSetArray and GeoMatchSetArrayOutput values. 156 // You can construct a concrete instance of `GeoMatchSetArrayInput` via: 157 // 158 // GeoMatchSetArray{ GeoMatchSetArgs{...} } 159 type GeoMatchSetArrayInput interface { 160 pulumi.Input 161 162 ToGeoMatchSetArrayOutput() GeoMatchSetArrayOutput 163 ToGeoMatchSetArrayOutputWithContext(context.Context) GeoMatchSetArrayOutput 164 } 165 166 type GeoMatchSetArray []GeoMatchSetInput 167 168 func (GeoMatchSetArray) ElementType() reflect.Type { 169 return reflect.TypeOf((*[]*GeoMatchSet)(nil)).Elem() 170 } 171 172 func (i GeoMatchSetArray) ToGeoMatchSetArrayOutput() GeoMatchSetArrayOutput { 173 return i.ToGeoMatchSetArrayOutputWithContext(context.Background()) 174 } 175 176 func (i GeoMatchSetArray) ToGeoMatchSetArrayOutputWithContext(ctx context.Context) GeoMatchSetArrayOutput { 177 return pulumi.ToOutputWithContext(ctx, i).(GeoMatchSetArrayOutput) 178 } 179 180 // GeoMatchSetMapInput is an input type that accepts GeoMatchSetMap and GeoMatchSetMapOutput values. 181 // You can construct a concrete instance of `GeoMatchSetMapInput` via: 182 // 183 // GeoMatchSetMap{ "key": GeoMatchSetArgs{...} } 184 type GeoMatchSetMapInput interface { 185 pulumi.Input 186 187 ToGeoMatchSetMapOutput() GeoMatchSetMapOutput 188 ToGeoMatchSetMapOutputWithContext(context.Context) GeoMatchSetMapOutput 189 } 190 191 type GeoMatchSetMap map[string]GeoMatchSetInput 192 193 func (GeoMatchSetMap) ElementType() reflect.Type { 194 return reflect.TypeOf((*map[string]*GeoMatchSet)(nil)).Elem() 195 } 196 197 func (i GeoMatchSetMap) ToGeoMatchSetMapOutput() GeoMatchSetMapOutput { 198 return i.ToGeoMatchSetMapOutputWithContext(context.Background()) 199 } 200 201 func (i GeoMatchSetMap) ToGeoMatchSetMapOutputWithContext(ctx context.Context) GeoMatchSetMapOutput { 202 return pulumi.ToOutputWithContext(ctx, i).(GeoMatchSetMapOutput) 203 } 204 205 type GeoMatchSetOutput struct{ *pulumi.OutputState } 206 207 func (GeoMatchSetOutput) ElementType() reflect.Type { 208 return reflect.TypeOf((**GeoMatchSet)(nil)).Elem() 209 } 210 211 func (o GeoMatchSetOutput) ToGeoMatchSetOutput() GeoMatchSetOutput { 212 return o 213 } 214 215 func (o GeoMatchSetOutput) ToGeoMatchSetOutputWithContext(ctx context.Context) GeoMatchSetOutput { 216 return o 217 } 218 219 // The Geo Match Constraint objects which contain the country that you want AWS WAF to search for. 220 func (o GeoMatchSetOutput) GeoMatchConstraints() GeoMatchSetGeoMatchConstraintArrayOutput { 221 return o.ApplyT(func(v *GeoMatchSet) GeoMatchSetGeoMatchConstraintArrayOutput { return v.GeoMatchConstraints }).(GeoMatchSetGeoMatchConstraintArrayOutput) 222 } 223 224 // The name or description of the Geo Match Set. 225 func (o GeoMatchSetOutput) Name() pulumi.StringOutput { 226 return o.ApplyT(func(v *GeoMatchSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 227 } 228 229 type GeoMatchSetArrayOutput struct{ *pulumi.OutputState } 230 231 func (GeoMatchSetArrayOutput) ElementType() reflect.Type { 232 return reflect.TypeOf((*[]*GeoMatchSet)(nil)).Elem() 233 } 234 235 func (o GeoMatchSetArrayOutput) ToGeoMatchSetArrayOutput() GeoMatchSetArrayOutput { 236 return o 237 } 238 239 func (o GeoMatchSetArrayOutput) ToGeoMatchSetArrayOutputWithContext(ctx context.Context) GeoMatchSetArrayOutput { 240 return o 241 } 242 243 func (o GeoMatchSetArrayOutput) Index(i pulumi.IntInput) GeoMatchSetOutput { 244 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GeoMatchSet { 245 return vs[0].([]*GeoMatchSet)[vs[1].(int)] 246 }).(GeoMatchSetOutput) 247 } 248 249 type GeoMatchSetMapOutput struct{ *pulumi.OutputState } 250 251 func (GeoMatchSetMapOutput) ElementType() reflect.Type { 252 return reflect.TypeOf((*map[string]*GeoMatchSet)(nil)).Elem() 253 } 254 255 func (o GeoMatchSetMapOutput) ToGeoMatchSetMapOutput() GeoMatchSetMapOutput { 256 return o 257 } 258 259 func (o GeoMatchSetMapOutput) ToGeoMatchSetMapOutputWithContext(ctx context.Context) GeoMatchSetMapOutput { 260 return o 261 } 262 263 func (o GeoMatchSetMapOutput) MapIndex(k pulumi.StringInput) GeoMatchSetOutput { 264 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GeoMatchSet { 265 return vs[0].(map[string]*GeoMatchSet)[vs[1].(string)] 266 }).(GeoMatchSetOutput) 267 } 268 269 func init() { 270 pulumi.RegisterInputType(reflect.TypeOf((*GeoMatchSetInput)(nil)).Elem(), &GeoMatchSet{}) 271 pulumi.RegisterInputType(reflect.TypeOf((*GeoMatchSetArrayInput)(nil)).Elem(), GeoMatchSetArray{}) 272 pulumi.RegisterInputType(reflect.TypeOf((*GeoMatchSetMapInput)(nil)).Elem(), GeoMatchSetMap{}) 273 pulumi.RegisterOutputType(GeoMatchSetOutput{}) 274 pulumi.RegisterOutputType(GeoMatchSetArrayOutput{}) 275 pulumi.RegisterOutputType(GeoMatchSetMapOutput{}) 276 }