github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rds/getSubnetGroup.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 rds
     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  // Use this data source to get information about an RDS subnet group.
    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/rds"
    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 := rds.LookupSubnetGroup(ctx, &rds.LookupSubnetGroupArgs{
    32  //				Name: "my-test-database-subnet-group",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupSubnetGroup(ctx *pulumi.Context, args *LookupSubnetGroupArgs, opts ...pulumi.InvokeOption) (*LookupSubnetGroupResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupSubnetGroupResult
    46  	err := ctx.Invoke("aws:rds/getSubnetGroup:getSubnetGroup", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getSubnetGroup.
    54  type LookupSubnetGroupArgs struct {
    55  	// Name of the RDS database subnet group.
    56  	Name string `pulumi:"name"`
    57  }
    58  
    59  // A collection of values returned by getSubnetGroup.
    60  type LookupSubnetGroupResult struct {
    61  	// ARN for the DB subnet group.
    62  	Arn string `pulumi:"arn"`
    63  	// Provides the description of the DB subnet group.
    64  	Description string `pulumi:"description"`
    65  	// The provider-assigned unique ID for this managed resource.
    66  	Id   string `pulumi:"id"`
    67  	Name string `pulumi:"name"`
    68  	// Provides the status of the DB subnet group.
    69  	Status string `pulumi:"status"`
    70  	// Contains a list of subnet identifiers.
    71  	SubnetIds []string `pulumi:"subnetIds"`
    72  	// The network type of the DB subnet group.
    73  	SupportedNetworkTypes []string `pulumi:"supportedNetworkTypes"`
    74  	// Provides the VPC ID of the DB subnet group.
    75  	VpcId string `pulumi:"vpcId"`
    76  }
    77  
    78  func LookupSubnetGroupOutput(ctx *pulumi.Context, args LookupSubnetGroupOutputArgs, opts ...pulumi.InvokeOption) LookupSubnetGroupResultOutput {
    79  	return pulumi.ToOutputWithContext(context.Background(), args).
    80  		ApplyT(func(v interface{}) (LookupSubnetGroupResult, error) {
    81  			args := v.(LookupSubnetGroupArgs)
    82  			r, err := LookupSubnetGroup(ctx, &args, opts...)
    83  			var s LookupSubnetGroupResult
    84  			if r != nil {
    85  				s = *r
    86  			}
    87  			return s, err
    88  		}).(LookupSubnetGroupResultOutput)
    89  }
    90  
    91  // A collection of arguments for invoking getSubnetGroup.
    92  type LookupSubnetGroupOutputArgs struct {
    93  	// Name of the RDS database subnet group.
    94  	Name pulumi.StringInput `pulumi:"name"`
    95  }
    96  
    97  func (LookupSubnetGroupOutputArgs) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*LookupSubnetGroupArgs)(nil)).Elem()
    99  }
   100  
   101  // A collection of values returned by getSubnetGroup.
   102  type LookupSubnetGroupResultOutput struct{ *pulumi.OutputState }
   103  
   104  func (LookupSubnetGroupResultOutput) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*LookupSubnetGroupResult)(nil)).Elem()
   106  }
   107  
   108  func (o LookupSubnetGroupResultOutput) ToLookupSubnetGroupResultOutput() LookupSubnetGroupResultOutput {
   109  	return o
   110  }
   111  
   112  func (o LookupSubnetGroupResultOutput) ToLookupSubnetGroupResultOutputWithContext(ctx context.Context) LookupSubnetGroupResultOutput {
   113  	return o
   114  }
   115  
   116  // ARN for the DB subnet group.
   117  func (o LookupSubnetGroupResultOutput) Arn() pulumi.StringOutput {
   118  	return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Arn }).(pulumi.StringOutput)
   119  }
   120  
   121  // Provides the description of the DB subnet group.
   122  func (o LookupSubnetGroupResultOutput) Description() pulumi.StringOutput {
   123  	return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Description }).(pulumi.StringOutput)
   124  }
   125  
   126  // The provider-assigned unique ID for this managed resource.
   127  func (o LookupSubnetGroupResultOutput) Id() pulumi.StringOutput {
   128  	return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Id }).(pulumi.StringOutput)
   129  }
   130  
   131  func (o LookupSubnetGroupResultOutput) Name() pulumi.StringOutput {
   132  	return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Name }).(pulumi.StringOutput)
   133  }
   134  
   135  // Provides the status of the DB subnet group.
   136  func (o LookupSubnetGroupResultOutput) Status() pulumi.StringOutput {
   137  	return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Status }).(pulumi.StringOutput)
   138  }
   139  
   140  // Contains a list of subnet identifiers.
   141  func (o LookupSubnetGroupResultOutput) SubnetIds() pulumi.StringArrayOutput {
   142  	return o.ApplyT(func(v LookupSubnetGroupResult) []string { return v.SubnetIds }).(pulumi.StringArrayOutput)
   143  }
   144  
   145  // The network type of the DB subnet group.
   146  func (o LookupSubnetGroupResultOutput) SupportedNetworkTypes() pulumi.StringArrayOutput {
   147  	return o.ApplyT(func(v LookupSubnetGroupResult) []string { return v.SupportedNetworkTypes }).(pulumi.StringArrayOutput)
   148  }
   149  
   150  // Provides the VPC ID of the DB subnet group.
   151  func (o LookupSubnetGroupResultOutput) VpcId() pulumi.StringOutput {
   152  	return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.VpcId }).(pulumi.StringOutput)
   153  }
   154  
   155  func init() {
   156  	pulumi.RegisterOutputType(LookupSubnetGroupResultOutput{})
   157  }