github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/storagegateway/getLocalDisk.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 storagegateway 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 // Retrieve information about a Storage Gateway local disk. The disk identifier is useful for adding the disk as a cache or upload buffer to a gateway. 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/storagegateway" 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 := storagegateway.GetLocalDisk(ctx, &storagegateway.GetLocalDiskArgs{ 32 // DiskPath: pulumi.StringRef(testAwsVolumeAttachment.DeviceName), 33 // GatewayArn: testAwsStoragegatewayGateway.Arn, 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func GetLocalDisk(ctx *pulumi.Context, args *GetLocalDiskArgs, opts ...pulumi.InvokeOption) (*GetLocalDiskResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv GetLocalDiskResult 47 err := ctx.Invoke("aws:storagegateway/getLocalDisk:getLocalDisk", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getLocalDisk. 55 type GetLocalDiskArgs struct { 56 // Device node of the local disk to retrieve. For example, `/dev/sdb`. 57 DiskNode *string `pulumi:"diskNode"` 58 // Device path of the local disk to retrieve. For example, `/dev/xvdb` or `/dev/nvme1n1`. 59 DiskPath *string `pulumi:"diskPath"` 60 // ARN of the gateway. 61 GatewayArn string `pulumi:"gatewayArn"` 62 } 63 64 // A collection of values returned by getLocalDisk. 65 type GetLocalDiskResult struct { 66 // Disk identifierE.g., `pci-0000:03:00.0-scsi-0:0:0:0` 67 DiskId string `pulumi:"diskId"` 68 DiskNode string `pulumi:"diskNode"` 69 DiskPath string `pulumi:"diskPath"` 70 GatewayArn string `pulumi:"gatewayArn"` 71 // The provider-assigned unique ID for this managed resource. 72 Id string `pulumi:"id"` 73 } 74 75 func GetLocalDiskOutput(ctx *pulumi.Context, args GetLocalDiskOutputArgs, opts ...pulumi.InvokeOption) GetLocalDiskResultOutput { 76 return pulumi.ToOutputWithContext(context.Background(), args). 77 ApplyT(func(v interface{}) (GetLocalDiskResult, error) { 78 args := v.(GetLocalDiskArgs) 79 r, err := GetLocalDisk(ctx, &args, opts...) 80 var s GetLocalDiskResult 81 if r != nil { 82 s = *r 83 } 84 return s, err 85 }).(GetLocalDiskResultOutput) 86 } 87 88 // A collection of arguments for invoking getLocalDisk. 89 type GetLocalDiskOutputArgs struct { 90 // Device node of the local disk to retrieve. For example, `/dev/sdb`. 91 DiskNode pulumi.StringPtrInput `pulumi:"diskNode"` 92 // Device path of the local disk to retrieve. For example, `/dev/xvdb` or `/dev/nvme1n1`. 93 DiskPath pulumi.StringPtrInput `pulumi:"diskPath"` 94 // ARN of the gateway. 95 GatewayArn pulumi.StringInput `pulumi:"gatewayArn"` 96 } 97 98 func (GetLocalDiskOutputArgs) ElementType() reflect.Type { 99 return reflect.TypeOf((*GetLocalDiskArgs)(nil)).Elem() 100 } 101 102 // A collection of values returned by getLocalDisk. 103 type GetLocalDiskResultOutput struct{ *pulumi.OutputState } 104 105 func (GetLocalDiskResultOutput) ElementType() reflect.Type { 106 return reflect.TypeOf((*GetLocalDiskResult)(nil)).Elem() 107 } 108 109 func (o GetLocalDiskResultOutput) ToGetLocalDiskResultOutput() GetLocalDiskResultOutput { 110 return o 111 } 112 113 func (o GetLocalDiskResultOutput) ToGetLocalDiskResultOutputWithContext(ctx context.Context) GetLocalDiskResultOutput { 114 return o 115 } 116 117 // Disk identifierE.g., `pci-0000:03:00.0-scsi-0:0:0:0` 118 func (o GetLocalDiskResultOutput) DiskId() pulumi.StringOutput { 119 return o.ApplyT(func(v GetLocalDiskResult) string { return v.DiskId }).(pulumi.StringOutput) 120 } 121 122 func (o GetLocalDiskResultOutput) DiskNode() pulumi.StringOutput { 123 return o.ApplyT(func(v GetLocalDiskResult) string { return v.DiskNode }).(pulumi.StringOutput) 124 } 125 126 func (o GetLocalDiskResultOutput) DiskPath() pulumi.StringOutput { 127 return o.ApplyT(func(v GetLocalDiskResult) string { return v.DiskPath }).(pulumi.StringOutput) 128 } 129 130 func (o GetLocalDiskResultOutput) GatewayArn() pulumi.StringOutput { 131 return o.ApplyT(func(v GetLocalDiskResult) string { return v.GatewayArn }).(pulumi.StringOutput) 132 } 133 134 // The provider-assigned unique ID for this managed resource. 135 func (o GetLocalDiskResultOutput) Id() pulumi.StringOutput { 136 return o.ApplyT(func(v GetLocalDiskResult) string { return v.Id }).(pulumi.StringOutput) 137 } 138 139 func init() { 140 pulumi.RegisterOutputType(GetLocalDiskResultOutput{}) 141 }