github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/globalaccelerator/customRoutingEndpointGroup.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 globalaccelerator
     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 a Global Accelerator custom routing endpoint group.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/globalaccelerator"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := globalaccelerator.NewCustomRoutingEndpointGroup(ctx, "example", &globalaccelerator.CustomRoutingEndpointGroupArgs{
    33  //				ListenerArn: pulumi.Any(exampleAwsGlobalacceleratorCustomRoutingListener.Id),
    34  //				DestinationConfigurations: globalaccelerator.CustomRoutingEndpointGroupDestinationConfigurationArray{
    35  //					&globalaccelerator.CustomRoutingEndpointGroupDestinationConfigurationArgs{
    36  //						FromPort: pulumi.Int(80),
    37  //						ToPort:   pulumi.Int(8080),
    38  //						Protocols: pulumi.StringArray{
    39  //							pulumi.String("TCP"),
    40  //						},
    41  //					},
    42  //				},
    43  //				EndpointConfigurations: globalaccelerator.CustomRoutingEndpointGroupEndpointConfigurationArray{
    44  //					&globalaccelerator.CustomRoutingEndpointGroupEndpointConfigurationArgs{
    45  //						EndpointId: pulumi.Any(exampleAwsSubnet.Id),
    46  //					},
    47  //				},
    48  //			})
    49  //			if err != nil {
    50  //				return err
    51  //			}
    52  //			return nil
    53  //		})
    54  //	}
    55  //
    56  // ```
    57  // <!--End PulumiCodeChooser -->
    58  //
    59  // ## Import
    60  //
    61  // Using `pulumi import`, import Global Accelerator custom routing endpoint groups using the `id`. For example:
    62  //
    63  // ```sh
    64  // $ pulumi import aws:globalaccelerator/customRoutingEndpointGroup:CustomRoutingEndpointGroup example arn:aws:globalaccelerator::111111111111:accelerator/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/listener/xxxxxxx/endpoint-group/xxxxxxxx
    65  // ```
    66  type CustomRoutingEndpointGroup struct {
    67  	pulumi.CustomResourceState
    68  
    69  	// The Amazon Resource Name (ARN) of the custom routing endpoint group.
    70  	Arn pulumi.StringOutput `pulumi:"arn"`
    71  	// The port ranges and protocols for all endpoints in a custom routing endpoint group to accept client traffic on. Fields documented below.
    72  	DestinationConfigurations CustomRoutingEndpointGroupDestinationConfigurationArrayOutput `pulumi:"destinationConfigurations"`
    73  	// The list of endpoint objects. Fields documented below.
    74  	EndpointConfigurations CustomRoutingEndpointGroupEndpointConfigurationArrayOutput `pulumi:"endpointConfigurations"`
    75  	// The name of the AWS Region where the custom routing endpoint group is located.
    76  	EndpointGroupRegion pulumi.StringOutput `pulumi:"endpointGroupRegion"`
    77  	// The Amazon Resource Name (ARN) of the custom routing listener.
    78  	ListenerArn pulumi.StringOutput `pulumi:"listenerArn"`
    79  }
    80  
    81  // NewCustomRoutingEndpointGroup registers a new resource with the given unique name, arguments, and options.
    82  func NewCustomRoutingEndpointGroup(ctx *pulumi.Context,
    83  	name string, args *CustomRoutingEndpointGroupArgs, opts ...pulumi.ResourceOption) (*CustomRoutingEndpointGroup, error) {
    84  	if args == nil {
    85  		return nil, errors.New("missing one or more required arguments")
    86  	}
    87  
    88  	if args.DestinationConfigurations == nil {
    89  		return nil, errors.New("invalid value for required argument 'DestinationConfigurations'")
    90  	}
    91  	if args.ListenerArn == nil {
    92  		return nil, errors.New("invalid value for required argument 'ListenerArn'")
    93  	}
    94  	opts = internal.PkgResourceDefaultOpts(opts)
    95  	var resource CustomRoutingEndpointGroup
    96  	err := ctx.RegisterResource("aws:globalaccelerator/customRoutingEndpointGroup:CustomRoutingEndpointGroup", name, args, &resource, opts...)
    97  	if err != nil {
    98  		return nil, err
    99  	}
   100  	return &resource, nil
   101  }
   102  
   103  // GetCustomRoutingEndpointGroup gets an existing CustomRoutingEndpointGroup resource's state with the given name, ID, and optional
   104  // state properties that are used to uniquely qualify the lookup (nil if not required).
   105  func GetCustomRoutingEndpointGroup(ctx *pulumi.Context,
   106  	name string, id pulumi.IDInput, state *CustomRoutingEndpointGroupState, opts ...pulumi.ResourceOption) (*CustomRoutingEndpointGroup, error) {
   107  	var resource CustomRoutingEndpointGroup
   108  	err := ctx.ReadResource("aws:globalaccelerator/customRoutingEndpointGroup:CustomRoutingEndpointGroup", name, id, state, &resource, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return &resource, nil
   113  }
   114  
   115  // Input properties used for looking up and filtering CustomRoutingEndpointGroup resources.
   116  type customRoutingEndpointGroupState struct {
   117  	// The Amazon Resource Name (ARN) of the custom routing endpoint group.
   118  	Arn *string `pulumi:"arn"`
   119  	// The port ranges and protocols for all endpoints in a custom routing endpoint group to accept client traffic on. Fields documented below.
   120  	DestinationConfigurations []CustomRoutingEndpointGroupDestinationConfiguration `pulumi:"destinationConfigurations"`
   121  	// The list of endpoint objects. Fields documented below.
   122  	EndpointConfigurations []CustomRoutingEndpointGroupEndpointConfiguration `pulumi:"endpointConfigurations"`
   123  	// The name of the AWS Region where the custom routing endpoint group is located.
   124  	EndpointGroupRegion *string `pulumi:"endpointGroupRegion"`
   125  	// The Amazon Resource Name (ARN) of the custom routing listener.
   126  	ListenerArn *string `pulumi:"listenerArn"`
   127  }
   128  
   129  type CustomRoutingEndpointGroupState struct {
   130  	// The Amazon Resource Name (ARN) of the custom routing endpoint group.
   131  	Arn pulumi.StringPtrInput
   132  	// The port ranges and protocols for all endpoints in a custom routing endpoint group to accept client traffic on. Fields documented below.
   133  	DestinationConfigurations CustomRoutingEndpointGroupDestinationConfigurationArrayInput
   134  	// The list of endpoint objects. Fields documented below.
   135  	EndpointConfigurations CustomRoutingEndpointGroupEndpointConfigurationArrayInput
   136  	// The name of the AWS Region where the custom routing endpoint group is located.
   137  	EndpointGroupRegion pulumi.StringPtrInput
   138  	// The Amazon Resource Name (ARN) of the custom routing listener.
   139  	ListenerArn pulumi.StringPtrInput
   140  }
   141  
   142  func (CustomRoutingEndpointGroupState) ElementType() reflect.Type {
   143  	return reflect.TypeOf((*customRoutingEndpointGroupState)(nil)).Elem()
   144  }
   145  
   146  type customRoutingEndpointGroupArgs struct {
   147  	// The port ranges and protocols for all endpoints in a custom routing endpoint group to accept client traffic on. Fields documented below.
   148  	DestinationConfigurations []CustomRoutingEndpointGroupDestinationConfiguration `pulumi:"destinationConfigurations"`
   149  	// The list of endpoint objects. Fields documented below.
   150  	EndpointConfigurations []CustomRoutingEndpointGroupEndpointConfiguration `pulumi:"endpointConfigurations"`
   151  	// The name of the AWS Region where the custom routing endpoint group is located.
   152  	EndpointGroupRegion *string `pulumi:"endpointGroupRegion"`
   153  	// The Amazon Resource Name (ARN) of the custom routing listener.
   154  	ListenerArn string `pulumi:"listenerArn"`
   155  }
   156  
   157  // The set of arguments for constructing a CustomRoutingEndpointGroup resource.
   158  type CustomRoutingEndpointGroupArgs struct {
   159  	// The port ranges and protocols for all endpoints in a custom routing endpoint group to accept client traffic on. Fields documented below.
   160  	DestinationConfigurations CustomRoutingEndpointGroupDestinationConfigurationArrayInput
   161  	// The list of endpoint objects. Fields documented below.
   162  	EndpointConfigurations CustomRoutingEndpointGroupEndpointConfigurationArrayInput
   163  	// The name of the AWS Region where the custom routing endpoint group is located.
   164  	EndpointGroupRegion pulumi.StringPtrInput
   165  	// The Amazon Resource Name (ARN) of the custom routing listener.
   166  	ListenerArn pulumi.StringInput
   167  }
   168  
   169  func (CustomRoutingEndpointGroupArgs) ElementType() reflect.Type {
   170  	return reflect.TypeOf((*customRoutingEndpointGroupArgs)(nil)).Elem()
   171  }
   172  
   173  type CustomRoutingEndpointGroupInput interface {
   174  	pulumi.Input
   175  
   176  	ToCustomRoutingEndpointGroupOutput() CustomRoutingEndpointGroupOutput
   177  	ToCustomRoutingEndpointGroupOutputWithContext(ctx context.Context) CustomRoutingEndpointGroupOutput
   178  }
   179  
   180  func (*CustomRoutingEndpointGroup) ElementType() reflect.Type {
   181  	return reflect.TypeOf((**CustomRoutingEndpointGroup)(nil)).Elem()
   182  }
   183  
   184  func (i *CustomRoutingEndpointGroup) ToCustomRoutingEndpointGroupOutput() CustomRoutingEndpointGroupOutput {
   185  	return i.ToCustomRoutingEndpointGroupOutputWithContext(context.Background())
   186  }
   187  
   188  func (i *CustomRoutingEndpointGroup) ToCustomRoutingEndpointGroupOutputWithContext(ctx context.Context) CustomRoutingEndpointGroupOutput {
   189  	return pulumi.ToOutputWithContext(ctx, i).(CustomRoutingEndpointGroupOutput)
   190  }
   191  
   192  // CustomRoutingEndpointGroupArrayInput is an input type that accepts CustomRoutingEndpointGroupArray and CustomRoutingEndpointGroupArrayOutput values.
   193  // You can construct a concrete instance of `CustomRoutingEndpointGroupArrayInput` via:
   194  //
   195  //	CustomRoutingEndpointGroupArray{ CustomRoutingEndpointGroupArgs{...} }
   196  type CustomRoutingEndpointGroupArrayInput interface {
   197  	pulumi.Input
   198  
   199  	ToCustomRoutingEndpointGroupArrayOutput() CustomRoutingEndpointGroupArrayOutput
   200  	ToCustomRoutingEndpointGroupArrayOutputWithContext(context.Context) CustomRoutingEndpointGroupArrayOutput
   201  }
   202  
   203  type CustomRoutingEndpointGroupArray []CustomRoutingEndpointGroupInput
   204  
   205  func (CustomRoutingEndpointGroupArray) ElementType() reflect.Type {
   206  	return reflect.TypeOf((*[]*CustomRoutingEndpointGroup)(nil)).Elem()
   207  }
   208  
   209  func (i CustomRoutingEndpointGroupArray) ToCustomRoutingEndpointGroupArrayOutput() CustomRoutingEndpointGroupArrayOutput {
   210  	return i.ToCustomRoutingEndpointGroupArrayOutputWithContext(context.Background())
   211  }
   212  
   213  func (i CustomRoutingEndpointGroupArray) ToCustomRoutingEndpointGroupArrayOutputWithContext(ctx context.Context) CustomRoutingEndpointGroupArrayOutput {
   214  	return pulumi.ToOutputWithContext(ctx, i).(CustomRoutingEndpointGroupArrayOutput)
   215  }
   216  
   217  // CustomRoutingEndpointGroupMapInput is an input type that accepts CustomRoutingEndpointGroupMap and CustomRoutingEndpointGroupMapOutput values.
   218  // You can construct a concrete instance of `CustomRoutingEndpointGroupMapInput` via:
   219  //
   220  //	CustomRoutingEndpointGroupMap{ "key": CustomRoutingEndpointGroupArgs{...} }
   221  type CustomRoutingEndpointGroupMapInput interface {
   222  	pulumi.Input
   223  
   224  	ToCustomRoutingEndpointGroupMapOutput() CustomRoutingEndpointGroupMapOutput
   225  	ToCustomRoutingEndpointGroupMapOutputWithContext(context.Context) CustomRoutingEndpointGroupMapOutput
   226  }
   227  
   228  type CustomRoutingEndpointGroupMap map[string]CustomRoutingEndpointGroupInput
   229  
   230  func (CustomRoutingEndpointGroupMap) ElementType() reflect.Type {
   231  	return reflect.TypeOf((*map[string]*CustomRoutingEndpointGroup)(nil)).Elem()
   232  }
   233  
   234  func (i CustomRoutingEndpointGroupMap) ToCustomRoutingEndpointGroupMapOutput() CustomRoutingEndpointGroupMapOutput {
   235  	return i.ToCustomRoutingEndpointGroupMapOutputWithContext(context.Background())
   236  }
   237  
   238  func (i CustomRoutingEndpointGroupMap) ToCustomRoutingEndpointGroupMapOutputWithContext(ctx context.Context) CustomRoutingEndpointGroupMapOutput {
   239  	return pulumi.ToOutputWithContext(ctx, i).(CustomRoutingEndpointGroupMapOutput)
   240  }
   241  
   242  type CustomRoutingEndpointGroupOutput struct{ *pulumi.OutputState }
   243  
   244  func (CustomRoutingEndpointGroupOutput) ElementType() reflect.Type {
   245  	return reflect.TypeOf((**CustomRoutingEndpointGroup)(nil)).Elem()
   246  }
   247  
   248  func (o CustomRoutingEndpointGroupOutput) ToCustomRoutingEndpointGroupOutput() CustomRoutingEndpointGroupOutput {
   249  	return o
   250  }
   251  
   252  func (o CustomRoutingEndpointGroupOutput) ToCustomRoutingEndpointGroupOutputWithContext(ctx context.Context) CustomRoutingEndpointGroupOutput {
   253  	return o
   254  }
   255  
   256  // The Amazon Resource Name (ARN) of the custom routing endpoint group.
   257  func (o CustomRoutingEndpointGroupOutput) Arn() pulumi.StringOutput {
   258  	return o.ApplyT(func(v *CustomRoutingEndpointGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   259  }
   260  
   261  // The port ranges and protocols for all endpoints in a custom routing endpoint group to accept client traffic on. Fields documented below.
   262  func (o CustomRoutingEndpointGroupOutput) DestinationConfigurations() CustomRoutingEndpointGroupDestinationConfigurationArrayOutput {
   263  	return o.ApplyT(func(v *CustomRoutingEndpointGroup) CustomRoutingEndpointGroupDestinationConfigurationArrayOutput {
   264  		return v.DestinationConfigurations
   265  	}).(CustomRoutingEndpointGroupDestinationConfigurationArrayOutput)
   266  }
   267  
   268  // The list of endpoint objects. Fields documented below.
   269  func (o CustomRoutingEndpointGroupOutput) EndpointConfigurations() CustomRoutingEndpointGroupEndpointConfigurationArrayOutput {
   270  	return o.ApplyT(func(v *CustomRoutingEndpointGroup) CustomRoutingEndpointGroupEndpointConfigurationArrayOutput {
   271  		return v.EndpointConfigurations
   272  	}).(CustomRoutingEndpointGroupEndpointConfigurationArrayOutput)
   273  }
   274  
   275  // The name of the AWS Region where the custom routing endpoint group is located.
   276  func (o CustomRoutingEndpointGroupOutput) EndpointGroupRegion() pulumi.StringOutput {
   277  	return o.ApplyT(func(v *CustomRoutingEndpointGroup) pulumi.StringOutput { return v.EndpointGroupRegion }).(pulumi.StringOutput)
   278  }
   279  
   280  // The Amazon Resource Name (ARN) of the custom routing listener.
   281  func (o CustomRoutingEndpointGroupOutput) ListenerArn() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *CustomRoutingEndpointGroup) pulumi.StringOutput { return v.ListenerArn }).(pulumi.StringOutput)
   283  }
   284  
   285  type CustomRoutingEndpointGroupArrayOutput struct{ *pulumi.OutputState }
   286  
   287  func (CustomRoutingEndpointGroupArrayOutput) ElementType() reflect.Type {
   288  	return reflect.TypeOf((*[]*CustomRoutingEndpointGroup)(nil)).Elem()
   289  }
   290  
   291  func (o CustomRoutingEndpointGroupArrayOutput) ToCustomRoutingEndpointGroupArrayOutput() CustomRoutingEndpointGroupArrayOutput {
   292  	return o
   293  }
   294  
   295  func (o CustomRoutingEndpointGroupArrayOutput) ToCustomRoutingEndpointGroupArrayOutputWithContext(ctx context.Context) CustomRoutingEndpointGroupArrayOutput {
   296  	return o
   297  }
   298  
   299  func (o CustomRoutingEndpointGroupArrayOutput) Index(i pulumi.IntInput) CustomRoutingEndpointGroupOutput {
   300  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomRoutingEndpointGroup {
   301  		return vs[0].([]*CustomRoutingEndpointGroup)[vs[1].(int)]
   302  	}).(CustomRoutingEndpointGroupOutput)
   303  }
   304  
   305  type CustomRoutingEndpointGroupMapOutput struct{ *pulumi.OutputState }
   306  
   307  func (CustomRoutingEndpointGroupMapOutput) ElementType() reflect.Type {
   308  	return reflect.TypeOf((*map[string]*CustomRoutingEndpointGroup)(nil)).Elem()
   309  }
   310  
   311  func (o CustomRoutingEndpointGroupMapOutput) ToCustomRoutingEndpointGroupMapOutput() CustomRoutingEndpointGroupMapOutput {
   312  	return o
   313  }
   314  
   315  func (o CustomRoutingEndpointGroupMapOutput) ToCustomRoutingEndpointGroupMapOutputWithContext(ctx context.Context) CustomRoutingEndpointGroupMapOutput {
   316  	return o
   317  }
   318  
   319  func (o CustomRoutingEndpointGroupMapOutput) MapIndex(k pulumi.StringInput) CustomRoutingEndpointGroupOutput {
   320  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomRoutingEndpointGroup {
   321  		return vs[0].(map[string]*CustomRoutingEndpointGroup)[vs[1].(string)]
   322  	}).(CustomRoutingEndpointGroupOutput)
   323  }
   324  
   325  func init() {
   326  	pulumi.RegisterInputType(reflect.TypeOf((*CustomRoutingEndpointGroupInput)(nil)).Elem(), &CustomRoutingEndpointGroup{})
   327  	pulumi.RegisterInputType(reflect.TypeOf((*CustomRoutingEndpointGroupArrayInput)(nil)).Elem(), CustomRoutingEndpointGroupArray{})
   328  	pulumi.RegisterInputType(reflect.TypeOf((*CustomRoutingEndpointGroupMapInput)(nil)).Elem(), CustomRoutingEndpointGroupMap{})
   329  	pulumi.RegisterOutputType(CustomRoutingEndpointGroupOutput{})
   330  	pulumi.RegisterOutputType(CustomRoutingEndpointGroupArrayOutput{})
   331  	pulumi.RegisterOutputType(CustomRoutingEndpointGroupMapOutput{})
   332  }