github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/efs/getFileSystem.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 (EFS) File System. 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 // fileSystemId := "" 34 // if param := cfg.Get("fileSystemId"); param != "" { 35 // fileSystemId = param 36 // } 37 // _, err := efs.LookupFileSystem(ctx, &efs.LookupFileSystemArgs{ 38 // FileSystemId: pulumi.StringRef(fileSystemId), 39 // }, nil) 40 // if err != nil { 41 // return err 42 // } 43 // _, err = efs.LookupFileSystem(ctx, &efs.LookupFileSystemArgs{ 44 // Tags: map[string]interface{}{ 45 // "Environment": "dev", 46 // }, 47 // }, nil) 48 // if err != nil { 49 // return err 50 // } 51 // return nil 52 // }) 53 // } 54 // 55 // ``` 56 // <!--End PulumiCodeChooser --> 57 func LookupFileSystem(ctx *pulumi.Context, args *LookupFileSystemArgs, opts ...pulumi.InvokeOption) (*LookupFileSystemResult, error) { 58 opts = internal.PkgInvokeDefaultOpts(opts) 59 var rv LookupFileSystemResult 60 err := ctx.Invoke("aws:efs/getFileSystem:getFileSystem", args, &rv, opts...) 61 if err != nil { 62 return nil, err 63 } 64 return &rv, nil 65 } 66 67 // A collection of arguments for invoking getFileSystem. 68 type LookupFileSystemArgs struct { 69 // Restricts the list to the file system with this creation token. 70 CreationToken *string `pulumi:"creationToken"` 71 // ID that identifies the file system (e.g., fs-ccfc0d65). 72 FileSystemId *string `pulumi:"fileSystemId"` 73 // Restricts the list to the file system with these tags. 74 Tags map[string]string `pulumi:"tags"` 75 } 76 77 // A collection of values returned by getFileSystem. 78 type LookupFileSystemResult struct { 79 // Amazon Resource Name of the file system. 80 Arn string `pulumi:"arn"` 81 // The identifier of the Availability Zone in which the file system's One Zone storage classes exist. 82 AvailabilityZoneId string `pulumi:"availabilityZoneId"` 83 // The Availability Zone name in which the file system's One Zone storage classes exist. 84 AvailabilityZoneName string `pulumi:"availabilityZoneName"` 85 CreationToken string `pulumi:"creationToken"` 86 // DNS name for the filesystem per [documented convention](http://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html). 87 DnsName string `pulumi:"dnsName"` 88 // Whether EFS is encrypted. 89 Encrypted bool `pulumi:"encrypted"` 90 FileSystemId string `pulumi:"fileSystemId"` 91 // The provider-assigned unique ID for this managed resource. 92 Id string `pulumi:"id"` 93 // ARN for the KMS encryption key. 94 KmsKeyId string `pulumi:"kmsKeyId"` 95 // File system [lifecycle policy](https://docs.aws.amazon.com/efs/latest/ug/API_LifecyclePolicy.html) object. 96 LifecyclePolicy GetFileSystemLifecyclePolicy `pulumi:"lifecyclePolicy"` 97 // The value of the file system's `Name` tag. 98 Name string `pulumi:"name"` 99 // File system performance mode. 100 PerformanceMode string `pulumi:"performanceMode"` 101 Protections []GetFileSystemProtection `pulumi:"protections"` 102 // The throughput, measured in MiB/s, that you want to provision for the file system. 103 ProvisionedThroughputInMibps float64 `pulumi:"provisionedThroughputInMibps"` 104 // Current byte count used by the file system. 105 SizeInBytes int `pulumi:"sizeInBytes"` 106 // A map of tags to assign to the file system. 107 Tags map[string]string `pulumi:"tags"` 108 // Throughput mode for the file system. 109 ThroughputMode string `pulumi:"throughputMode"` 110 } 111 112 func LookupFileSystemOutput(ctx *pulumi.Context, args LookupFileSystemOutputArgs, opts ...pulumi.InvokeOption) LookupFileSystemResultOutput { 113 return pulumi.ToOutputWithContext(context.Background(), args). 114 ApplyT(func(v interface{}) (LookupFileSystemResult, error) { 115 args := v.(LookupFileSystemArgs) 116 r, err := LookupFileSystem(ctx, &args, opts...) 117 var s LookupFileSystemResult 118 if r != nil { 119 s = *r 120 } 121 return s, err 122 }).(LookupFileSystemResultOutput) 123 } 124 125 // A collection of arguments for invoking getFileSystem. 126 type LookupFileSystemOutputArgs struct { 127 // Restricts the list to the file system with this creation token. 128 CreationToken pulumi.StringPtrInput `pulumi:"creationToken"` 129 // ID that identifies the file system (e.g., fs-ccfc0d65). 130 FileSystemId pulumi.StringPtrInput `pulumi:"fileSystemId"` 131 // Restricts the list to the file system with these tags. 132 Tags pulumi.StringMapInput `pulumi:"tags"` 133 } 134 135 func (LookupFileSystemOutputArgs) ElementType() reflect.Type { 136 return reflect.TypeOf((*LookupFileSystemArgs)(nil)).Elem() 137 } 138 139 // A collection of values returned by getFileSystem. 140 type LookupFileSystemResultOutput struct{ *pulumi.OutputState } 141 142 func (LookupFileSystemResultOutput) ElementType() reflect.Type { 143 return reflect.TypeOf((*LookupFileSystemResult)(nil)).Elem() 144 } 145 146 func (o LookupFileSystemResultOutput) ToLookupFileSystemResultOutput() LookupFileSystemResultOutput { 147 return o 148 } 149 150 func (o LookupFileSystemResultOutput) ToLookupFileSystemResultOutputWithContext(ctx context.Context) LookupFileSystemResultOutput { 151 return o 152 } 153 154 // Amazon Resource Name of the file system. 155 func (o LookupFileSystemResultOutput) Arn() pulumi.StringOutput { 156 return o.ApplyT(func(v LookupFileSystemResult) string { return v.Arn }).(pulumi.StringOutput) 157 } 158 159 // The identifier of the Availability Zone in which the file system's One Zone storage classes exist. 160 func (o LookupFileSystemResultOutput) AvailabilityZoneId() pulumi.StringOutput { 161 return o.ApplyT(func(v LookupFileSystemResult) string { return v.AvailabilityZoneId }).(pulumi.StringOutput) 162 } 163 164 // The Availability Zone name in which the file system's One Zone storage classes exist. 165 func (o LookupFileSystemResultOutput) AvailabilityZoneName() pulumi.StringOutput { 166 return o.ApplyT(func(v LookupFileSystemResult) string { return v.AvailabilityZoneName }).(pulumi.StringOutput) 167 } 168 169 func (o LookupFileSystemResultOutput) CreationToken() pulumi.StringOutput { 170 return o.ApplyT(func(v LookupFileSystemResult) string { return v.CreationToken }).(pulumi.StringOutput) 171 } 172 173 // DNS name for the filesystem per [documented convention](http://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html). 174 func (o LookupFileSystemResultOutput) DnsName() pulumi.StringOutput { 175 return o.ApplyT(func(v LookupFileSystemResult) string { return v.DnsName }).(pulumi.StringOutput) 176 } 177 178 // Whether EFS is encrypted. 179 func (o LookupFileSystemResultOutput) Encrypted() pulumi.BoolOutput { 180 return o.ApplyT(func(v LookupFileSystemResult) bool { return v.Encrypted }).(pulumi.BoolOutput) 181 } 182 183 func (o LookupFileSystemResultOutput) FileSystemId() pulumi.StringOutput { 184 return o.ApplyT(func(v LookupFileSystemResult) string { return v.FileSystemId }).(pulumi.StringOutput) 185 } 186 187 // The provider-assigned unique ID for this managed resource. 188 func (o LookupFileSystemResultOutput) Id() pulumi.StringOutput { 189 return o.ApplyT(func(v LookupFileSystemResult) string { return v.Id }).(pulumi.StringOutput) 190 } 191 192 // ARN for the KMS encryption key. 193 func (o LookupFileSystemResultOutput) KmsKeyId() pulumi.StringOutput { 194 return o.ApplyT(func(v LookupFileSystemResult) string { return v.KmsKeyId }).(pulumi.StringOutput) 195 } 196 197 // File system [lifecycle policy](https://docs.aws.amazon.com/efs/latest/ug/API_LifecyclePolicy.html) object. 198 func (o LookupFileSystemResultOutput) LifecyclePolicy() GetFileSystemLifecyclePolicyOutput { 199 return o.ApplyT(func(v LookupFileSystemResult) GetFileSystemLifecyclePolicy { return v.LifecyclePolicy }).(GetFileSystemLifecyclePolicyOutput) 200 } 201 202 // The value of the file system's `Name` tag. 203 func (o LookupFileSystemResultOutput) Name() pulumi.StringOutput { 204 return o.ApplyT(func(v LookupFileSystemResult) string { return v.Name }).(pulumi.StringOutput) 205 } 206 207 // File system performance mode. 208 func (o LookupFileSystemResultOutput) PerformanceMode() pulumi.StringOutput { 209 return o.ApplyT(func(v LookupFileSystemResult) string { return v.PerformanceMode }).(pulumi.StringOutput) 210 } 211 212 func (o LookupFileSystemResultOutput) Protections() GetFileSystemProtectionArrayOutput { 213 return o.ApplyT(func(v LookupFileSystemResult) []GetFileSystemProtection { return v.Protections }).(GetFileSystemProtectionArrayOutput) 214 } 215 216 // The throughput, measured in MiB/s, that you want to provision for the file system. 217 func (o LookupFileSystemResultOutput) ProvisionedThroughputInMibps() pulumi.Float64Output { 218 return o.ApplyT(func(v LookupFileSystemResult) float64 { return v.ProvisionedThroughputInMibps }).(pulumi.Float64Output) 219 } 220 221 // Current byte count used by the file system. 222 func (o LookupFileSystemResultOutput) SizeInBytes() pulumi.IntOutput { 223 return o.ApplyT(func(v LookupFileSystemResult) int { return v.SizeInBytes }).(pulumi.IntOutput) 224 } 225 226 // A map of tags to assign to the file system. 227 func (o LookupFileSystemResultOutput) Tags() pulumi.StringMapOutput { 228 return o.ApplyT(func(v LookupFileSystemResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 229 } 230 231 // Throughput mode for the file system. 232 func (o LookupFileSystemResultOutput) ThroughputMode() pulumi.StringOutput { 233 return o.ApplyT(func(v LookupFileSystemResult) string { return v.ThroughputMode }).(pulumi.StringOutput) 234 } 235 236 func init() { 237 pulumi.RegisterOutputType(LookupFileSystemResultOutput{}) 238 }