upcloud.FileStorage
Resource for managing UpCloud file storages (EXPERIMENTAL)
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@upcloud/pulumi-upcloud";
// Create network for the File Storage
const _this = new upcloud.Network("this", {
name: "file-storage-net-test",
zone: "fi-hel2",
ipNetwork: {
address: "172.16.8.0/24",
dhcp: true,
family: "IPv4",
},
});
const example = new upcloud.FileStorage("example", {
name: "example-file-storage-test",
size: 250,
zone: "fi-hel2",
configuredStatus: "stopped",
labels: {
environment: "staging",
customer: "example-customer",
},
shares: [{
name: "write-to-project",
path: "/project",
acls: [{
target: "172.16.8.12",
permission: "rw",
}],
}],
networks: [{
family: "IPv4",
name: "example-private-net",
uuid: _this.id,
ipAddress: "172.16.8.11",
}],
});
import pulumi
import pulumi_upcloud as upcloud
# Create network for the File Storage
this = upcloud.Network("this",
name="file-storage-net-test",
zone="fi-hel2",
ip_network={
"address": "172.16.8.0/24",
"dhcp": True,
"family": "IPv4",
})
example = upcloud.FileStorage("example",
name="example-file-storage-test",
size=250,
zone="fi-hel2",
configured_status="stopped",
labels={
"environment": "staging",
"customer": "example-customer",
},
shares=[{
"name": "write-to-project",
"path": "/project",
"acls": [{
"target": "172.16.8.12",
"permission": "rw",
}],
}],
networks=[{
"family": "IPv4",
"name": "example-private-net",
"uuid": this.id,
"ip_address": "172.16.8.11",
}])
package main
import (
"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create network for the File Storage
this, err := upcloud.NewNetwork(ctx, "this", &upcloud.NetworkArgs{
Name: pulumi.String("file-storage-net-test"),
Zone: pulumi.String("fi-hel2"),
IpNetwork: &upcloud.NetworkIpNetworkArgs{
Address: pulumi.String("172.16.8.0/24"),
Dhcp: pulumi.Bool(true),
Family: pulumi.String("IPv4"),
},
})
if err != nil {
return err
}
_, err = upcloud.NewFileStorage(ctx, "example", &upcloud.FileStorageArgs{
Name: pulumi.String("example-file-storage-test"),
Size: pulumi.Int(250),
Zone: pulumi.String("fi-hel2"),
ConfiguredStatus: pulumi.String("stopped"),
Labels: pulumi.StringMap{
"environment": pulumi.String("staging"),
"customer": pulumi.String("example-customer"),
},
Shares: upcloud.FileStorageShareArray{
&upcloud.FileStorageShareArgs{
Name: pulumi.String("write-to-project"),
Path: pulumi.String("/project"),
Acls: upcloud.FileStorageShareAclArray{
&upcloud.FileStorageShareAclArgs{
Target: pulumi.String("172.16.8.12"),
Permission: pulumi.String("rw"),
},
},
},
},
Networks: upcloud.FileStorageNetworkArray{
&upcloud.FileStorageNetworkArgs{
Family: pulumi.String("IPv4"),
Name: pulumi.String("example-private-net"),
Uuid: this.ID(),
IpAddress: pulumi.String("172.16.8.11"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = UpCloud.Pulumi.UpCloud;
return await Deployment.RunAsync(() =>
{
// Create network for the File Storage
var @this = new UpCloud.Network("this", new()
{
Name = "file-storage-net-test",
Zone = "fi-hel2",
IpNetwork = new UpCloud.Inputs.NetworkIpNetworkArgs
{
Address = "172.16.8.0/24",
Dhcp = true,
Family = "IPv4",
},
});
var example = new UpCloud.FileStorage("example", new()
{
Name = "example-file-storage-test",
Size = 250,
Zone = "fi-hel2",
ConfiguredStatus = "stopped",
Labels =
{
{ "environment", "staging" },
{ "customer", "example-customer" },
},
Shares = new[]
{
new UpCloud.Inputs.FileStorageShareArgs
{
Name = "write-to-project",
Path = "/project",
Acls = new[]
{
new UpCloud.Inputs.FileStorageShareAclArgs
{
Target = "172.16.8.12",
Permission = "rw",
},
},
},
},
Networks = new[]
{
new UpCloud.Inputs.FileStorageNetworkArgs
{
Family = "IPv4",
Name = "example-private-net",
Uuid = @this.Id,
IpAddress = "172.16.8.11",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.Network;
import com.pulumi.upcloud.NetworkArgs;
import com.pulumi.upcloud.inputs.NetworkIpNetworkArgs;
import com.pulumi.upcloud.FileStorage;
import com.pulumi.upcloud.FileStorageArgs;
import com.pulumi.upcloud.inputs.FileStorageShareArgs;
import com.pulumi.upcloud.inputs.FileStorageNetworkArgs;
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) {
// Create network for the File Storage
var this_ = new Network("this", NetworkArgs.builder()
.name("file-storage-net-test")
.zone("fi-hel2")
.ipNetwork(NetworkIpNetworkArgs.builder()
.address("172.16.8.0/24")
.dhcp(true)
.family("IPv4")
.build())
.build());
var example = new FileStorage("example", FileStorageArgs.builder()
.name("example-file-storage-test")
.size(250)
.zone("fi-hel2")
.configuredStatus("stopped")
.labels(Map.ofEntries(
Map.entry("environment", "staging"),
Map.entry("customer", "example-customer")
))
.shares(FileStorageShareArgs.builder()
.name("write-to-project")
.path("/project")
.acls(FileStorageShareAclArgs.builder()
.target("172.16.8.12")
.permission("rw")
.build())
.build())
.networks(FileStorageNetworkArgs.builder()
.family("IPv4")
.name("example-private-net")
.uuid(this_.id())
.ipAddress("172.16.8.11")
.build())
.build());
}
}
resources:
# Create network for the File Storage
this:
type: upcloud:Network
properties:
name: file-storage-net-test
zone: fi-hel2
ipNetwork:
address: 172.16.8.0/24
dhcp: true
family: IPv4
example:
type: upcloud:FileStorage
properties:
name: example-file-storage-test
size: 250
zone: fi-hel2
configuredStatus: stopped
labels:
environment: staging
customer: example-customer
shares:
- name: write-to-project
path: /project
acls:
- target: 172.16.8.12
permission: rw
networks:
- family: IPv4
name: example-private-net
uuid: ${this.id}
ipAddress: 172.16.8.11
Create FileStorage Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FileStorage(name: string, args: FileStorageArgs, opts?: CustomResourceOptions);@overload
def FileStorage(resource_name: str,
args: FileStorageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FileStorage(resource_name: str,
opts: Optional[ResourceOptions] = None,
configured_status: Optional[str] = None,
size: Optional[int] = None,
zone: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
networks: Optional[Sequence[FileStorageNetworkArgs]] = None,
shares: Optional[Sequence[FileStorageShareArgs]] = None)func NewFileStorage(ctx *Context, name string, args FileStorageArgs, opts ...ResourceOption) (*FileStorage, error)public FileStorage(string name, FileStorageArgs args, CustomResourceOptions? opts = null)
public FileStorage(String name, FileStorageArgs args)
public FileStorage(String name, FileStorageArgs args, CustomResourceOptions options)
type: upcloud:FileStorage
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FileStorageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FileStorageArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FileStorageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FileStorageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FileStorageArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var fileStorageResource = new UpCloud.FileStorage("fileStorageResource", new()
{
ConfiguredStatus = "string",
Size = 0,
Zone = "string",
Labels =
{
{ "string", "string" },
},
Name = "string",
Networks = new[]
{
new UpCloud.Inputs.FileStorageNetworkArgs
{
Family = "string",
Name = "string",
Uuid = "string",
IpAddress = "string",
},
},
Shares = new[]
{
new UpCloud.Inputs.FileStorageShareArgs
{
Name = "string",
Path = "string",
Acls = new[]
{
new UpCloud.Inputs.FileStorageShareAclArgs
{
Permission = "string",
Target = "string",
},
},
},
},
});
example, err := upcloud.NewFileStorage(ctx, "fileStorageResource", &upcloud.FileStorageArgs{
ConfiguredStatus: pulumi.String("string"),
Size: pulumi.Int(0),
Zone: pulumi.String("string"),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
Networks: upcloud.FileStorageNetworkArray{
&upcloud.FileStorageNetworkArgs{
Family: pulumi.String("string"),
Name: pulumi.String("string"),
Uuid: pulumi.String("string"),
IpAddress: pulumi.String("string"),
},
},
Shares: upcloud.FileStorageShareArray{
&upcloud.FileStorageShareArgs{
Name: pulumi.String("string"),
Path: pulumi.String("string"),
Acls: upcloud.FileStorageShareAclArray{
&upcloud.FileStorageShareAclArgs{
Permission: pulumi.String("string"),
Target: pulumi.String("string"),
},
},
},
},
})
var fileStorageResource = new FileStorage("fileStorageResource", FileStorageArgs.builder()
.configuredStatus("string")
.size(0)
.zone("string")
.labels(Map.of("string", "string"))
.name("string")
.networks(FileStorageNetworkArgs.builder()
.family("string")
.name("string")
.uuid("string")
.ipAddress("string")
.build())
.shares(FileStorageShareArgs.builder()
.name("string")
.path("string")
.acls(FileStorageShareAclArgs.builder()
.permission("string")
.target("string")
.build())
.build())
.build());
file_storage_resource = upcloud.FileStorage("fileStorageResource",
configured_status="string",
size=0,
zone="string",
labels={
"string": "string",
},
name="string",
networks=[{
"family": "string",
"name": "string",
"uuid": "string",
"ip_address": "string",
}],
shares=[{
"name": "string",
"path": "string",
"acls": [{
"permission": "string",
"target": "string",
}],
}])
const fileStorageResource = new upcloud.FileStorage("fileStorageResource", {
configuredStatus: "string",
size: 0,
zone: "string",
labels: {
string: "string",
},
name: "string",
networks: [{
family: "string",
name: "string",
uuid: "string",
ipAddress: "string",
}],
shares: [{
name: "string",
path: "string",
acls: [{
permission: "string",
target: "string",
}],
}],
});
type: upcloud:FileStorage
properties:
configuredStatus: string
labels:
string: string
name: string
networks:
- family: string
ipAddress: string
name: string
uuid: string
shares:
- acls:
- permission: string
target: string
name: string
path: string
size: 0
zone: string
FileStorage Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The FileStorage resource accepts the following input properties:
- Configured
Status string - The service configured status indicates the service's current intended status. Managed by the customer.
- Size int
- Size of the file storage in GB.
- Zone string
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list. - Labels Dictionary<string, string>
- User defined key-value pairs to classify the file storage.
- Name string
- Name of the file storage service.
- Networks
List<Up
Cloud. Pulumi. Up Cloud. Inputs. File Storage Network> - Network attached to this file storage (currently supports at most one of these blocks).
-
List<Up
Cloud. Pulumi. Up Cloud. Inputs. File Storage Share> - List of shares exported by this file storage.
- Configured
Status string - The service configured status indicates the service's current intended status. Managed by the customer.
- Size int
- Size of the file storage in GB.
- Zone string
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list. - Labels map[string]string
- User defined key-value pairs to classify the file storage.
- Name string
- Name of the file storage service.
- Networks
[]File
Storage Network Args - Network attached to this file storage (currently supports at most one of these blocks).
-
[]File
Storage Share Args - List of shares exported by this file storage.
- configured
Status String - The service configured status indicates the service's current intended status. Managed by the customer.
- size Integer
- Size of the file storage in GB.
- zone String
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list. - labels Map<String,String>
- User defined key-value pairs to classify the file storage.
- name String
- Name of the file storage service.
- networks
List<File
Storage Network> - Network attached to this file storage (currently supports at most one of these blocks).
-
List<File
Storage Share> - List of shares exported by this file storage.
- configured
Status string - The service configured status indicates the service's current intended status. Managed by the customer.
- size number
- Size of the file storage in GB.
- zone string
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list. - labels {[key: string]: string}
- User defined key-value pairs to classify the file storage.
- name string
- Name of the file storage service.
- networks
File
Storage Network[] - Network attached to this file storage (currently supports at most one of these blocks).
-
File
Storage Share[] - List of shares exported by this file storage.
- configured_
status str - The service configured status indicates the service's current intended status. Managed by the customer.
- size int
- Size of the file storage in GB.
- zone str
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list. - labels Mapping[str, str]
- User defined key-value pairs to classify the file storage.
- name str
- Name of the file storage service.
- networks
Sequence[File
Storage Network Args] - Network attached to this file storage (currently supports at most one of these blocks).
-
Sequence[File
Storage Share Args] - List of shares exported by this file storage.
- configured
Status String - The service configured status indicates the service's current intended status. Managed by the customer.
- size Number
- Size of the file storage in GB.
- zone String
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list. - labels Map<String>
- User defined key-value pairs to classify the file storage.
- name String
- Name of the file storage service.
- networks List<Property Map>
- Network attached to this file storage (currently supports at most one of these blocks).
- List<Property Map>
- List of shares exported by this file storage.
Outputs
All input properties are implicitly available as output properties. Additionally, the FileStorage resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing FileStorage Resource
Get an existing FileStorage resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FileStorageState, opts?: CustomResourceOptions): FileStorage@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
configured_status: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
networks: Optional[Sequence[FileStorageNetworkArgs]] = None,
shares: Optional[Sequence[FileStorageShareArgs]] = None,
size: Optional[int] = None,
zone: Optional[str] = None) -> FileStoragefunc GetFileStorage(ctx *Context, name string, id IDInput, state *FileStorageState, opts ...ResourceOption) (*FileStorage, error)public static FileStorage Get(string name, Input<string> id, FileStorageState? state, CustomResourceOptions? opts = null)public static FileStorage get(String name, Output<String> id, FileStorageState state, CustomResourceOptions options)resources: _: type: upcloud:FileStorage get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Configured
Status string - The service configured status indicates the service's current intended status. Managed by the customer.
- Labels Dictionary<string, string>
- User defined key-value pairs to classify the file storage.
- Name string
- Name of the file storage service.
- Networks
List<Up
Cloud. Pulumi. Up Cloud. Inputs. File Storage Network> - Network attached to this file storage (currently supports at most one of these blocks).
-
List<Up
Cloud. Pulumi. Up Cloud. Inputs. File Storage Share> - List of shares exported by this file storage.
- Size int
- Size of the file storage in GB.
- Zone string
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list.
- Configured
Status string - The service configured status indicates the service's current intended status. Managed by the customer.
- Labels map[string]string
- User defined key-value pairs to classify the file storage.
- Name string
- Name of the file storage service.
- Networks
[]File
Storage Network Args - Network attached to this file storage (currently supports at most one of these blocks).
-
[]File
Storage Share Args - List of shares exported by this file storage.
- Size int
- Size of the file storage in GB.
- Zone string
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list.
- configured
Status String - The service configured status indicates the service's current intended status. Managed by the customer.
- labels Map<String,String>
- User defined key-value pairs to classify the file storage.
- name String
- Name of the file storage service.
- networks
List<File
Storage Network> - Network attached to this file storage (currently supports at most one of these blocks).
-
List<File
Storage Share> - List of shares exported by this file storage.
- size Integer
- Size of the file storage in GB.
- zone String
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list.
- configured
Status string - The service configured status indicates the service's current intended status. Managed by the customer.
- labels {[key: string]: string}
- User defined key-value pairs to classify the file storage.
- name string
- Name of the file storage service.
- networks
File
Storage Network[] - Network attached to this file storage (currently supports at most one of these blocks).
-
File
Storage Share[] - List of shares exported by this file storage.
- size number
- Size of the file storage in GB.
- zone string
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list.
- configured_
status str - The service configured status indicates the service's current intended status. Managed by the customer.
- labels Mapping[str, str]
- User defined key-value pairs to classify the file storage.
- name str
- Name of the file storage service.
- networks
Sequence[File
Storage Network Args] - Network attached to this file storage (currently supports at most one of these blocks).
-
Sequence[File
Storage Share Args] - List of shares exported by this file storage.
- size int
- Size of the file storage in GB.
- zone str
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list.
- configured
Status String - The service configured status indicates the service's current intended status. Managed by the customer.
- labels Map<String>
- User defined key-value pairs to classify the file storage.
- name String
- Name of the file storage service.
- networks List<Property Map>
- Network attached to this file storage (currently supports at most one of these blocks).
- List<Property Map>
- List of shares exported by this file storage.
- size Number
- Size of the file storage in GB.
- zone String
- Zone in which the service will be hosted, e.g.
fi-hel1. You can list available zones withupctl zone list.
Supporting Types
FileStorageNetwork, FileStorageNetworkArgs
- family str
- IP family, e.g. IPv4.
- name str
- Attachment name (unique per this service).
- uuid str
- UUID of an existing private network to attach.
- ip_
address str - IP address to assign (optional, auto-assign otherwise).
FileStorageShare, FileStorageShareArgs
- Name string
- Unique name of the share (1–64 chars).
- Path string
- Absolute path exported by the share (e.g.
/public). - Acls
List<Up
Cloud. Pulumi. Up Cloud. Inputs. File Storage Share Acl> - Access control entries (1–50).
- Name string
- Unique name of the share (1–64 chars).
- Path string
- Absolute path exported by the share (e.g.
/public). - Acls
[]File
Storage Share Acl - Access control entries (1–50).
- name String
- Unique name of the share (1–64 chars).
- path String
- Absolute path exported by the share (e.g.
/public). - acls
List<File
Storage Share Acl> - Access control entries (1–50).
- name string
- Unique name of the share (1–64 chars).
- path string
- Absolute path exported by the share (e.g.
/public). - acls
File
Storage Share Acl[] - Access control entries (1–50).
- name str
- Unique name of the share (1–64 chars).
- path str
- Absolute path exported by the share (e.g.
/public). - acls
Sequence[File
Storage Share Acl] - Access control entries (1–50).
- name String
- Unique name of the share (1–64 chars).
- path String
- Absolute path exported by the share (e.g.
/public). - acls List<Property Map>
- Access control entries (1–50).
FileStorageShareAcl, FileStorageShareAclArgs
- Permission string
- Access level: 'ro' or 'rw'.
- Target string
- Target IP/CIDR or '*'.
- Permission string
- Access level: 'ro' or 'rw'.
- Target string
- Target IP/CIDR or '*'.
- permission String
- Access level: 'ro' or 'rw'.
- target String
- Target IP/CIDR or '*'.
- permission string
- Access level: 'ro' or 'rw'.
- target string
- Target IP/CIDR or '*'.
- permission str
- Access level: 'ro' or 'rw'.
- target str
- Target IP/CIDR or '*'.
- permission String
- Access level: 'ro' or 'rw'.
- target String
- Target IP/CIDR or '*'.
Package Details
- Repository
- upcloud UpCloudLtd/pulumi-upcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
upcloudTerraform Provider.
