Volume Quota Rule
QuotaRule specifies the maximum capacity a user or group can use within a volume. They can be used for creating default and individual quota rules. To get more information about VolumeQuotaRule, see:
How-to Guides
Example Usage
Netapp Volume Quota Rule Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = gcp.compute.getNetwork({
name: "test-network",
});
const defaultStoragePool = new gcp.netapp.StoragePool("default", {
name: "test-pool",
location: "us-west2",
serviceLevel: "PREMIUM",
capacityGib: "2048",
network: _default.then(_default => _default.id),
});
const defaultVolume = new gcp.netapp.Volume("default", {
location: defaultStoragePool.location,
name: "test-volume",
capacityGib: "100",
shareName: "test-volume",
storagePool: defaultStoragePool.name,
protocols: ["NFSV3"],
});
const testQuotaRule = new gcp.netapp.VolumeQuotaRule("test_quota_rule", {
location: defaultVolume.location,
volumeName: defaultVolume.name,
type: "DEFAULT_USER_QUOTA",
diskLimitMib: 50,
name: "test-volume-quota-rule",
}, {
dependsOn: [defaultVolume],
});
import pulumi
import pulumi_gcp as gcp
default = gcp.compute.get_network(name="test-network")
default_storage_pool = gcp.netapp.StoragePool("default",
name="test-pool",
location="us-west2",
service_level="PREMIUM",
capacity_gib="2048",
network=default.id)
default_volume = gcp.netapp.Volume("default",
location=default_storage_pool.location,
name="test-volume",
capacity_gib="100",
share_name="test-volume",
storage_pool=default_storage_pool.name,
protocols=["NFSV3"])
test_quota_rule = gcp.netapp.VolumeQuotaRule("test_quota_rule",
location=default_volume.location,
volume_name=default_volume.name,
type="DEFAULT_USER_QUOTA",
disk_limit_mib=50,
name="test-volume-quota-rule",
opts = pulumi.ResourceOptions(depends_on=[default_volume]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = Gcp.Compute.GetNetwork.Invoke(new()
{
Name = "test-network",
});
var defaultStoragePool = new Gcp.Netapp.StoragePool("default", new()
{
Name = "test-pool",
Location = "us-west2",
ServiceLevel = "PREMIUM",
CapacityGib = "2048",
Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.Id)),
});
var defaultVolume = new Gcp.Netapp.Volume("default", new()
{
Location = defaultStoragePool.Location,
Name = "test-volume",
CapacityGib = "100",
ShareName = "test-volume",
StoragePool = defaultStoragePool.Name,
Protocols = new[]
{
"NFSV3",
},
});
var testQuotaRule = new Gcp.Netapp.VolumeQuotaRule("test_quota_rule", new()
{
Location = defaultVolume.Location,
VolumeName = defaultVolume.Name,
Type = "DEFAULT_USER_QUOTA",
DiskLimitMib = 50,
Name = "test-volume-quota-rule",
}, new CustomResourceOptions
{
DependsOn =
{
defaultVolume,
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/netapp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
Name: "test-network",
}, nil)
if err != nil {
return err
}
defaultStoragePool, err := netapp.NewStoragePool(ctx, "default", &netapp.StoragePoolArgs{
Name: pulumi.String("test-pool"),
Location: pulumi.String("us-west2"),
ServiceLevel: pulumi.String("PREMIUM"),
CapacityGib: pulumi.String("2048"),
Network: pulumi.String(_default.Id),
})
if err != nil {
return err
}
defaultVolume, err := netapp.NewVolume(ctx, "default", &netapp.VolumeArgs{
Location: defaultStoragePool.Location,
Name: pulumi.String("test-volume"),
CapacityGib: pulumi.String("100"),
ShareName: pulumi.String("test-volume"),
StoragePool: defaultStoragePool.Name,
Protocols: pulumi.StringArray{
pulumi.String("NFSV3"),
},
})
if err != nil {
return err
}
_, err = netapp.NewVolumeQuotaRule(ctx, "test_quota_rule", &netapp.VolumeQuotaRuleArgs{
Location: defaultVolume.Location,
VolumeName: defaultVolume.Name,
Type: pulumi.String("DEFAULT_USER_QUOTA"),
DiskLimitMib: pulumi.Int(50),
Name: pulumi.String("test-volume-quota-rule"),
}, pulumi.DependsOn([]pulumi.Resource{
defaultVolume,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.netapp.StoragePool;
import com.pulumi.gcp.netapp.StoragePoolArgs;
import com.pulumi.gcp.netapp.Volume;
import com.pulumi.gcp.netapp.VolumeArgs;
import com.pulumi.gcp.netapp.VolumeQuotaRule;
import com.pulumi.gcp.netapp.VolumeQuotaRuleArgs;
import com.pulumi.resources.CustomResourceOptions;
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 default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("test-network")
.build());
var defaultStoragePool = new StoragePool("defaultStoragePool", StoragePoolArgs.builder()
.name("test-pool")
.location("us-west2")
.serviceLevel("PREMIUM")
.capacityGib("2048")
.network(default_.id())
.build());
var defaultVolume = new Volume("defaultVolume", VolumeArgs.builder()
.location(defaultStoragePool.location())
.name("test-volume")
.capacityGib("100")
.shareName("test-volume")
.storagePool(defaultStoragePool.name())
.protocols("NFSV3")
.build());
var testQuotaRule = new VolumeQuotaRule("testQuotaRule", VolumeQuotaRuleArgs.builder()
.location(defaultVolume.location())
.volumeName(defaultVolume.name())
.type("DEFAULT_USER_QUOTA")
.diskLimitMib(50)
.name("test-volume-quota-rule")
.build(), CustomResourceOptions.builder()
.dependsOn(defaultVolume)
.build());
}
}
resources:
defaultStoragePool:
type: gcp:netapp:StoragePool
name: default
properties:
name: test-pool
location: us-west2
serviceLevel: PREMIUM
capacityGib: 2048
network: ${default.id}
defaultVolume:
type: gcp:netapp:Volume
name: default
properties:
location: ${defaultStoragePool.location}
name: test-volume
capacityGib: 100
shareName: test-volume
storagePool: ${defaultStoragePool.name}
protocols:
- NFSV3
testQuotaRule:
type: gcp:netapp:VolumeQuotaRule
name: test_quota_rule
properties:
location: ${defaultVolume.location}
volumeName: ${defaultVolume.name}
type: DEFAULT_USER_QUOTA
diskLimitMib: 50
name: test-volume-quota-rule
options:
dependsOn:
- ${defaultVolume}
variables:
default:
fn::invoke:
function: gcp:compute:getNetwork
arguments:
name: test-network
Import
VolumeQuotaRule can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/quotaRules/{{name}}
{{project}}/{{location}}/{{volume_name}}/{{name}}
{{location}}/{{volume_name}}/{{name}}
When using thepulumi import
command, VolumeQuotaRule can be imported using one of the formats above. For example:
$ pulumi import gcp:netapp/volumeQuotaRule:VolumeQuotaRule default projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/quotaRules/{{name}}
$ pulumi import gcp:netapp/volumeQuotaRule:VolumeQuotaRule default {{project}}/{{location}}/{{volume_name}}/{{name}}
$ pulumi import gcp:netapp/volumeQuotaRule:VolumeQuotaRule default {{location}}/{{volume_name}}/{{name}}
Properties
Create time of the quota rule. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
Description for the quota rule.
The maximum allowed capacity in MiB.
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Labels as key value pairs of the quota rule. Example: { "owner": "Bob", "department": "finance", "purpose": "testing" }
. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels
for all of the labels present on the resource.
The combination of labels configured directly on the resource and default labels configured on the provider.
State details of the quota rule
Name of the volume to create the quotaRule in.