github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/dax/subnetGroup.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 dax
     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 DAX Subnet Group resource.
    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/dax"
    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 := dax.NewSubnetGroup(ctx, "example", &dax.SubnetGroupArgs{
    33  //				Name: pulumi.String("example"),
    34  //				SubnetIds: pulumi.StringArray{
    35  //					example1.Id,
    36  //					example2.Id,
    37  //				},
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Using `pulumi import`, import DAX Subnet Group using the `name`. For example:
    52  //
    53  // ```sh
    54  // $ pulumi import aws:dax/subnetGroup:SubnetGroup example my_dax_sg
    55  // ```
    56  type SubnetGroup struct {
    57  	pulumi.CustomResourceState
    58  
    59  	// A description of the subnet group.
    60  	Description pulumi.StringPtrOutput `pulumi:"description"`
    61  	// The name of the subnet group.
    62  	Name pulumi.StringOutput `pulumi:"name"`
    63  	// A list of VPC subnet IDs for the subnet group.
    64  	SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"`
    65  	// VPC ID of the subnet group.
    66  	VpcId pulumi.StringOutput `pulumi:"vpcId"`
    67  }
    68  
    69  // NewSubnetGroup registers a new resource with the given unique name, arguments, and options.
    70  func NewSubnetGroup(ctx *pulumi.Context,
    71  	name string, args *SubnetGroupArgs, opts ...pulumi.ResourceOption) (*SubnetGroup, error) {
    72  	if args == nil {
    73  		return nil, errors.New("missing one or more required arguments")
    74  	}
    75  
    76  	if args.SubnetIds == nil {
    77  		return nil, errors.New("invalid value for required argument 'SubnetIds'")
    78  	}
    79  	opts = internal.PkgResourceDefaultOpts(opts)
    80  	var resource SubnetGroup
    81  	err := ctx.RegisterResource("aws:dax/subnetGroup:SubnetGroup", name, args, &resource, opts...)
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return &resource, nil
    86  }
    87  
    88  // GetSubnetGroup gets an existing SubnetGroup resource's state with the given name, ID, and optional
    89  // state properties that are used to uniquely qualify the lookup (nil if not required).
    90  func GetSubnetGroup(ctx *pulumi.Context,
    91  	name string, id pulumi.IDInput, state *SubnetGroupState, opts ...pulumi.ResourceOption) (*SubnetGroup, error) {
    92  	var resource SubnetGroup
    93  	err := ctx.ReadResource("aws:dax/subnetGroup:SubnetGroup", name, id, state, &resource, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &resource, nil
    98  }
    99  
   100  // Input properties used for looking up and filtering SubnetGroup resources.
   101  type subnetGroupState struct {
   102  	// A description of the subnet group.
   103  	Description *string `pulumi:"description"`
   104  	// The name of the subnet group.
   105  	Name *string `pulumi:"name"`
   106  	// A list of VPC subnet IDs for the subnet group.
   107  	SubnetIds []string `pulumi:"subnetIds"`
   108  	// VPC ID of the subnet group.
   109  	VpcId *string `pulumi:"vpcId"`
   110  }
   111  
   112  type SubnetGroupState struct {
   113  	// A description of the subnet group.
   114  	Description pulumi.StringPtrInput
   115  	// The name of the subnet group.
   116  	Name pulumi.StringPtrInput
   117  	// A list of VPC subnet IDs for the subnet group.
   118  	SubnetIds pulumi.StringArrayInput
   119  	// VPC ID of the subnet group.
   120  	VpcId pulumi.StringPtrInput
   121  }
   122  
   123  func (SubnetGroupState) ElementType() reflect.Type {
   124  	return reflect.TypeOf((*subnetGroupState)(nil)).Elem()
   125  }
   126  
   127  type subnetGroupArgs struct {
   128  	// A description of the subnet group.
   129  	Description *string `pulumi:"description"`
   130  	// The name of the subnet group.
   131  	Name *string `pulumi:"name"`
   132  	// A list of VPC subnet IDs for the subnet group.
   133  	SubnetIds []string `pulumi:"subnetIds"`
   134  }
   135  
   136  // The set of arguments for constructing a SubnetGroup resource.
   137  type SubnetGroupArgs struct {
   138  	// A description of the subnet group.
   139  	Description pulumi.StringPtrInput
   140  	// The name of the subnet group.
   141  	Name pulumi.StringPtrInput
   142  	// A list of VPC subnet IDs for the subnet group.
   143  	SubnetIds pulumi.StringArrayInput
   144  }
   145  
   146  func (SubnetGroupArgs) ElementType() reflect.Type {
   147  	return reflect.TypeOf((*subnetGroupArgs)(nil)).Elem()
   148  }
   149  
   150  type SubnetGroupInput interface {
   151  	pulumi.Input
   152  
   153  	ToSubnetGroupOutput() SubnetGroupOutput
   154  	ToSubnetGroupOutputWithContext(ctx context.Context) SubnetGroupOutput
   155  }
   156  
   157  func (*SubnetGroup) ElementType() reflect.Type {
   158  	return reflect.TypeOf((**SubnetGroup)(nil)).Elem()
   159  }
   160  
   161  func (i *SubnetGroup) ToSubnetGroupOutput() SubnetGroupOutput {
   162  	return i.ToSubnetGroupOutputWithContext(context.Background())
   163  }
   164  
   165  func (i *SubnetGroup) ToSubnetGroupOutputWithContext(ctx context.Context) SubnetGroupOutput {
   166  	return pulumi.ToOutputWithContext(ctx, i).(SubnetGroupOutput)
   167  }
   168  
   169  // SubnetGroupArrayInput is an input type that accepts SubnetGroupArray and SubnetGroupArrayOutput values.
   170  // You can construct a concrete instance of `SubnetGroupArrayInput` via:
   171  //
   172  //	SubnetGroupArray{ SubnetGroupArgs{...} }
   173  type SubnetGroupArrayInput interface {
   174  	pulumi.Input
   175  
   176  	ToSubnetGroupArrayOutput() SubnetGroupArrayOutput
   177  	ToSubnetGroupArrayOutputWithContext(context.Context) SubnetGroupArrayOutput
   178  }
   179  
   180  type SubnetGroupArray []SubnetGroupInput
   181  
   182  func (SubnetGroupArray) ElementType() reflect.Type {
   183  	return reflect.TypeOf((*[]*SubnetGroup)(nil)).Elem()
   184  }
   185  
   186  func (i SubnetGroupArray) ToSubnetGroupArrayOutput() SubnetGroupArrayOutput {
   187  	return i.ToSubnetGroupArrayOutputWithContext(context.Background())
   188  }
   189  
   190  func (i SubnetGroupArray) ToSubnetGroupArrayOutputWithContext(ctx context.Context) SubnetGroupArrayOutput {
   191  	return pulumi.ToOutputWithContext(ctx, i).(SubnetGroupArrayOutput)
   192  }
   193  
   194  // SubnetGroupMapInput is an input type that accepts SubnetGroupMap and SubnetGroupMapOutput values.
   195  // You can construct a concrete instance of `SubnetGroupMapInput` via:
   196  //
   197  //	SubnetGroupMap{ "key": SubnetGroupArgs{...} }
   198  type SubnetGroupMapInput interface {
   199  	pulumi.Input
   200  
   201  	ToSubnetGroupMapOutput() SubnetGroupMapOutput
   202  	ToSubnetGroupMapOutputWithContext(context.Context) SubnetGroupMapOutput
   203  }
   204  
   205  type SubnetGroupMap map[string]SubnetGroupInput
   206  
   207  func (SubnetGroupMap) ElementType() reflect.Type {
   208  	return reflect.TypeOf((*map[string]*SubnetGroup)(nil)).Elem()
   209  }
   210  
   211  func (i SubnetGroupMap) ToSubnetGroupMapOutput() SubnetGroupMapOutput {
   212  	return i.ToSubnetGroupMapOutputWithContext(context.Background())
   213  }
   214  
   215  func (i SubnetGroupMap) ToSubnetGroupMapOutputWithContext(ctx context.Context) SubnetGroupMapOutput {
   216  	return pulumi.ToOutputWithContext(ctx, i).(SubnetGroupMapOutput)
   217  }
   218  
   219  type SubnetGroupOutput struct{ *pulumi.OutputState }
   220  
   221  func (SubnetGroupOutput) ElementType() reflect.Type {
   222  	return reflect.TypeOf((**SubnetGroup)(nil)).Elem()
   223  }
   224  
   225  func (o SubnetGroupOutput) ToSubnetGroupOutput() SubnetGroupOutput {
   226  	return o
   227  }
   228  
   229  func (o SubnetGroupOutput) ToSubnetGroupOutputWithContext(ctx context.Context) SubnetGroupOutput {
   230  	return o
   231  }
   232  
   233  // A description of the subnet group.
   234  func (o SubnetGroupOutput) Description() pulumi.StringPtrOutput {
   235  	return o.ApplyT(func(v *SubnetGroup) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   236  }
   237  
   238  // The name of the subnet group.
   239  func (o SubnetGroupOutput) Name() pulumi.StringOutput {
   240  	return o.ApplyT(func(v *SubnetGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   241  }
   242  
   243  // A list of VPC subnet IDs for the subnet group.
   244  func (o SubnetGroupOutput) SubnetIds() pulumi.StringArrayOutput {
   245  	return o.ApplyT(func(v *SubnetGroup) pulumi.StringArrayOutput { return v.SubnetIds }).(pulumi.StringArrayOutput)
   246  }
   247  
   248  // VPC ID of the subnet group.
   249  func (o SubnetGroupOutput) VpcId() pulumi.StringOutput {
   250  	return o.ApplyT(func(v *SubnetGroup) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
   251  }
   252  
   253  type SubnetGroupArrayOutput struct{ *pulumi.OutputState }
   254  
   255  func (SubnetGroupArrayOutput) ElementType() reflect.Type {
   256  	return reflect.TypeOf((*[]*SubnetGroup)(nil)).Elem()
   257  }
   258  
   259  func (o SubnetGroupArrayOutput) ToSubnetGroupArrayOutput() SubnetGroupArrayOutput {
   260  	return o
   261  }
   262  
   263  func (o SubnetGroupArrayOutput) ToSubnetGroupArrayOutputWithContext(ctx context.Context) SubnetGroupArrayOutput {
   264  	return o
   265  }
   266  
   267  func (o SubnetGroupArrayOutput) Index(i pulumi.IntInput) SubnetGroupOutput {
   268  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SubnetGroup {
   269  		return vs[0].([]*SubnetGroup)[vs[1].(int)]
   270  	}).(SubnetGroupOutput)
   271  }
   272  
   273  type SubnetGroupMapOutput struct{ *pulumi.OutputState }
   274  
   275  func (SubnetGroupMapOutput) ElementType() reflect.Type {
   276  	return reflect.TypeOf((*map[string]*SubnetGroup)(nil)).Elem()
   277  }
   278  
   279  func (o SubnetGroupMapOutput) ToSubnetGroupMapOutput() SubnetGroupMapOutput {
   280  	return o
   281  }
   282  
   283  func (o SubnetGroupMapOutput) ToSubnetGroupMapOutputWithContext(ctx context.Context) SubnetGroupMapOutput {
   284  	return o
   285  }
   286  
   287  func (o SubnetGroupMapOutput) MapIndex(k pulumi.StringInput) SubnetGroupOutput {
   288  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SubnetGroup {
   289  		return vs[0].(map[string]*SubnetGroup)[vs[1].(string)]
   290  	}).(SubnetGroupOutput)
   291  }
   292  
   293  func init() {
   294  	pulumi.RegisterInputType(reflect.TypeOf((*SubnetGroupInput)(nil)).Elem(), &SubnetGroup{})
   295  	pulumi.RegisterInputType(reflect.TypeOf((*SubnetGroupArrayInput)(nil)).Elem(), SubnetGroupArray{})
   296  	pulumi.RegisterInputType(reflect.TypeOf((*SubnetGroupMapInput)(nil)).Elem(), SubnetGroupMap{})
   297  	pulumi.RegisterOutputType(SubnetGroupOutput{})
   298  	pulumi.RegisterOutputType(SubnetGroupArrayOutput{})
   299  	pulumi.RegisterOutputType(SubnetGroupMapOutput{})
   300  }