Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi
gcp.filestore.getInstance
Explore with Pulumi AI
Get info about a Google Cloud Filestore instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const myInstance = gcp.filestore.getInstance({
name: "my-filestore-instance",
});
export const instanceIpAddresses = myInstance.then(myInstance => myInstance.networks?.ipAddresses);
export const instanceConnectMode = myInstance.then(myInstance => myInstance.networks?.connectMode);
export const instanceFileShareName = myInstance.then(myInstance => myInstance.fileShares?.name);
import pulumi
import pulumi_gcp as gcp
my_instance = gcp.filestore.get_instance(name="my-filestore-instance")
pulumi.export("instanceIpAddresses", my_instance.networks.ip_addresses)
pulumi.export("instanceConnectMode", my_instance.networks.connect_mode)
pulumi.export("instanceFileShareName", my_instance.file_shares.name)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/filestore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myInstance, err := filestore.LookupInstance(ctx, &filestore.LookupInstanceArgs{
Name: "my-filestore-instance",
}, nil)
if err != nil {
return err
}
ctx.Export("instanceIpAddresses", myInstance.Networks.IpAddresses)
ctx.Export("instanceConnectMode", myInstance.Networks.ConnectMode)
ctx.Export("instanceFileShareName", myInstance.FileShares.Name)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var myInstance = Gcp.Filestore.GetInstance.Invoke(new()
{
Name = "my-filestore-instance",
});
return new Dictionary<string, object?>
{
["instanceIpAddresses"] = myInstance.Apply(getInstanceResult => getInstanceResult.Networks?.IpAddresses),
["instanceConnectMode"] = myInstance.Apply(getInstanceResult => getInstanceResult.Networks?.ConnectMode),
["instanceFileShareName"] = myInstance.Apply(getInstanceResult => getInstanceResult.FileShares?.Name),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.filestore.FilestoreFunctions;
import com.pulumi.gcp.filestore.inputs.GetInstanceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var myInstance = FilestoreFunctions.getInstance(GetInstanceArgs.builder()
.name("my-filestore-instance")
.build());
ctx.export("instanceIpAddresses", myInstance.applyValue(getInstanceResult -> getInstanceResult.networks().ipAddresses()));
ctx.export("instanceConnectMode", myInstance.applyValue(getInstanceResult -> getInstanceResult.networks().connectMode()));
ctx.export("instanceFileShareName", myInstance.applyValue(getInstanceResult -> getInstanceResult.fileShares().name()));
}
}
variables:
myInstance:
fn::invoke:
Function: gcp:filestore:getInstance
Arguments:
name: my-filestore-instance
outputs:
instanceIpAddresses: ${myInstance.networks.ipAddresses}
instanceConnectMode: ${myInstance.networks.connectMode}
instanceFileShareName: ${myInstance.fileShares.name}
Using getInstance
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
def get_instance(location: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput
> Note: This function is named LookupInstance
in the Go SDK.
public static class GetInstance
{
public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:filestore/getInstance:getInstance
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name of a Filestore instance.
- Location string
- The name of the location of the instance. This can be a region for ENTERPRISE tier instances. If it is not provided, the provider region or zone is used.
- Project string
- The project in which the resource belongs. If it is not provided, the provider project is used.
- Name string
- The name of a Filestore instance.
- Location string
- The name of the location of the instance. This can be a region for ENTERPRISE tier instances. If it is not provided, the provider region or zone is used.
- Project string
- The project in which the resource belongs. If it is not provided, the provider project is used.
- name String
- The name of a Filestore instance.
- location String
- The name of the location of the instance. This can be a region for ENTERPRISE tier instances. If it is not provided, the provider region or zone is used.
- project String
- The project in which the resource belongs. If it is not provided, the provider project is used.
- name string
- The name of a Filestore instance.
- location string
- The name of the location of the instance. This can be a region for ENTERPRISE tier instances. If it is not provided, the provider region or zone is used.
- project string
- The project in which the resource belongs. If it is not provided, the provider project is used.
- name str
- The name of a Filestore instance.
- location str
- The name of the location of the instance. This can be a region for ENTERPRISE tier instances. If it is not provided, the provider region or zone is used.
- project str
- The project in which the resource belongs. If it is not provided, the provider project is used.
- name String
- The name of a Filestore instance.
- location String
- The name of the location of the instance. This can be a region for ENTERPRISE tier instances. If it is not provided, the provider region or zone is used.
- project String
- The project in which the resource belongs. If it is not provided, the provider project is used.
getInstance Result
The following output properties are available:
- Create
Time string - Deletion
Protection boolEnabled - Deletion
Protection stringReason - Description string
- Effective
Labels Dictionary<string, string> - Etag string
- List<Get
Instance File Share> - Id string
- The provider-assigned unique ID for this managed resource.
- Kms
Key stringName - Labels Dictionary<string, string>
- Name string
- Networks
List<Get
Instance Network> - Protocol string
- Pulumi
Labels Dictionary<string, string> - Tier string
- Zone string
- Location string
- Project string
- Create
Time string - Deletion
Protection boolEnabled - Deletion
Protection stringReason - Description string
- Effective
Labels map[string]string - Etag string
- []Get
Instance File Share - Id string
- The provider-assigned unique ID for this managed resource.
- Kms
Key stringName - Labels map[string]string
- Name string
- Networks
[]Get
Instance Network - Protocol string
- Pulumi
Labels map[string]string - Tier string
- Zone string
- Location string
- Project string
- create
Time String - deletion
Protection BooleanEnabled - deletion
Protection StringReason - description String
- effective
Labels Map<String,String> - etag String
- List<Get
Instance File Share> - id String
- The provider-assigned unique ID for this managed resource.
- kms
Key StringName - labels Map<String,String>
- name String
- networks
List<Get
Instance Network> - protocol String
- pulumi
Labels Map<String,String> - tier String
- zone String
- location String
- project String
- create
Time string - deletion
Protection booleanEnabled - deletion
Protection stringReason - description string
- effective
Labels {[key: string]: string} - etag string
- Get
Instance File Share[] - id string
- The provider-assigned unique ID for this managed resource.
- kms
Key stringName - labels {[key: string]: string}
- name string
- networks
Get
Instance Network[] - protocol string
- pulumi
Labels {[key: string]: string} - tier string
- zone string
- location string
- project string
- create_
time str - deletion_
protection_ boolenabled - deletion_
protection_ strreason - description str
- effective_
labels Mapping[str, str] - etag str
- Sequence[Get
Instance File Share] - id str
- The provider-assigned unique ID for this managed resource.
- kms_
key_ strname - labels Mapping[str, str]
- name str
- networks
Sequence[Get
Instance Network] - protocol str
- pulumi_
labels Mapping[str, str] - tier str
- zone str
- location str
- project str
- create
Time String - deletion
Protection BooleanEnabled - deletion
Protection StringReason - description String
- effective
Labels Map<String> - etag String
- List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- kms
Key StringName - labels Map<String>
- name String
- networks List<Property Map>
- protocol String
- pulumi
Labels Map<String> - tier String
- zone String
- location String
- project String
Supporting Types
GetInstanceFileShare
- Capacity
Gb int - File share capacity in GiB. This must be at least 1024 GiB for the standard tier, or 2560 GiB for the premium tier.
- Name string
- The name of a Filestore instance.
- Nfs
Export List<GetOptions Instance File Share Nfs Export Option> - Nfs Export Options. There is a limit of 10 export options per file share.
- Source
Backup string - The resource name of the backup, in the format projects/{projectId}/locations/{locationId}/backups/{backupId}, that this file share has been restored from.
- Capacity
Gb int - File share capacity in GiB. This must be at least 1024 GiB for the standard tier, or 2560 GiB for the premium tier.
- Name string
- The name of a Filestore instance.
- Nfs
Export []GetOptions Instance File Share Nfs Export Option - Nfs Export Options. There is a limit of 10 export options per file share.
- Source
Backup string - The resource name of the backup, in the format projects/{projectId}/locations/{locationId}/backups/{backupId}, that this file share has been restored from.
- capacity
Gb Integer - File share capacity in GiB. This must be at least 1024 GiB for the standard tier, or 2560 GiB for the premium tier.
- name String
- The name of a Filestore instance.
- nfs
Export List<GetOptions Instance File Share Nfs Export Option> - Nfs Export Options. There is a limit of 10 export options per file share.
- source
Backup String - The resource name of the backup, in the format projects/{projectId}/locations/{locationId}/backups/{backupId}, that this file share has been restored from.
- capacity
Gb number - File share capacity in GiB. This must be at least 1024 GiB for the standard tier, or 2560 GiB for the premium tier.
- name string
- The name of a Filestore instance.
- nfs
Export GetOptions Instance File Share Nfs Export Option[] - Nfs Export Options. There is a limit of 10 export options per file share.
- source
Backup string - The resource name of the backup, in the format projects/{projectId}/locations/{locationId}/backups/{backupId}, that this file share has been restored from.
- capacity_
gb int - File share capacity in GiB. This must be at least 1024 GiB for the standard tier, or 2560 GiB for the premium tier.
- name str
- The name of a Filestore instance.
- nfs_
export_ Sequence[Getoptions Instance File Share Nfs Export Option] - Nfs Export Options. There is a limit of 10 export options per file share.
- source_
backup str - The resource name of the backup, in the format projects/{projectId}/locations/{locationId}/backups/{backupId}, that this file share has been restored from.
- capacity
Gb Number - File share capacity in GiB. This must be at least 1024 GiB for the standard tier, or 2560 GiB for the premium tier.
- name String
- The name of a Filestore instance.
- nfs
Export List<Property Map>Options - Nfs Export Options. There is a limit of 10 export options per file share.
- source
Backup String - The resource name of the backup, in the format projects/{projectId}/locations/{locationId}/backups/{backupId}, that this file share has been restored from.
GetInstanceFileShareNfsExportOption
- Access
Mode string - Either READ_ONLY, for allowing only read requests on the exported directory, or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE. Default value: "READ_WRITE" Possible values: ["READ_ONLY", "READ_WRITE"]
- Anon
Gid int - An integer representing the anonymous group id with a default value of 65534. Anon_gid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- Anon
Uid int - An integer representing the anonymous user id with a default value of 65534. Anon_uid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- Ip
Ranges List<string> - List of either IPv4 addresses, or ranges in CIDR notation which may mount the file share. Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned. The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
- Squash
Mode string - Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH, for not allowing root access. The default is NO_ROOT_SQUASH. Default value: "NO_ROOT_SQUASH" Possible values: ["NO_ROOT_SQUASH", "ROOT_SQUASH"]
- Access
Mode string - Either READ_ONLY, for allowing only read requests on the exported directory, or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE. Default value: "READ_WRITE" Possible values: ["READ_ONLY", "READ_WRITE"]
- Anon
Gid int - An integer representing the anonymous group id with a default value of 65534. Anon_gid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- Anon
Uid int - An integer representing the anonymous user id with a default value of 65534. Anon_uid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- Ip
Ranges []string - List of either IPv4 addresses, or ranges in CIDR notation which may mount the file share. Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned. The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
- Squash
Mode string - Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH, for not allowing root access. The default is NO_ROOT_SQUASH. Default value: "NO_ROOT_SQUASH" Possible values: ["NO_ROOT_SQUASH", "ROOT_SQUASH"]
- access
Mode String - Either READ_ONLY, for allowing only read requests on the exported directory, or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE. Default value: "READ_WRITE" Possible values: ["READ_ONLY", "READ_WRITE"]
- anon
Gid Integer - An integer representing the anonymous group id with a default value of 65534. Anon_gid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- anon
Uid Integer - An integer representing the anonymous user id with a default value of 65534. Anon_uid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- ip
Ranges List<String> - List of either IPv4 addresses, or ranges in CIDR notation which may mount the file share. Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned. The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
- squash
Mode String - Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH, for not allowing root access. The default is NO_ROOT_SQUASH. Default value: "NO_ROOT_SQUASH" Possible values: ["NO_ROOT_SQUASH", "ROOT_SQUASH"]
- access
Mode string - Either READ_ONLY, for allowing only read requests on the exported directory, or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE. Default value: "READ_WRITE" Possible values: ["READ_ONLY", "READ_WRITE"]
- anon
Gid number - An integer representing the anonymous group id with a default value of 65534. Anon_gid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- anon
Uid number - An integer representing the anonymous user id with a default value of 65534. Anon_uid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- ip
Ranges string[] - List of either IPv4 addresses, or ranges in CIDR notation which may mount the file share. Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned. The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
- squash
Mode string - Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH, for not allowing root access. The default is NO_ROOT_SQUASH. Default value: "NO_ROOT_SQUASH" Possible values: ["NO_ROOT_SQUASH", "ROOT_SQUASH"]
- access_
mode str - Either READ_ONLY, for allowing only read requests on the exported directory, or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE. Default value: "READ_WRITE" Possible values: ["READ_ONLY", "READ_WRITE"]
- anon_
gid int - An integer representing the anonymous group id with a default value of 65534. Anon_gid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- anon_
uid int - An integer representing the anonymous user id with a default value of 65534. Anon_uid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- ip_
ranges Sequence[str] - List of either IPv4 addresses, or ranges in CIDR notation which may mount the file share. Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned. The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
- squash_
mode str - Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH, for not allowing root access. The default is NO_ROOT_SQUASH. Default value: "NO_ROOT_SQUASH" Possible values: ["NO_ROOT_SQUASH", "ROOT_SQUASH"]
- access
Mode String - Either READ_ONLY, for allowing only read requests on the exported directory, or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE. Default value: "READ_WRITE" Possible values: ["READ_ONLY", "READ_WRITE"]
- anon
Gid Number - An integer representing the anonymous group id with a default value of 65534. Anon_gid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- anon
Uid Number - An integer representing the anonymous user id with a default value of 65534. Anon_uid may only be set with squashMode of ROOT_SQUASH. An error will be returned if this field is specified for other squashMode settings.
- ip
Ranges List<String> - List of either IPv4 addresses, or ranges in CIDR notation which may mount the file share. Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned. The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
- squash
Mode String - Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH, for not allowing root access. The default is NO_ROOT_SQUASH. Default value: "NO_ROOT_SQUASH" Possible values: ["NO_ROOT_SQUASH", "ROOT_SQUASH"]
GetInstanceNetwork
- Connect
Mode string - The network connect mode of the Filestore instance. If not provided, the connect mode defaults to DIRECT_PEERING. Default value: "DIRECT_PEERING" Possible values: ["DIRECT_PEERING", "PRIVATE_SERVICE_ACCESS"]
- Ip
Addresses List<string> - A list of IPv4 or IPv6 addresses.
- Modes List<string>
- IP versions for which the instance has IP addresses assigned. Possible values: ["ADDRESS_MODE_UNSPECIFIED", "MODE_IPV4", "MODE_IPV6"]
- Network string
- The name of the GCE VPC network to which the instance is connected.
- Reserved
Ip stringRange - A /29 CIDR block that identifies the range of IP addresses reserved for this instance.
- Connect
Mode string - The network connect mode of the Filestore instance. If not provided, the connect mode defaults to DIRECT_PEERING. Default value: "DIRECT_PEERING" Possible values: ["DIRECT_PEERING", "PRIVATE_SERVICE_ACCESS"]
- Ip
Addresses []string - A list of IPv4 or IPv6 addresses.
- Modes []string
- IP versions for which the instance has IP addresses assigned. Possible values: ["ADDRESS_MODE_UNSPECIFIED", "MODE_IPV4", "MODE_IPV6"]
- Network string
- The name of the GCE VPC network to which the instance is connected.
- Reserved
Ip stringRange - A /29 CIDR block that identifies the range of IP addresses reserved for this instance.
- connect
Mode String - The network connect mode of the Filestore instance. If not provided, the connect mode defaults to DIRECT_PEERING. Default value: "DIRECT_PEERING" Possible values: ["DIRECT_PEERING", "PRIVATE_SERVICE_ACCESS"]
- ip
Addresses List<String> - A list of IPv4 or IPv6 addresses.
- modes List<String>
- IP versions for which the instance has IP addresses assigned. Possible values: ["ADDRESS_MODE_UNSPECIFIED", "MODE_IPV4", "MODE_IPV6"]
- network String
- The name of the GCE VPC network to which the instance is connected.
- reserved
Ip StringRange - A /29 CIDR block that identifies the range of IP addresses reserved for this instance.
- connect
Mode string - The network connect mode of the Filestore instance. If not provided, the connect mode defaults to DIRECT_PEERING. Default value: "DIRECT_PEERING" Possible values: ["DIRECT_PEERING", "PRIVATE_SERVICE_ACCESS"]
- ip
Addresses string[] - A list of IPv4 or IPv6 addresses.
- modes string[]
- IP versions for which the instance has IP addresses assigned. Possible values: ["ADDRESS_MODE_UNSPECIFIED", "MODE_IPV4", "MODE_IPV6"]
- network string
- The name of the GCE VPC network to which the instance is connected.
- reserved
Ip stringRange - A /29 CIDR block that identifies the range of IP addresses reserved for this instance.
- connect_
mode str - The network connect mode of the Filestore instance. If not provided, the connect mode defaults to DIRECT_PEERING. Default value: "DIRECT_PEERING" Possible values: ["DIRECT_PEERING", "PRIVATE_SERVICE_ACCESS"]
- ip_
addresses Sequence[str] - A list of IPv4 or IPv6 addresses.
- modes Sequence[str]
- IP versions for which the instance has IP addresses assigned. Possible values: ["ADDRESS_MODE_UNSPECIFIED", "MODE_IPV4", "MODE_IPV6"]
- network str
- The name of the GCE VPC network to which the instance is connected.
- reserved_
ip_ strrange - A /29 CIDR block that identifies the range of IP addresses reserved for this instance.
- connect
Mode String - The network connect mode of the Filestore instance. If not provided, the connect mode defaults to DIRECT_PEERING. Default value: "DIRECT_PEERING" Possible values: ["DIRECT_PEERING", "PRIVATE_SERVICE_ACCESS"]
- ip
Addresses List<String> - A list of IPv4 or IPv6 addresses.
- modes List<String>
- IP versions for which the instance has IP addresses assigned. Possible values: ["ADDRESS_MODE_UNSPECIFIED", "MODE_IPV4", "MODE_IPV6"]
- network String
- The name of the GCE VPC network to which the instance is connected.
- reserved
Ip StringRange - A /29 CIDR block that identifies the range of IP addresses reserved for this instance.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.