github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appmesh/virtualGateway.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 appmesh 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 // Provides an AWS App Mesh virtual gateway resource. 16 // 17 // ## Example Usage 18 // 19 // ### Basic 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appmesh" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := appmesh.NewVirtualGateway(ctx, "example", &appmesh.VirtualGatewayArgs{ 35 // Name: pulumi.String("example-virtual-gateway"), 36 // MeshName: pulumi.String("example-service-mesh"), 37 // Spec: &appmesh.VirtualGatewaySpecArgs{ 38 // Listeners: appmesh.VirtualGatewaySpecListenerArray{ 39 // &appmesh.VirtualGatewaySpecListenerArgs{ 40 // PortMapping: &appmesh.VirtualGatewaySpecListenerPortMappingArgs{ 41 // Port: pulumi.Int(8080), 42 // Protocol: pulumi.String("http"), 43 // }, 44 // }, 45 // }, 46 // }, 47 // Tags: pulumi.StringMap{ 48 // "Environment": pulumi.String("test"), 49 // }, 50 // }) 51 // if err != nil { 52 // return err 53 // } 54 // return nil 55 // }) 56 // } 57 // 58 // ``` 59 // <!--End PulumiCodeChooser --> 60 // 61 // ### Access Logs and TLS 62 // 63 // <!--Start PulumiCodeChooser --> 64 // ```go 65 // package main 66 // 67 // import ( 68 // 69 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appmesh" 70 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 71 // 72 // ) 73 // 74 // func main() { 75 // pulumi.Run(func(ctx *pulumi.Context) error { 76 // _, err := appmesh.NewVirtualGateway(ctx, "example", &appmesh.VirtualGatewayArgs{ 77 // Name: pulumi.String("example-virtual-gateway"), 78 // MeshName: pulumi.String("example-service-mesh"), 79 // Spec: &appmesh.VirtualGatewaySpecArgs{ 80 // Listeners: appmesh.VirtualGatewaySpecListenerArray{ 81 // &appmesh.VirtualGatewaySpecListenerArgs{ 82 // PortMapping: &appmesh.VirtualGatewaySpecListenerPortMappingArgs{ 83 // Port: pulumi.Int(8080), 84 // Protocol: pulumi.String("http"), 85 // }, 86 // Tls: &appmesh.VirtualGatewaySpecListenerTlsArgs{ 87 // Certificate: &appmesh.VirtualGatewaySpecListenerTlsCertificateArgs{ 88 // Acm: &appmesh.VirtualGatewaySpecListenerTlsCertificateAcmArgs{ 89 // CertificateArn: pulumi.Any(exampleAwsAcmCertificate.Arn), 90 // }, 91 // }, 92 // Mode: pulumi.String("STRICT"), 93 // }, 94 // }, 95 // }, 96 // Logging: &appmesh.VirtualGatewaySpecLoggingArgs{ 97 // AccessLog: &appmesh.VirtualGatewaySpecLoggingAccessLogArgs{ 98 // File: &appmesh.VirtualGatewaySpecLoggingAccessLogFileArgs{ 99 // Path: pulumi.String("/var/log/access.log"), 100 // }, 101 // }, 102 // }, 103 // }, 104 // }) 105 // if err != nil { 106 // return err 107 // } 108 // return nil 109 // }) 110 // } 111 // 112 // ``` 113 // <!--End PulumiCodeChooser --> 114 // 115 // ## Import 116 // 117 // Using `pulumi import`, import App Mesh virtual gateway using `mesh_name` together with the virtual gateway's `name`. For example: 118 // 119 // ```sh 120 // $ pulumi import aws:appmesh/virtualGateway:VirtualGateway example mesh/gw1 121 // ``` 122 type VirtualGateway struct { 123 pulumi.CustomResourceState 124 125 // ARN of the virtual gateway. 126 Arn pulumi.StringOutput `pulumi:"arn"` 127 // Creation date of the virtual gateway. 128 CreatedDate pulumi.StringOutput `pulumi:"createdDate"` 129 // Last update date of the virtual gateway. 130 LastUpdatedDate pulumi.StringOutput `pulumi:"lastUpdatedDate"` 131 // Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length. 132 MeshName pulumi.StringOutput `pulumi:"meshName"` 133 // AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to. 134 MeshOwner pulumi.StringOutput `pulumi:"meshOwner"` 135 // Name to use for the virtual gateway. Must be between 1 and 255 characters in length. 136 Name pulumi.StringOutput `pulumi:"name"` 137 // Resource owner's AWS account ID. 138 ResourceOwner pulumi.StringOutput `pulumi:"resourceOwner"` 139 // Virtual gateway specification to apply. 140 Spec VirtualGatewaySpecOutput `pulumi:"spec"` 141 // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 142 Tags pulumi.StringMapOutput `pulumi:"tags"` 143 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 144 // 145 // Deprecated: Please use `tags` instead. 146 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 147 } 148 149 // NewVirtualGateway registers a new resource with the given unique name, arguments, and options. 150 func NewVirtualGateway(ctx *pulumi.Context, 151 name string, args *VirtualGatewayArgs, opts ...pulumi.ResourceOption) (*VirtualGateway, error) { 152 if args == nil { 153 return nil, errors.New("missing one or more required arguments") 154 } 155 156 if args.MeshName == nil { 157 return nil, errors.New("invalid value for required argument 'MeshName'") 158 } 159 if args.Spec == nil { 160 return nil, errors.New("invalid value for required argument 'Spec'") 161 } 162 opts = internal.PkgResourceDefaultOpts(opts) 163 var resource VirtualGateway 164 err := ctx.RegisterResource("aws:appmesh/virtualGateway:VirtualGateway", name, args, &resource, opts...) 165 if err != nil { 166 return nil, err 167 } 168 return &resource, nil 169 } 170 171 // GetVirtualGateway gets an existing VirtualGateway resource's state with the given name, ID, and optional 172 // state properties that are used to uniquely qualify the lookup (nil if not required). 173 func GetVirtualGateway(ctx *pulumi.Context, 174 name string, id pulumi.IDInput, state *VirtualGatewayState, opts ...pulumi.ResourceOption) (*VirtualGateway, error) { 175 var resource VirtualGateway 176 err := ctx.ReadResource("aws:appmesh/virtualGateway:VirtualGateway", name, id, state, &resource, opts...) 177 if err != nil { 178 return nil, err 179 } 180 return &resource, nil 181 } 182 183 // Input properties used for looking up and filtering VirtualGateway resources. 184 type virtualGatewayState struct { 185 // ARN of the virtual gateway. 186 Arn *string `pulumi:"arn"` 187 // Creation date of the virtual gateway. 188 CreatedDate *string `pulumi:"createdDate"` 189 // Last update date of the virtual gateway. 190 LastUpdatedDate *string `pulumi:"lastUpdatedDate"` 191 // Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length. 192 MeshName *string `pulumi:"meshName"` 193 // AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to. 194 MeshOwner *string `pulumi:"meshOwner"` 195 // Name to use for the virtual gateway. Must be between 1 and 255 characters in length. 196 Name *string `pulumi:"name"` 197 // Resource owner's AWS account ID. 198 ResourceOwner *string `pulumi:"resourceOwner"` 199 // Virtual gateway specification to apply. 200 Spec *VirtualGatewaySpec `pulumi:"spec"` 201 // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 202 Tags map[string]string `pulumi:"tags"` 203 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 204 // 205 // Deprecated: Please use `tags` instead. 206 TagsAll map[string]string `pulumi:"tagsAll"` 207 } 208 209 type VirtualGatewayState struct { 210 // ARN of the virtual gateway. 211 Arn pulumi.StringPtrInput 212 // Creation date of the virtual gateway. 213 CreatedDate pulumi.StringPtrInput 214 // Last update date of the virtual gateway. 215 LastUpdatedDate pulumi.StringPtrInput 216 // Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length. 217 MeshName pulumi.StringPtrInput 218 // AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to. 219 MeshOwner pulumi.StringPtrInput 220 // Name to use for the virtual gateway. Must be between 1 and 255 characters in length. 221 Name pulumi.StringPtrInput 222 // Resource owner's AWS account ID. 223 ResourceOwner pulumi.StringPtrInput 224 // Virtual gateway specification to apply. 225 Spec VirtualGatewaySpecPtrInput 226 // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 227 Tags pulumi.StringMapInput 228 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 229 // 230 // Deprecated: Please use `tags` instead. 231 TagsAll pulumi.StringMapInput 232 } 233 234 func (VirtualGatewayState) ElementType() reflect.Type { 235 return reflect.TypeOf((*virtualGatewayState)(nil)).Elem() 236 } 237 238 type virtualGatewayArgs struct { 239 // Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length. 240 MeshName string `pulumi:"meshName"` 241 // AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to. 242 MeshOwner *string `pulumi:"meshOwner"` 243 // Name to use for the virtual gateway. Must be between 1 and 255 characters in length. 244 Name *string `pulumi:"name"` 245 // Virtual gateway specification to apply. 246 Spec VirtualGatewaySpec `pulumi:"spec"` 247 // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 248 Tags map[string]string `pulumi:"tags"` 249 } 250 251 // The set of arguments for constructing a VirtualGateway resource. 252 type VirtualGatewayArgs struct { 253 // Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length. 254 MeshName pulumi.StringInput 255 // AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to. 256 MeshOwner pulumi.StringPtrInput 257 // Name to use for the virtual gateway. Must be between 1 and 255 characters in length. 258 Name pulumi.StringPtrInput 259 // Virtual gateway specification to apply. 260 Spec VirtualGatewaySpecInput 261 // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 262 Tags pulumi.StringMapInput 263 } 264 265 func (VirtualGatewayArgs) ElementType() reflect.Type { 266 return reflect.TypeOf((*virtualGatewayArgs)(nil)).Elem() 267 } 268 269 type VirtualGatewayInput interface { 270 pulumi.Input 271 272 ToVirtualGatewayOutput() VirtualGatewayOutput 273 ToVirtualGatewayOutputWithContext(ctx context.Context) VirtualGatewayOutput 274 } 275 276 func (*VirtualGateway) ElementType() reflect.Type { 277 return reflect.TypeOf((**VirtualGateway)(nil)).Elem() 278 } 279 280 func (i *VirtualGateway) ToVirtualGatewayOutput() VirtualGatewayOutput { 281 return i.ToVirtualGatewayOutputWithContext(context.Background()) 282 } 283 284 func (i *VirtualGateway) ToVirtualGatewayOutputWithContext(ctx context.Context) VirtualGatewayOutput { 285 return pulumi.ToOutputWithContext(ctx, i).(VirtualGatewayOutput) 286 } 287 288 // VirtualGatewayArrayInput is an input type that accepts VirtualGatewayArray and VirtualGatewayArrayOutput values. 289 // You can construct a concrete instance of `VirtualGatewayArrayInput` via: 290 // 291 // VirtualGatewayArray{ VirtualGatewayArgs{...} } 292 type VirtualGatewayArrayInput interface { 293 pulumi.Input 294 295 ToVirtualGatewayArrayOutput() VirtualGatewayArrayOutput 296 ToVirtualGatewayArrayOutputWithContext(context.Context) VirtualGatewayArrayOutput 297 } 298 299 type VirtualGatewayArray []VirtualGatewayInput 300 301 func (VirtualGatewayArray) ElementType() reflect.Type { 302 return reflect.TypeOf((*[]*VirtualGateway)(nil)).Elem() 303 } 304 305 func (i VirtualGatewayArray) ToVirtualGatewayArrayOutput() VirtualGatewayArrayOutput { 306 return i.ToVirtualGatewayArrayOutputWithContext(context.Background()) 307 } 308 309 func (i VirtualGatewayArray) ToVirtualGatewayArrayOutputWithContext(ctx context.Context) VirtualGatewayArrayOutput { 310 return pulumi.ToOutputWithContext(ctx, i).(VirtualGatewayArrayOutput) 311 } 312 313 // VirtualGatewayMapInput is an input type that accepts VirtualGatewayMap and VirtualGatewayMapOutput values. 314 // You can construct a concrete instance of `VirtualGatewayMapInput` via: 315 // 316 // VirtualGatewayMap{ "key": VirtualGatewayArgs{...} } 317 type VirtualGatewayMapInput interface { 318 pulumi.Input 319 320 ToVirtualGatewayMapOutput() VirtualGatewayMapOutput 321 ToVirtualGatewayMapOutputWithContext(context.Context) VirtualGatewayMapOutput 322 } 323 324 type VirtualGatewayMap map[string]VirtualGatewayInput 325 326 func (VirtualGatewayMap) ElementType() reflect.Type { 327 return reflect.TypeOf((*map[string]*VirtualGateway)(nil)).Elem() 328 } 329 330 func (i VirtualGatewayMap) ToVirtualGatewayMapOutput() VirtualGatewayMapOutput { 331 return i.ToVirtualGatewayMapOutputWithContext(context.Background()) 332 } 333 334 func (i VirtualGatewayMap) ToVirtualGatewayMapOutputWithContext(ctx context.Context) VirtualGatewayMapOutput { 335 return pulumi.ToOutputWithContext(ctx, i).(VirtualGatewayMapOutput) 336 } 337 338 type VirtualGatewayOutput struct{ *pulumi.OutputState } 339 340 func (VirtualGatewayOutput) ElementType() reflect.Type { 341 return reflect.TypeOf((**VirtualGateway)(nil)).Elem() 342 } 343 344 func (o VirtualGatewayOutput) ToVirtualGatewayOutput() VirtualGatewayOutput { 345 return o 346 } 347 348 func (o VirtualGatewayOutput) ToVirtualGatewayOutputWithContext(ctx context.Context) VirtualGatewayOutput { 349 return o 350 } 351 352 // ARN of the virtual gateway. 353 func (o VirtualGatewayOutput) Arn() pulumi.StringOutput { 354 return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 355 } 356 357 // Creation date of the virtual gateway. 358 func (o VirtualGatewayOutput) CreatedDate() pulumi.StringOutput { 359 return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput) 360 } 361 362 // Last update date of the virtual gateway. 363 func (o VirtualGatewayOutput) LastUpdatedDate() pulumi.StringOutput { 364 return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.LastUpdatedDate }).(pulumi.StringOutput) 365 } 366 367 // Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length. 368 func (o VirtualGatewayOutput) MeshName() pulumi.StringOutput { 369 return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.MeshName }).(pulumi.StringOutput) 370 } 371 372 // AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to. 373 func (o VirtualGatewayOutput) MeshOwner() pulumi.StringOutput { 374 return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.MeshOwner }).(pulumi.StringOutput) 375 } 376 377 // Name to use for the virtual gateway. Must be between 1 and 255 characters in length. 378 func (o VirtualGatewayOutput) Name() pulumi.StringOutput { 379 return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 380 } 381 382 // Resource owner's AWS account ID. 383 func (o VirtualGatewayOutput) ResourceOwner() pulumi.StringOutput { 384 return o.ApplyT(func(v *VirtualGateway) pulumi.StringOutput { return v.ResourceOwner }).(pulumi.StringOutput) 385 } 386 387 // Virtual gateway specification to apply. 388 func (o VirtualGatewayOutput) Spec() VirtualGatewaySpecOutput { 389 return o.ApplyT(func(v *VirtualGateway) VirtualGatewaySpecOutput { return v.Spec }).(VirtualGatewaySpecOutput) 390 } 391 392 // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 393 func (o VirtualGatewayOutput) Tags() pulumi.StringMapOutput { 394 return o.ApplyT(func(v *VirtualGateway) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 395 } 396 397 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 398 // 399 // Deprecated: Please use `tags` instead. 400 func (o VirtualGatewayOutput) TagsAll() pulumi.StringMapOutput { 401 return o.ApplyT(func(v *VirtualGateway) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 402 } 403 404 type VirtualGatewayArrayOutput struct{ *pulumi.OutputState } 405 406 func (VirtualGatewayArrayOutput) ElementType() reflect.Type { 407 return reflect.TypeOf((*[]*VirtualGateway)(nil)).Elem() 408 } 409 410 func (o VirtualGatewayArrayOutput) ToVirtualGatewayArrayOutput() VirtualGatewayArrayOutput { 411 return o 412 } 413 414 func (o VirtualGatewayArrayOutput) ToVirtualGatewayArrayOutputWithContext(ctx context.Context) VirtualGatewayArrayOutput { 415 return o 416 } 417 418 func (o VirtualGatewayArrayOutput) Index(i pulumi.IntInput) VirtualGatewayOutput { 419 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VirtualGateway { 420 return vs[0].([]*VirtualGateway)[vs[1].(int)] 421 }).(VirtualGatewayOutput) 422 } 423 424 type VirtualGatewayMapOutput struct{ *pulumi.OutputState } 425 426 func (VirtualGatewayMapOutput) ElementType() reflect.Type { 427 return reflect.TypeOf((*map[string]*VirtualGateway)(nil)).Elem() 428 } 429 430 func (o VirtualGatewayMapOutput) ToVirtualGatewayMapOutput() VirtualGatewayMapOutput { 431 return o 432 } 433 434 func (o VirtualGatewayMapOutput) ToVirtualGatewayMapOutputWithContext(ctx context.Context) VirtualGatewayMapOutput { 435 return o 436 } 437 438 func (o VirtualGatewayMapOutput) MapIndex(k pulumi.StringInput) VirtualGatewayOutput { 439 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VirtualGateway { 440 return vs[0].(map[string]*VirtualGateway)[vs[1].(string)] 441 }).(VirtualGatewayOutput) 442 } 443 444 func init() { 445 pulumi.RegisterInputType(reflect.TypeOf((*VirtualGatewayInput)(nil)).Elem(), &VirtualGateway{}) 446 pulumi.RegisterInputType(reflect.TypeOf((*VirtualGatewayArrayInput)(nil)).Elem(), VirtualGatewayArray{}) 447 pulumi.RegisterInputType(reflect.TypeOf((*VirtualGatewayMapInput)(nil)).Elem(), VirtualGatewayMap{}) 448 pulumi.RegisterOutputType(VirtualGatewayOutput{}) 449 pulumi.RegisterOutputType(VirtualGatewayArrayOutput{}) 450 pulumi.RegisterOutputType(VirtualGatewayMapOutput{}) 451 }