github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getNetworkInterface.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 ec2 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 a Network Interface. 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/ec2" 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 := ec2.LookupNetworkInterface(ctx, &ec2.LookupNetworkInterfaceArgs{ 32 // Id: pulumi.StringRef("eni-01234567"), 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func LookupNetworkInterface(ctx *pulumi.Context, args *LookupNetworkInterfaceArgs, opts ...pulumi.InvokeOption) (*LookupNetworkInterfaceResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv LookupNetworkInterfaceResult 46 err := ctx.Invoke("aws:ec2/getNetworkInterface:getNetworkInterface", 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 getNetworkInterface. 54 type LookupNetworkInterfaceArgs struct { 55 // One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-network-interfaces](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-network-interfaces.html) in the AWS CLI reference. 56 Filters []GetNetworkInterfaceFilter `pulumi:"filters"` 57 // Identifier for the network interface. 58 Id *string `pulumi:"id"` 59 // Any tags assigned to the network interface. 60 Tags map[string]string `pulumi:"tags"` 61 } 62 63 // A collection of values returned by getNetworkInterface. 64 type LookupNetworkInterfaceResult struct { 65 // ARN of the network interface. 66 Arn string `pulumi:"arn"` 67 // Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below. 68 Associations []GetNetworkInterfaceAssociation `pulumi:"associations"` 69 Attachments []GetNetworkInterfaceAttachmentType `pulumi:"attachments"` 70 // Availability Zone. 71 AvailabilityZone string `pulumi:"availabilityZone"` 72 // Description of the network interface. 73 Description string `pulumi:"description"` 74 Filters []GetNetworkInterfaceFilter `pulumi:"filters"` 75 Id string `pulumi:"id"` 76 // Type of interface. 77 InterfaceType string `pulumi:"interfaceType"` 78 // List of IPv6 addresses to assign to the ENI. 79 Ipv6Addresses []string `pulumi:"ipv6Addresses"` 80 // MAC address. 81 MacAddress string `pulumi:"macAddress"` 82 // ARN of the Outpost. 83 OutpostArn string `pulumi:"outpostArn"` 84 // AWS account ID of the owner of the network interface. 85 OwnerId string `pulumi:"ownerId"` 86 // Private DNS name. 87 PrivateDnsName string `pulumi:"privateDnsName"` 88 // Private IPv4 address of the network interface within the subnet. 89 PrivateIp string `pulumi:"privateIp"` 90 // Private IPv4 addresses associated with the network interface. 91 PrivateIps []string `pulumi:"privateIps"` 92 // ID of the entity that launched the instance on your behalf. 93 RequesterId string `pulumi:"requesterId"` 94 // List of security groups for the network interface. 95 SecurityGroups []string `pulumi:"securityGroups"` 96 // ID of the subnet. 97 SubnetId string `pulumi:"subnetId"` 98 // Any tags assigned to the network interface. 99 Tags map[string]string `pulumi:"tags"` 100 // ID of the VPC. 101 VpcId string `pulumi:"vpcId"` 102 } 103 104 func LookupNetworkInterfaceOutput(ctx *pulumi.Context, args LookupNetworkInterfaceOutputArgs, opts ...pulumi.InvokeOption) LookupNetworkInterfaceResultOutput { 105 return pulumi.ToOutputWithContext(context.Background(), args). 106 ApplyT(func(v interface{}) (LookupNetworkInterfaceResult, error) { 107 args := v.(LookupNetworkInterfaceArgs) 108 r, err := LookupNetworkInterface(ctx, &args, opts...) 109 var s LookupNetworkInterfaceResult 110 if r != nil { 111 s = *r 112 } 113 return s, err 114 }).(LookupNetworkInterfaceResultOutput) 115 } 116 117 // A collection of arguments for invoking getNetworkInterface. 118 type LookupNetworkInterfaceOutputArgs struct { 119 // One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-network-interfaces](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-network-interfaces.html) in the AWS CLI reference. 120 Filters GetNetworkInterfaceFilterArrayInput `pulumi:"filters"` 121 // Identifier for the network interface. 122 Id pulumi.StringPtrInput `pulumi:"id"` 123 // Any tags assigned to the network interface. 124 Tags pulumi.StringMapInput `pulumi:"tags"` 125 } 126 127 func (LookupNetworkInterfaceOutputArgs) ElementType() reflect.Type { 128 return reflect.TypeOf((*LookupNetworkInterfaceArgs)(nil)).Elem() 129 } 130 131 // A collection of values returned by getNetworkInterface. 132 type LookupNetworkInterfaceResultOutput struct{ *pulumi.OutputState } 133 134 func (LookupNetworkInterfaceResultOutput) ElementType() reflect.Type { 135 return reflect.TypeOf((*LookupNetworkInterfaceResult)(nil)).Elem() 136 } 137 138 func (o LookupNetworkInterfaceResultOutput) ToLookupNetworkInterfaceResultOutput() LookupNetworkInterfaceResultOutput { 139 return o 140 } 141 142 func (o LookupNetworkInterfaceResultOutput) ToLookupNetworkInterfaceResultOutputWithContext(ctx context.Context) LookupNetworkInterfaceResultOutput { 143 return o 144 } 145 146 // ARN of the network interface. 147 func (o LookupNetworkInterfaceResultOutput) Arn() pulumi.StringOutput { 148 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.Arn }).(pulumi.StringOutput) 149 } 150 151 // Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below. 152 func (o LookupNetworkInterfaceResultOutput) Associations() GetNetworkInterfaceAssociationArrayOutput { 153 return o.ApplyT(func(v LookupNetworkInterfaceResult) []GetNetworkInterfaceAssociation { return v.Associations }).(GetNetworkInterfaceAssociationArrayOutput) 154 } 155 156 func (o LookupNetworkInterfaceResultOutput) Attachments() GetNetworkInterfaceAttachmentTypeArrayOutput { 157 return o.ApplyT(func(v LookupNetworkInterfaceResult) []GetNetworkInterfaceAttachmentType { return v.Attachments }).(GetNetworkInterfaceAttachmentTypeArrayOutput) 158 } 159 160 // Availability Zone. 161 func (o LookupNetworkInterfaceResultOutput) AvailabilityZone() pulumi.StringOutput { 162 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.AvailabilityZone }).(pulumi.StringOutput) 163 } 164 165 // Description of the network interface. 166 func (o LookupNetworkInterfaceResultOutput) Description() pulumi.StringOutput { 167 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.Description }).(pulumi.StringOutput) 168 } 169 170 func (o LookupNetworkInterfaceResultOutput) Filters() GetNetworkInterfaceFilterArrayOutput { 171 return o.ApplyT(func(v LookupNetworkInterfaceResult) []GetNetworkInterfaceFilter { return v.Filters }).(GetNetworkInterfaceFilterArrayOutput) 172 } 173 174 func (o LookupNetworkInterfaceResultOutput) Id() pulumi.StringOutput { 175 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.Id }).(pulumi.StringOutput) 176 } 177 178 // Type of interface. 179 func (o LookupNetworkInterfaceResultOutput) InterfaceType() pulumi.StringOutput { 180 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.InterfaceType }).(pulumi.StringOutput) 181 } 182 183 // List of IPv6 addresses to assign to the ENI. 184 func (o LookupNetworkInterfaceResultOutput) Ipv6Addresses() pulumi.StringArrayOutput { 185 return o.ApplyT(func(v LookupNetworkInterfaceResult) []string { return v.Ipv6Addresses }).(pulumi.StringArrayOutput) 186 } 187 188 // MAC address. 189 func (o LookupNetworkInterfaceResultOutput) MacAddress() pulumi.StringOutput { 190 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.MacAddress }).(pulumi.StringOutput) 191 } 192 193 // ARN of the Outpost. 194 func (o LookupNetworkInterfaceResultOutput) OutpostArn() pulumi.StringOutput { 195 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.OutpostArn }).(pulumi.StringOutput) 196 } 197 198 // AWS account ID of the owner of the network interface. 199 func (o LookupNetworkInterfaceResultOutput) OwnerId() pulumi.StringOutput { 200 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.OwnerId }).(pulumi.StringOutput) 201 } 202 203 // Private DNS name. 204 func (o LookupNetworkInterfaceResultOutput) PrivateDnsName() pulumi.StringOutput { 205 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.PrivateDnsName }).(pulumi.StringOutput) 206 } 207 208 // Private IPv4 address of the network interface within the subnet. 209 func (o LookupNetworkInterfaceResultOutput) PrivateIp() pulumi.StringOutput { 210 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.PrivateIp }).(pulumi.StringOutput) 211 } 212 213 // Private IPv4 addresses associated with the network interface. 214 func (o LookupNetworkInterfaceResultOutput) PrivateIps() pulumi.StringArrayOutput { 215 return o.ApplyT(func(v LookupNetworkInterfaceResult) []string { return v.PrivateIps }).(pulumi.StringArrayOutput) 216 } 217 218 // ID of the entity that launched the instance on your behalf. 219 func (o LookupNetworkInterfaceResultOutput) RequesterId() pulumi.StringOutput { 220 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.RequesterId }).(pulumi.StringOutput) 221 } 222 223 // List of security groups for the network interface. 224 func (o LookupNetworkInterfaceResultOutput) SecurityGroups() pulumi.StringArrayOutput { 225 return o.ApplyT(func(v LookupNetworkInterfaceResult) []string { return v.SecurityGroups }).(pulumi.StringArrayOutput) 226 } 227 228 // ID of the subnet. 229 func (o LookupNetworkInterfaceResultOutput) SubnetId() pulumi.StringOutput { 230 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.SubnetId }).(pulumi.StringOutput) 231 } 232 233 // Any tags assigned to the network interface. 234 func (o LookupNetworkInterfaceResultOutput) Tags() pulumi.StringMapOutput { 235 return o.ApplyT(func(v LookupNetworkInterfaceResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 236 } 237 238 // ID of the VPC. 239 func (o LookupNetworkInterfaceResultOutput) VpcId() pulumi.StringOutput { 240 return o.ApplyT(func(v LookupNetworkInterfaceResult) string { return v.VpcId }).(pulumi.StringOutput) 241 } 242 243 func init() { 244 pulumi.RegisterOutputType(LookupNetworkInterfaceResultOutput{}) 245 }