github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/memorydb/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 memorydb 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 // Provides information about a MemoryDB 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/memorydb" 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 := memorydb.LookupSubnetGroup(ctx, &memorydb.LookupSubnetGroupArgs{ 32 // Name: "my-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:memorydb/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 subnet group. 56 Name string `pulumi:"name"` 57 // Map of tags assigned to the subnet group. 58 Tags map[string]string `pulumi:"tags"` 59 } 60 61 // A collection of values returned by getSubnetGroup. 62 type LookupSubnetGroupResult struct { 63 // ARN of the subnet group. 64 Arn string `pulumi:"arn"` 65 // Description of the subnet group. 66 Description string `pulumi:"description"` 67 // The provider-assigned unique ID for this managed resource. 68 Id string `pulumi:"id"` 69 Name string `pulumi:"name"` 70 // Set of VPC Subnet ID-s of the subnet group. 71 SubnetIds []string `pulumi:"subnetIds"` 72 // Map of tags assigned to the subnet group. 73 Tags map[string]string `pulumi:"tags"` 74 // VPC in which the subnet group exists. 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 subnet group. 94 Name pulumi.StringInput `pulumi:"name"` 95 // Map of tags assigned to the subnet group. 96 Tags pulumi.StringMapInput `pulumi:"tags"` 97 } 98 99 func (LookupSubnetGroupOutputArgs) ElementType() reflect.Type { 100 return reflect.TypeOf((*LookupSubnetGroupArgs)(nil)).Elem() 101 } 102 103 // A collection of values returned by getSubnetGroup. 104 type LookupSubnetGroupResultOutput struct{ *pulumi.OutputState } 105 106 func (LookupSubnetGroupResultOutput) ElementType() reflect.Type { 107 return reflect.TypeOf((*LookupSubnetGroupResult)(nil)).Elem() 108 } 109 110 func (o LookupSubnetGroupResultOutput) ToLookupSubnetGroupResultOutput() LookupSubnetGroupResultOutput { 111 return o 112 } 113 114 func (o LookupSubnetGroupResultOutput) ToLookupSubnetGroupResultOutputWithContext(ctx context.Context) LookupSubnetGroupResultOutput { 115 return o 116 } 117 118 // ARN of the subnet group. 119 func (o LookupSubnetGroupResultOutput) Arn() pulumi.StringOutput { 120 return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Arn }).(pulumi.StringOutput) 121 } 122 123 // Description of the subnet group. 124 func (o LookupSubnetGroupResultOutput) Description() pulumi.StringOutput { 125 return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Description }).(pulumi.StringOutput) 126 } 127 128 // The provider-assigned unique ID for this managed resource. 129 func (o LookupSubnetGroupResultOutput) Id() pulumi.StringOutput { 130 return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Id }).(pulumi.StringOutput) 131 } 132 133 func (o LookupSubnetGroupResultOutput) Name() pulumi.StringOutput { 134 return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.Name }).(pulumi.StringOutput) 135 } 136 137 // Set of VPC Subnet ID-s of the subnet group. 138 func (o LookupSubnetGroupResultOutput) SubnetIds() pulumi.StringArrayOutput { 139 return o.ApplyT(func(v LookupSubnetGroupResult) []string { return v.SubnetIds }).(pulumi.StringArrayOutput) 140 } 141 142 // Map of tags assigned to the subnet group. 143 func (o LookupSubnetGroupResultOutput) Tags() pulumi.StringMapOutput { 144 return o.ApplyT(func(v LookupSubnetGroupResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 145 } 146 147 // VPC in which the subnet group exists. 148 func (o LookupSubnetGroupResultOutput) VpcId() pulumi.StringOutput { 149 return o.ApplyT(func(v LookupSubnetGroupResult) string { return v.VpcId }).(pulumi.StringOutput) 150 } 151 152 func init() { 153 pulumi.RegisterOutputType(LookupSubnetGroupResultOutput{}) 154 }