github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/fsx/getOpenZfsSnapshot.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 fsx 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 Amazon FSx for OpenZFS Snapshot for use when provisioning new Volumes. 15 // 16 // ## Example Usage 17 // 18 // ### Root volume Example 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/fsx" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := fsx.LookupOpenZfsSnapshot(ctx, &fsx.LookupOpenZfsSnapshotArgs{ 34 // MostRecent: pulumi.BoolRef(true), 35 // Filters: []fsx.GetOpenZfsSnapshotFilter{ 36 // { 37 // Name: "volume-id", 38 // Values: []string{ 39 // "fsvol-073a32b6098a73feb", 40 // }, 41 // }, 42 // }, 43 // }, nil) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 func LookupOpenZfsSnapshot(ctx *pulumi.Context, args *LookupOpenZfsSnapshotArgs, opts ...pulumi.InvokeOption) (*LookupOpenZfsSnapshotResult, error) { 54 opts = internal.PkgInvokeDefaultOpts(opts) 55 var rv LookupOpenZfsSnapshotResult 56 err := ctx.Invoke("aws:fsx/getOpenZfsSnapshot:getOpenZfsSnapshot", args, &rv, opts...) 57 if err != nil { 58 return nil, err 59 } 60 return &rv, nil 61 } 62 63 // A collection of arguments for invoking getOpenZfsSnapshot. 64 type LookupOpenZfsSnapshotArgs struct { 65 // One or more name/value pairs to filter off of. The 66 // supported names are file-system-id or volume-id. 67 Filters []GetOpenZfsSnapshotFilter `pulumi:"filters"` 68 // If more than one result is returned, use the most recent snapshot. 69 MostRecent *bool `pulumi:"mostRecent"` 70 // Name of the snapshot. 71 Name *string `pulumi:"name"` 72 // Returns information on a specific snapshot_id. 73 SnapshotIds []string `pulumi:"snapshotIds"` 74 // List of Tag values, with a maximum of 50 elements. 75 Tags map[string]string `pulumi:"tags"` 76 } 77 78 // A collection of values returned by getOpenZfsSnapshot. 79 type LookupOpenZfsSnapshotResult struct { 80 // Amazon Resource Name of the snapshot. 81 Arn string `pulumi:"arn"` 82 // Time that the resource was created. 83 CreationTime string `pulumi:"creationTime"` 84 Filters []GetOpenZfsSnapshotFilter `pulumi:"filters"` 85 // The provider-assigned unique ID for this managed resource. 86 Id string `pulumi:"id"` 87 MostRecent *bool `pulumi:"mostRecent"` 88 // Name of the snapshot. 89 Name *string `pulumi:"name"` 90 // ID of the snapshot. 91 SnapshotId string `pulumi:"snapshotId"` 92 SnapshotIds []string `pulumi:"snapshotIds"` 93 // List of Tag values, with a maximum of 50 elements. 94 Tags map[string]string `pulumi:"tags"` 95 // ID of the volume that the snapshot is of. 96 VolumeId string `pulumi:"volumeId"` 97 } 98 99 func LookupOpenZfsSnapshotOutput(ctx *pulumi.Context, args LookupOpenZfsSnapshotOutputArgs, opts ...pulumi.InvokeOption) LookupOpenZfsSnapshotResultOutput { 100 return pulumi.ToOutputWithContext(context.Background(), args). 101 ApplyT(func(v interface{}) (LookupOpenZfsSnapshotResult, error) { 102 args := v.(LookupOpenZfsSnapshotArgs) 103 r, err := LookupOpenZfsSnapshot(ctx, &args, opts...) 104 var s LookupOpenZfsSnapshotResult 105 if r != nil { 106 s = *r 107 } 108 return s, err 109 }).(LookupOpenZfsSnapshotResultOutput) 110 } 111 112 // A collection of arguments for invoking getOpenZfsSnapshot. 113 type LookupOpenZfsSnapshotOutputArgs struct { 114 // One or more name/value pairs to filter off of. The 115 // supported names are file-system-id or volume-id. 116 Filters GetOpenZfsSnapshotFilterArrayInput `pulumi:"filters"` 117 // If more than one result is returned, use the most recent snapshot. 118 MostRecent pulumi.BoolPtrInput `pulumi:"mostRecent"` 119 // Name of the snapshot. 120 Name pulumi.StringPtrInput `pulumi:"name"` 121 // Returns information on a specific snapshot_id. 122 SnapshotIds pulumi.StringArrayInput `pulumi:"snapshotIds"` 123 // List of Tag values, with a maximum of 50 elements. 124 Tags pulumi.StringMapInput `pulumi:"tags"` 125 } 126 127 func (LookupOpenZfsSnapshotOutputArgs) ElementType() reflect.Type { 128 return reflect.TypeOf((*LookupOpenZfsSnapshotArgs)(nil)).Elem() 129 } 130 131 // A collection of values returned by getOpenZfsSnapshot. 132 type LookupOpenZfsSnapshotResultOutput struct{ *pulumi.OutputState } 133 134 func (LookupOpenZfsSnapshotResultOutput) ElementType() reflect.Type { 135 return reflect.TypeOf((*LookupOpenZfsSnapshotResult)(nil)).Elem() 136 } 137 138 func (o LookupOpenZfsSnapshotResultOutput) ToLookupOpenZfsSnapshotResultOutput() LookupOpenZfsSnapshotResultOutput { 139 return o 140 } 141 142 func (o LookupOpenZfsSnapshotResultOutput) ToLookupOpenZfsSnapshotResultOutputWithContext(ctx context.Context) LookupOpenZfsSnapshotResultOutput { 143 return o 144 } 145 146 // Amazon Resource Name of the snapshot. 147 func (o LookupOpenZfsSnapshotResultOutput) Arn() pulumi.StringOutput { 148 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.Arn }).(pulumi.StringOutput) 149 } 150 151 // Time that the resource was created. 152 func (o LookupOpenZfsSnapshotResultOutput) CreationTime() pulumi.StringOutput { 153 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.CreationTime }).(pulumi.StringOutput) 154 } 155 156 func (o LookupOpenZfsSnapshotResultOutput) Filters() GetOpenZfsSnapshotFilterArrayOutput { 157 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) []GetOpenZfsSnapshotFilter { return v.Filters }).(GetOpenZfsSnapshotFilterArrayOutput) 158 } 159 160 // The provider-assigned unique ID for this managed resource. 161 func (o LookupOpenZfsSnapshotResultOutput) Id() pulumi.StringOutput { 162 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.Id }).(pulumi.StringOutput) 163 } 164 165 func (o LookupOpenZfsSnapshotResultOutput) MostRecent() pulumi.BoolPtrOutput { 166 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) *bool { return v.MostRecent }).(pulumi.BoolPtrOutput) 167 } 168 169 // Name of the snapshot. 170 func (o LookupOpenZfsSnapshotResultOutput) Name() pulumi.StringPtrOutput { 171 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) *string { return v.Name }).(pulumi.StringPtrOutput) 172 } 173 174 // ID of the snapshot. 175 func (o LookupOpenZfsSnapshotResultOutput) SnapshotId() pulumi.StringOutput { 176 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.SnapshotId }).(pulumi.StringOutput) 177 } 178 179 func (o LookupOpenZfsSnapshotResultOutput) SnapshotIds() pulumi.StringArrayOutput { 180 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) []string { return v.SnapshotIds }).(pulumi.StringArrayOutput) 181 } 182 183 // List of Tag values, with a maximum of 50 elements. 184 func (o LookupOpenZfsSnapshotResultOutput) Tags() pulumi.StringMapOutput { 185 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 186 } 187 188 // ID of the volume that the snapshot is of. 189 func (o LookupOpenZfsSnapshotResultOutput) VolumeId() pulumi.StringOutput { 190 return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.VolumeId }).(pulumi.StringOutput) 191 } 192 193 func init() { 194 pulumi.RegisterOutputType(LookupOpenZfsSnapshotResultOutput{}) 195 }