github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/opensearch/serverlessSecurityPolicy.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 opensearch 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Resource for managing an AWS OpenSearch Serverless Security Policy. See AWS documentation for [encryption policies](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-encryption.html#serverless-encryption-policies) and [network policies](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-network.html#serverless-network-policies). 16 // 17 // ## Example Usage 18 // 19 // ### Encryption Security Policy 20 // 21 // ### Applies to a single collection 22 // 23 // <!--Start PulumiCodeChooser --> 24 // ```go 25 // package main 26 // 27 // import ( 28 // 29 // "encoding/json" 30 // 31 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 32 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 33 // 34 // ) 35 // 36 // func main() { 37 // pulumi.Run(func(ctx *pulumi.Context) error { 38 // tmpJSON0, err := json.Marshal(map[string]interface{}{ 39 // "Rules": []map[string]interface{}{ 40 // map[string]interface{}{ 41 // "Resource": []string{ 42 // "collection/example-collection", 43 // }, 44 // "ResourceType": "collection", 45 // }, 46 // }, 47 // "AWSOwnedKey": true, 48 // }) 49 // if err != nil { 50 // return err 51 // } 52 // json0 := string(tmpJSON0) 53 // _, err = opensearch.NewServerlessSecurityPolicy(ctx, "example", &opensearch.ServerlessSecurityPolicyArgs{ 54 // Name: pulumi.String("example"), 55 // Type: pulumi.String("encryption"), 56 // Description: pulumi.String("encryption security policy for example-collection"), 57 // Policy: pulumi.String(json0), 58 // }) 59 // if err != nil { 60 // return err 61 // } 62 // return nil 63 // }) 64 // } 65 // 66 // ``` 67 // <!--End PulumiCodeChooser --> 68 // 69 // ### Applies to multiple collections 70 // 71 // <!--Start PulumiCodeChooser --> 72 // ```go 73 // package main 74 // 75 // import ( 76 // 77 // "encoding/json" 78 // 79 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 80 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 81 // 82 // ) 83 // 84 // func main() { 85 // pulumi.Run(func(ctx *pulumi.Context) error { 86 // tmpJSON0, err := json.Marshal(map[string]interface{}{ 87 // "Rules": []map[string]interface{}{ 88 // map[string]interface{}{ 89 // "Resource": []string{ 90 // "collection/example*", 91 // }, 92 // "ResourceType": "collection", 93 // }, 94 // }, 95 // "AWSOwnedKey": true, 96 // }) 97 // if err != nil { 98 // return err 99 // } 100 // json0 := string(tmpJSON0) 101 // _, err = opensearch.NewServerlessSecurityPolicy(ctx, "example", &opensearch.ServerlessSecurityPolicyArgs{ 102 // Name: pulumi.String("example"), 103 // Type: pulumi.String("encryption"), 104 // Description: pulumi.String("encryption security policy for collections that begin with \"example\""), 105 // Policy: pulumi.String(json0), 106 // }) 107 // if err != nil { 108 // return err 109 // } 110 // return nil 111 // }) 112 // } 113 // 114 // ``` 115 // <!--End PulumiCodeChooser --> 116 // 117 // ### Using a customer managed key 118 // 119 // <!--Start PulumiCodeChooser --> 120 // ```go 121 // package main 122 // 123 // import ( 124 // 125 // "encoding/json" 126 // 127 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 128 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 129 // 130 // ) 131 // 132 // func main() { 133 // pulumi.Run(func(ctx *pulumi.Context) error { 134 // tmpJSON0, err := json.Marshal(map[string]interface{}{ 135 // "Rules": []map[string]interface{}{ 136 // map[string]interface{}{ 137 // "Resource": []string{ 138 // "collection/customer-managed-key-collection", 139 // }, 140 // "ResourceType": "collection", 141 // }, 142 // }, 143 // "AWSOwnedKey": false, 144 // "KmsARN": "arn:aws:kms:us-east-1:123456789012:key/93fd6da4-a317-4c17-bfe9-382b5d988b36", 145 // }) 146 // if err != nil { 147 // return err 148 // } 149 // json0 := string(tmpJSON0) 150 // _, err = opensearch.NewServerlessSecurityPolicy(ctx, "example", &opensearch.ServerlessSecurityPolicyArgs{ 151 // Name: pulumi.String("example"), 152 // Type: pulumi.String("encryption"), 153 // Description: pulumi.String("encryption security policy using customer KMS key"), 154 // Policy: pulumi.String(json0), 155 // }) 156 // if err != nil { 157 // return err 158 // } 159 // return nil 160 // }) 161 // } 162 // 163 // ``` 164 // <!--End PulumiCodeChooser --> 165 // 166 // ### Network Security Policy 167 // 168 // ### Allow public access to the collection endpoint and the Dashboards endpoint 169 // 170 // <!--Start PulumiCodeChooser --> 171 // ```go 172 // package main 173 // 174 // import ( 175 // 176 // "encoding/json" 177 // 178 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 179 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 180 // 181 // ) 182 // 183 // func main() { 184 // pulumi.Run(func(ctx *pulumi.Context) error { 185 // tmpJSON0, err := json.Marshal([]map[string]interface{}{ 186 // map[string]interface{}{ 187 // "Description": "Public access to collection and Dashboards endpoint for example collection", 188 // "Rules": []map[string]interface{}{ 189 // map[string]interface{}{ 190 // "ResourceType": "collection", 191 // "Resource": []string{ 192 // "collection/example-collection", 193 // }, 194 // }, 195 // map[string]interface{}{ 196 // "ResourceType": "dashboard", 197 // "Resource": []string{ 198 // "collection/example-collection", 199 // }, 200 // }, 201 // }, 202 // "AllowFromPublic": true, 203 // }, 204 // }) 205 // if err != nil { 206 // return err 207 // } 208 // json0 := string(tmpJSON0) 209 // _, err = opensearch.NewServerlessSecurityPolicy(ctx, "example", &opensearch.ServerlessSecurityPolicyArgs{ 210 // Name: pulumi.String("example"), 211 // Type: pulumi.String("network"), 212 // Description: pulumi.String("Public access"), 213 // Policy: pulumi.String(json0), 214 // }) 215 // if err != nil { 216 // return err 217 // } 218 // return nil 219 // }) 220 // } 221 // 222 // ``` 223 // <!--End PulumiCodeChooser --> 224 // 225 // ### Allow VPC access to the collection endpoint and the Dashboards endpoint 226 // 227 // <!--Start PulumiCodeChooser --> 228 // ```go 229 // package main 230 // 231 // import ( 232 // 233 // "encoding/json" 234 // 235 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 236 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 237 // 238 // ) 239 // 240 // func main() { 241 // pulumi.Run(func(ctx *pulumi.Context) error { 242 // tmpJSON0, err := json.Marshal([]map[string]interface{}{ 243 // map[string]interface{}{ 244 // "Description": "VPC access to collection and Dashboards endpoint for example collection", 245 // "Rules": []map[string]interface{}{ 246 // map[string]interface{}{ 247 // "ResourceType": "collection", 248 // "Resource": []string{ 249 // "collection/example-collection", 250 // }, 251 // }, 252 // map[string]interface{}{ 253 // "ResourceType": "dashboard", 254 // "Resource": []string{ 255 // "collection/example-collection", 256 // }, 257 // }, 258 // }, 259 // "AllowFromPublic": false, 260 // "SourceVPCEs": []string{ 261 // "vpce-050f79086ee71ac05", 262 // }, 263 // }, 264 // }) 265 // if err != nil { 266 // return err 267 // } 268 // json0 := string(tmpJSON0) 269 // _, err = opensearch.NewServerlessSecurityPolicy(ctx, "example", &opensearch.ServerlessSecurityPolicyArgs{ 270 // Name: pulumi.String("example"), 271 // Type: pulumi.String("network"), 272 // Description: pulumi.String("VPC access"), 273 // Policy: pulumi.String(json0), 274 // }) 275 // if err != nil { 276 // return err 277 // } 278 // return nil 279 // }) 280 // } 281 // 282 // ``` 283 // <!--End PulumiCodeChooser --> 284 // 285 // ### Mixed access for different collections 286 // 287 // <!--Start PulumiCodeChooser --> 288 // ```go 289 // package main 290 // 291 // import ( 292 // 293 // "encoding/json" 294 // 295 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 296 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 297 // 298 // ) 299 // 300 // func main() { 301 // pulumi.Run(func(ctx *pulumi.Context) error { 302 // tmpJSON0, err := json.Marshal([]interface{}{ 303 // map[string]interface{}{ 304 // "Description": "Marketing access", 305 // "Rules": []map[string]interface{}{ 306 // map[string]interface{}{ 307 // "ResourceType": "collection", 308 // "Resource": []string{ 309 // "collection/marketing*", 310 // }, 311 // }, 312 // map[string]interface{}{ 313 // "ResourceType": "dashboard", 314 // "Resource": []string{ 315 // "collection/marketing*", 316 // }, 317 // }, 318 // }, 319 // "AllowFromPublic": false, 320 // "SourceVPCEs": []string{ 321 // "vpce-050f79086ee71ac05", 322 // }, 323 // }, 324 // map[string]interface{}{ 325 // "Description": "Sales access", 326 // "Rules": []map[string]interface{}{ 327 // map[string]interface{}{ 328 // "ResourceType": "collection", 329 // "Resource": []string{ 330 // "collection/finance", 331 // }, 332 // }, 333 // }, 334 // "AllowFromPublic": true, 335 // }, 336 // }) 337 // if err != nil { 338 // return err 339 // } 340 // json0 := string(tmpJSON0) 341 // _, err = opensearch.NewServerlessSecurityPolicy(ctx, "example", &opensearch.ServerlessSecurityPolicyArgs{ 342 // Name: pulumi.String("example"), 343 // Type: pulumi.String("network"), 344 // Description: pulumi.String("Mixed access for marketing and sales"), 345 // Policy: pulumi.String(json0), 346 // }) 347 // if err != nil { 348 // return err 349 // } 350 // return nil 351 // }) 352 // } 353 // 354 // ``` 355 // <!--End PulumiCodeChooser --> 356 // 357 // ## Import 358 // 359 // Using `pulumi import`, import OpenSearchServerless Security Policy using the `name` and `type` arguments separated by a slash (`/`). For example: 360 // 361 // ```sh 362 // $ pulumi import aws:opensearch/serverlessSecurityPolicy:ServerlessSecurityPolicy example example/encryption 363 // ``` 364 type ServerlessSecurityPolicy struct { 365 pulumi.CustomResourceState 366 367 // Description of the policy. Typically used to store information about the permissions defined in the policy. 368 Description pulumi.StringPtrOutput `pulumi:"description"` 369 // Name of the policy. 370 Name pulumi.StringOutput `pulumi:"name"` 371 // JSON policy document to use as the content for the new policy 372 Policy pulumi.StringOutput `pulumi:"policy"` 373 // Version of the policy. 374 PolicyVersion pulumi.StringOutput `pulumi:"policyVersion"` 375 // Type of security policy. One of `encryption` or `network`. 376 // 377 // The following arguments are optional: 378 Type pulumi.StringOutput `pulumi:"type"` 379 } 380 381 // NewServerlessSecurityPolicy registers a new resource with the given unique name, arguments, and options. 382 func NewServerlessSecurityPolicy(ctx *pulumi.Context, 383 name string, args *ServerlessSecurityPolicyArgs, opts ...pulumi.ResourceOption) (*ServerlessSecurityPolicy, error) { 384 if args == nil { 385 return nil, errors.New("missing one or more required arguments") 386 } 387 388 if args.Policy == nil { 389 return nil, errors.New("invalid value for required argument 'Policy'") 390 } 391 if args.Type == nil { 392 return nil, errors.New("invalid value for required argument 'Type'") 393 } 394 opts = internal.PkgResourceDefaultOpts(opts) 395 var resource ServerlessSecurityPolicy 396 err := ctx.RegisterResource("aws:opensearch/serverlessSecurityPolicy:ServerlessSecurityPolicy", name, args, &resource, opts...) 397 if err != nil { 398 return nil, err 399 } 400 return &resource, nil 401 } 402 403 // GetServerlessSecurityPolicy gets an existing ServerlessSecurityPolicy resource's state with the given name, ID, and optional 404 // state properties that are used to uniquely qualify the lookup (nil if not required). 405 func GetServerlessSecurityPolicy(ctx *pulumi.Context, 406 name string, id pulumi.IDInput, state *ServerlessSecurityPolicyState, opts ...pulumi.ResourceOption) (*ServerlessSecurityPolicy, error) { 407 var resource ServerlessSecurityPolicy 408 err := ctx.ReadResource("aws:opensearch/serverlessSecurityPolicy:ServerlessSecurityPolicy", name, id, state, &resource, opts...) 409 if err != nil { 410 return nil, err 411 } 412 return &resource, nil 413 } 414 415 // Input properties used for looking up and filtering ServerlessSecurityPolicy resources. 416 type serverlessSecurityPolicyState struct { 417 // Description of the policy. Typically used to store information about the permissions defined in the policy. 418 Description *string `pulumi:"description"` 419 // Name of the policy. 420 Name *string `pulumi:"name"` 421 // JSON policy document to use as the content for the new policy 422 Policy *string `pulumi:"policy"` 423 // Version of the policy. 424 PolicyVersion *string `pulumi:"policyVersion"` 425 // Type of security policy. One of `encryption` or `network`. 426 // 427 // The following arguments are optional: 428 Type *string `pulumi:"type"` 429 } 430 431 type ServerlessSecurityPolicyState struct { 432 // Description of the policy. Typically used to store information about the permissions defined in the policy. 433 Description pulumi.StringPtrInput 434 // Name of the policy. 435 Name pulumi.StringPtrInput 436 // JSON policy document to use as the content for the new policy 437 Policy pulumi.StringPtrInput 438 // Version of the policy. 439 PolicyVersion pulumi.StringPtrInput 440 // Type of security policy. One of `encryption` or `network`. 441 // 442 // The following arguments are optional: 443 Type pulumi.StringPtrInput 444 } 445 446 func (ServerlessSecurityPolicyState) ElementType() reflect.Type { 447 return reflect.TypeOf((*serverlessSecurityPolicyState)(nil)).Elem() 448 } 449 450 type serverlessSecurityPolicyArgs struct { 451 // Description of the policy. Typically used to store information about the permissions defined in the policy. 452 Description *string `pulumi:"description"` 453 // Name of the policy. 454 Name *string `pulumi:"name"` 455 // JSON policy document to use as the content for the new policy 456 Policy string `pulumi:"policy"` 457 // Type of security policy. One of `encryption` or `network`. 458 // 459 // The following arguments are optional: 460 Type string `pulumi:"type"` 461 } 462 463 // The set of arguments for constructing a ServerlessSecurityPolicy resource. 464 type ServerlessSecurityPolicyArgs struct { 465 // Description of the policy. Typically used to store information about the permissions defined in the policy. 466 Description pulumi.StringPtrInput 467 // Name of the policy. 468 Name pulumi.StringPtrInput 469 // JSON policy document to use as the content for the new policy 470 Policy pulumi.StringInput 471 // Type of security policy. One of `encryption` or `network`. 472 // 473 // The following arguments are optional: 474 Type pulumi.StringInput 475 } 476 477 func (ServerlessSecurityPolicyArgs) ElementType() reflect.Type { 478 return reflect.TypeOf((*serverlessSecurityPolicyArgs)(nil)).Elem() 479 } 480 481 type ServerlessSecurityPolicyInput interface { 482 pulumi.Input 483 484 ToServerlessSecurityPolicyOutput() ServerlessSecurityPolicyOutput 485 ToServerlessSecurityPolicyOutputWithContext(ctx context.Context) ServerlessSecurityPolicyOutput 486 } 487 488 func (*ServerlessSecurityPolicy) ElementType() reflect.Type { 489 return reflect.TypeOf((**ServerlessSecurityPolicy)(nil)).Elem() 490 } 491 492 func (i *ServerlessSecurityPolicy) ToServerlessSecurityPolicyOutput() ServerlessSecurityPolicyOutput { 493 return i.ToServerlessSecurityPolicyOutputWithContext(context.Background()) 494 } 495 496 func (i *ServerlessSecurityPolicy) ToServerlessSecurityPolicyOutputWithContext(ctx context.Context) ServerlessSecurityPolicyOutput { 497 return pulumi.ToOutputWithContext(ctx, i).(ServerlessSecurityPolicyOutput) 498 } 499 500 // ServerlessSecurityPolicyArrayInput is an input type that accepts ServerlessSecurityPolicyArray and ServerlessSecurityPolicyArrayOutput values. 501 // You can construct a concrete instance of `ServerlessSecurityPolicyArrayInput` via: 502 // 503 // ServerlessSecurityPolicyArray{ ServerlessSecurityPolicyArgs{...} } 504 type ServerlessSecurityPolicyArrayInput interface { 505 pulumi.Input 506 507 ToServerlessSecurityPolicyArrayOutput() ServerlessSecurityPolicyArrayOutput 508 ToServerlessSecurityPolicyArrayOutputWithContext(context.Context) ServerlessSecurityPolicyArrayOutput 509 } 510 511 type ServerlessSecurityPolicyArray []ServerlessSecurityPolicyInput 512 513 func (ServerlessSecurityPolicyArray) ElementType() reflect.Type { 514 return reflect.TypeOf((*[]*ServerlessSecurityPolicy)(nil)).Elem() 515 } 516 517 func (i ServerlessSecurityPolicyArray) ToServerlessSecurityPolicyArrayOutput() ServerlessSecurityPolicyArrayOutput { 518 return i.ToServerlessSecurityPolicyArrayOutputWithContext(context.Background()) 519 } 520 521 func (i ServerlessSecurityPolicyArray) ToServerlessSecurityPolicyArrayOutputWithContext(ctx context.Context) ServerlessSecurityPolicyArrayOutput { 522 return pulumi.ToOutputWithContext(ctx, i).(ServerlessSecurityPolicyArrayOutput) 523 } 524 525 // ServerlessSecurityPolicyMapInput is an input type that accepts ServerlessSecurityPolicyMap and ServerlessSecurityPolicyMapOutput values. 526 // You can construct a concrete instance of `ServerlessSecurityPolicyMapInput` via: 527 // 528 // ServerlessSecurityPolicyMap{ "key": ServerlessSecurityPolicyArgs{...} } 529 type ServerlessSecurityPolicyMapInput interface { 530 pulumi.Input 531 532 ToServerlessSecurityPolicyMapOutput() ServerlessSecurityPolicyMapOutput 533 ToServerlessSecurityPolicyMapOutputWithContext(context.Context) ServerlessSecurityPolicyMapOutput 534 } 535 536 type ServerlessSecurityPolicyMap map[string]ServerlessSecurityPolicyInput 537 538 func (ServerlessSecurityPolicyMap) ElementType() reflect.Type { 539 return reflect.TypeOf((*map[string]*ServerlessSecurityPolicy)(nil)).Elem() 540 } 541 542 func (i ServerlessSecurityPolicyMap) ToServerlessSecurityPolicyMapOutput() ServerlessSecurityPolicyMapOutput { 543 return i.ToServerlessSecurityPolicyMapOutputWithContext(context.Background()) 544 } 545 546 func (i ServerlessSecurityPolicyMap) ToServerlessSecurityPolicyMapOutputWithContext(ctx context.Context) ServerlessSecurityPolicyMapOutput { 547 return pulumi.ToOutputWithContext(ctx, i).(ServerlessSecurityPolicyMapOutput) 548 } 549 550 type ServerlessSecurityPolicyOutput struct{ *pulumi.OutputState } 551 552 func (ServerlessSecurityPolicyOutput) ElementType() reflect.Type { 553 return reflect.TypeOf((**ServerlessSecurityPolicy)(nil)).Elem() 554 } 555 556 func (o ServerlessSecurityPolicyOutput) ToServerlessSecurityPolicyOutput() ServerlessSecurityPolicyOutput { 557 return o 558 } 559 560 func (o ServerlessSecurityPolicyOutput) ToServerlessSecurityPolicyOutputWithContext(ctx context.Context) ServerlessSecurityPolicyOutput { 561 return o 562 } 563 564 // Description of the policy. Typically used to store information about the permissions defined in the policy. 565 func (o ServerlessSecurityPolicyOutput) Description() pulumi.StringPtrOutput { 566 return o.ApplyT(func(v *ServerlessSecurityPolicy) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 567 } 568 569 // Name of the policy. 570 func (o ServerlessSecurityPolicyOutput) Name() pulumi.StringOutput { 571 return o.ApplyT(func(v *ServerlessSecurityPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 572 } 573 574 // JSON policy document to use as the content for the new policy 575 func (o ServerlessSecurityPolicyOutput) Policy() pulumi.StringOutput { 576 return o.ApplyT(func(v *ServerlessSecurityPolicy) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput) 577 } 578 579 // Version of the policy. 580 func (o ServerlessSecurityPolicyOutput) PolicyVersion() pulumi.StringOutput { 581 return o.ApplyT(func(v *ServerlessSecurityPolicy) pulumi.StringOutput { return v.PolicyVersion }).(pulumi.StringOutput) 582 } 583 584 // Type of security policy. One of `encryption` or `network`. 585 // 586 // The following arguments are optional: 587 func (o ServerlessSecurityPolicyOutput) Type() pulumi.StringOutput { 588 return o.ApplyT(func(v *ServerlessSecurityPolicy) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput) 589 } 590 591 type ServerlessSecurityPolicyArrayOutput struct{ *pulumi.OutputState } 592 593 func (ServerlessSecurityPolicyArrayOutput) ElementType() reflect.Type { 594 return reflect.TypeOf((*[]*ServerlessSecurityPolicy)(nil)).Elem() 595 } 596 597 func (o ServerlessSecurityPolicyArrayOutput) ToServerlessSecurityPolicyArrayOutput() ServerlessSecurityPolicyArrayOutput { 598 return o 599 } 600 601 func (o ServerlessSecurityPolicyArrayOutput) ToServerlessSecurityPolicyArrayOutputWithContext(ctx context.Context) ServerlessSecurityPolicyArrayOutput { 602 return o 603 } 604 605 func (o ServerlessSecurityPolicyArrayOutput) Index(i pulumi.IntInput) ServerlessSecurityPolicyOutput { 606 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServerlessSecurityPolicy { 607 return vs[0].([]*ServerlessSecurityPolicy)[vs[1].(int)] 608 }).(ServerlessSecurityPolicyOutput) 609 } 610 611 type ServerlessSecurityPolicyMapOutput struct{ *pulumi.OutputState } 612 613 func (ServerlessSecurityPolicyMapOutput) ElementType() reflect.Type { 614 return reflect.TypeOf((*map[string]*ServerlessSecurityPolicy)(nil)).Elem() 615 } 616 617 func (o ServerlessSecurityPolicyMapOutput) ToServerlessSecurityPolicyMapOutput() ServerlessSecurityPolicyMapOutput { 618 return o 619 } 620 621 func (o ServerlessSecurityPolicyMapOutput) ToServerlessSecurityPolicyMapOutputWithContext(ctx context.Context) ServerlessSecurityPolicyMapOutput { 622 return o 623 } 624 625 func (o ServerlessSecurityPolicyMapOutput) MapIndex(k pulumi.StringInput) ServerlessSecurityPolicyOutput { 626 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServerlessSecurityPolicy { 627 return vs[0].(map[string]*ServerlessSecurityPolicy)[vs[1].(string)] 628 }).(ServerlessSecurityPolicyOutput) 629 } 630 631 func init() { 632 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessSecurityPolicyInput)(nil)).Elem(), &ServerlessSecurityPolicy{}) 633 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessSecurityPolicyArrayInput)(nil)).Elem(), ServerlessSecurityPolicyArray{}) 634 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessSecurityPolicyMapInput)(nil)).Elem(), ServerlessSecurityPolicyMap{}) 635 pulumi.RegisterOutputType(ServerlessSecurityPolicyOutput{}) 636 pulumi.RegisterOutputType(ServerlessSecurityPolicyArrayOutput{}) 637 pulumi.RegisterOutputType(ServerlessSecurityPolicyMapOutput{}) 638 }