github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/efs/getMountTarget.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 efs
     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 an Elastic File System Mount Target (EFS).
    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/efs"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			cfg := config.New(ctx, "")
    33  //			mountTargetId := ""
    34  //			if param := cfg.Get("mountTargetId"); param != "" {
    35  //				mountTargetId = param
    36  //			}
    37  //			_, err := efs.LookupMountTarget(ctx, &efs.LookupMountTargetArgs{
    38  //				MountTargetId: pulumi.StringRef(mountTargetId),
    39  //			}, nil)
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  func LookupMountTarget(ctx *pulumi.Context, args *LookupMountTargetArgs, opts ...pulumi.InvokeOption) (*LookupMountTargetResult, error) {
    50  	opts = internal.PkgInvokeDefaultOpts(opts)
    51  	var rv LookupMountTargetResult
    52  	err := ctx.Invoke("aws:efs/getMountTarget:getMountTarget", args, &rv, opts...)
    53  	if err != nil {
    54  		return nil, err
    55  	}
    56  	return &rv, nil
    57  }
    58  
    59  // A collection of arguments for invoking getMountTarget.
    60  type LookupMountTargetArgs struct {
    61  	// ID or ARN of the access point whose mount target that you want to find. It must be included if a `fileSystemId` and `mountTargetId` are not included.
    62  	AccessPointId *string `pulumi:"accessPointId"`
    63  	// ID or ARN of the file system whose mount target that you want to find. It must be included if an `accessPointId` and `mountTargetId` are not included.
    64  	FileSystemId *string `pulumi:"fileSystemId"`
    65  	// ID or ARN of the mount target that you want to find. It must be included in your request if an `accessPointId` and `fileSystemId` are not included.
    66  	MountTargetId *string `pulumi:"mountTargetId"`
    67  }
    68  
    69  // A collection of values returned by getMountTarget.
    70  type LookupMountTargetResult struct {
    71  	AccessPointId *string `pulumi:"accessPointId"`
    72  	// The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    73  	AvailabilityZoneId string `pulumi:"availabilityZoneId"`
    74  	// The name of the Availability Zone (AZ) that the mount target resides in.
    75  	AvailabilityZoneName string `pulumi:"availabilityZoneName"`
    76  	// DNS name for the EFS file system.
    77  	DnsName string `pulumi:"dnsName"`
    78  	// Amazon Resource Name of the file system for which the mount target is intended.
    79  	FileSystemArn string `pulumi:"fileSystemArn"`
    80  	FileSystemId  string `pulumi:"fileSystemId"`
    81  	// The provider-assigned unique ID for this managed resource.
    82  	Id string `pulumi:"id"`
    83  	// Address at which the file system may be mounted via the mount target.
    84  	IpAddress string `pulumi:"ipAddress"`
    85  	// The DNS name for the given subnet/AZ per [documented convention](http://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html).
    86  	MountTargetDnsName string `pulumi:"mountTargetDnsName"`
    87  	MountTargetId      string `pulumi:"mountTargetId"`
    88  	// The ID of the network interface that Amazon EFS created when it created the mount target.
    89  	NetworkInterfaceId string `pulumi:"networkInterfaceId"`
    90  	// AWS account ID that owns the resource.
    91  	OwnerId string `pulumi:"ownerId"`
    92  	// List of VPC security group IDs attached to the mount target.
    93  	SecurityGroups []string `pulumi:"securityGroups"`
    94  	// ID of the mount target's subnet.
    95  	SubnetId string `pulumi:"subnetId"`
    96  }
    97  
    98  func LookupMountTargetOutput(ctx *pulumi.Context, args LookupMountTargetOutputArgs, opts ...pulumi.InvokeOption) LookupMountTargetResultOutput {
    99  	return pulumi.ToOutputWithContext(context.Background(), args).
   100  		ApplyT(func(v interface{}) (LookupMountTargetResult, error) {
   101  			args := v.(LookupMountTargetArgs)
   102  			r, err := LookupMountTarget(ctx, &args, opts...)
   103  			var s LookupMountTargetResult
   104  			if r != nil {
   105  				s = *r
   106  			}
   107  			return s, err
   108  		}).(LookupMountTargetResultOutput)
   109  }
   110  
   111  // A collection of arguments for invoking getMountTarget.
   112  type LookupMountTargetOutputArgs struct {
   113  	// ID or ARN of the access point whose mount target that you want to find. It must be included if a `fileSystemId` and `mountTargetId` are not included.
   114  	AccessPointId pulumi.StringPtrInput `pulumi:"accessPointId"`
   115  	// ID or ARN of the file system whose mount target that you want to find. It must be included if an `accessPointId` and `mountTargetId` are not included.
   116  	FileSystemId pulumi.StringPtrInput `pulumi:"fileSystemId"`
   117  	// ID or ARN of the mount target that you want to find. It must be included in your request if an `accessPointId` and `fileSystemId` are not included.
   118  	MountTargetId pulumi.StringPtrInput `pulumi:"mountTargetId"`
   119  }
   120  
   121  func (LookupMountTargetOutputArgs) ElementType() reflect.Type {
   122  	return reflect.TypeOf((*LookupMountTargetArgs)(nil)).Elem()
   123  }
   124  
   125  // A collection of values returned by getMountTarget.
   126  type LookupMountTargetResultOutput struct{ *pulumi.OutputState }
   127  
   128  func (LookupMountTargetResultOutput) ElementType() reflect.Type {
   129  	return reflect.TypeOf((*LookupMountTargetResult)(nil)).Elem()
   130  }
   131  
   132  func (o LookupMountTargetResultOutput) ToLookupMountTargetResultOutput() LookupMountTargetResultOutput {
   133  	return o
   134  }
   135  
   136  func (o LookupMountTargetResultOutput) ToLookupMountTargetResultOutputWithContext(ctx context.Context) LookupMountTargetResultOutput {
   137  	return o
   138  }
   139  
   140  func (o LookupMountTargetResultOutput) AccessPointId() pulumi.StringPtrOutput {
   141  	return o.ApplyT(func(v LookupMountTargetResult) *string { return v.AccessPointId }).(pulumi.StringPtrOutput)
   142  }
   143  
   144  // The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
   145  func (o LookupMountTargetResultOutput) AvailabilityZoneId() pulumi.StringOutput {
   146  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.AvailabilityZoneId }).(pulumi.StringOutput)
   147  }
   148  
   149  // The name of the Availability Zone (AZ) that the mount target resides in.
   150  func (o LookupMountTargetResultOutput) AvailabilityZoneName() pulumi.StringOutput {
   151  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.AvailabilityZoneName }).(pulumi.StringOutput)
   152  }
   153  
   154  // DNS name for the EFS file system.
   155  func (o LookupMountTargetResultOutput) DnsName() pulumi.StringOutput {
   156  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.DnsName }).(pulumi.StringOutput)
   157  }
   158  
   159  // Amazon Resource Name of the file system for which the mount target is intended.
   160  func (o LookupMountTargetResultOutput) FileSystemArn() pulumi.StringOutput {
   161  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.FileSystemArn }).(pulumi.StringOutput)
   162  }
   163  
   164  func (o LookupMountTargetResultOutput) FileSystemId() pulumi.StringOutput {
   165  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.FileSystemId }).(pulumi.StringOutput)
   166  }
   167  
   168  // The provider-assigned unique ID for this managed resource.
   169  func (o LookupMountTargetResultOutput) Id() pulumi.StringOutput {
   170  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.Id }).(pulumi.StringOutput)
   171  }
   172  
   173  // Address at which the file system may be mounted via the mount target.
   174  func (o LookupMountTargetResultOutput) IpAddress() pulumi.StringOutput {
   175  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.IpAddress }).(pulumi.StringOutput)
   176  }
   177  
   178  // The DNS name for the given subnet/AZ per [documented convention](http://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html).
   179  func (o LookupMountTargetResultOutput) MountTargetDnsName() pulumi.StringOutput {
   180  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.MountTargetDnsName }).(pulumi.StringOutput)
   181  }
   182  
   183  func (o LookupMountTargetResultOutput) MountTargetId() pulumi.StringOutput {
   184  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.MountTargetId }).(pulumi.StringOutput)
   185  }
   186  
   187  // The ID of the network interface that Amazon EFS created when it created the mount target.
   188  func (o LookupMountTargetResultOutput) NetworkInterfaceId() pulumi.StringOutput {
   189  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.NetworkInterfaceId }).(pulumi.StringOutput)
   190  }
   191  
   192  // AWS account ID that owns the resource.
   193  func (o LookupMountTargetResultOutput) OwnerId() pulumi.StringOutput {
   194  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.OwnerId }).(pulumi.StringOutput)
   195  }
   196  
   197  // List of VPC security group IDs attached to the mount target.
   198  func (o LookupMountTargetResultOutput) SecurityGroups() pulumi.StringArrayOutput {
   199  	return o.ApplyT(func(v LookupMountTargetResult) []string { return v.SecurityGroups }).(pulumi.StringArrayOutput)
   200  }
   201  
   202  // ID of the mount target's subnet.
   203  func (o LookupMountTargetResultOutput) SubnetId() pulumi.StringOutput {
   204  	return o.ApplyT(func(v LookupMountTargetResult) string { return v.SubnetId }).(pulumi.StringOutput)
   205  }
   206  
   207  func init() {
   208  	pulumi.RegisterOutputType(LookupMountTargetResultOutput{})
   209  }