VolumeQuotaRule class
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:
- API documentation
- How-to Guides
- Documentation
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/v9/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v9/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: pulumi.StringRef("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
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
data "gcp_compute_getnetwork" "default" {
name = "test-network"
}
resource "gcp_netapp_storagepool" "default" {
name = "test-pool"
location = "us-west2"
service_level = "PREMIUM"
capacity_gib = 2048
network = data.gcp_compute_getnetwork.default.id
}
resource "gcp_netapp_volume" "default" {
location = gcp_netapp_storagepool.default.location
name = "test-volume"
capacity_gib = 100
share_name = "test-volume"
storage_pool = gcp_netapp_storagepool.default.name
protocols = ["NFSV3"]
}
resource "gcp_netapp_volumequotarule" "test_quota_rule" {
depends_on = [gcp_netapp_volume.default]
location = gcp_netapp_volume.default.location
volume_name = gcp_netapp_volume.default.name
type = "DEFAULT_USER_QUOTA"
disk_limit_mib = 50
name = "test-volume-quota-rule"
}
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.ArrayList;
import java.util.Arrays;
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 the pulumi 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}}
Constructors
- VolumeQuotaRule(String name, {VolumeQuotaRuleArgs? args, CustomResourceOptions? options})
-
Creates a new VolumeQuotaRule.
nameThe Pulumi resource name.argsArguments used to configure this VolumeQuotaRule. The set of arguments for VolumeQuotaRule.optionsResource options controlling this resource's behavior. - VolumeQuotaRule.reference(String urn)
- Creates a typed reference to an existing VolumeQuotaRule resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createTime
↔ Output<
String> -
Create time of the quota rule. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
latefinal
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
-
description
↔ Output<
String?> -
Description for the quota rule.
latefinal
-
diskLimitMib
↔ Output<
int> -
The maximum allowed capacity in MiB.
latefinal
-
effectiveLabels
↔ Output<
Map< String, String> > -
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
labels
↔ Output<
Map< String, String> ?> -
Labels as key value pairs of the quota rule. Example:
{ "owner": "Bob", "department": "finance", "purpose": "testing" }.latefinal -
location
↔ Output<
String?> -
Loction of the quotaRule. QuotaRules are child resources of volumes and live in the same location.
latefinal
-
name
↔ Output<
String> -
The resource name of the quotaRule.
latefinal
-
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
pulumiLabels
↔ Output<
Map< String, String> > -
The combination of labels configured directly on the resource
and default labels configured on the provider.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
↔ Output<
String> -
The state of the quota rule. Possible Values :
STATE_UNSPECIFIED, CREATING, UPDATING, READY, DELETING, ERRORlatefinal -
stateDetails
↔ Output<
String> -
State details of the quota rule
latefinal
-
target
↔ Output<
String?> -
The quota rule applies to the specified user or group.
Valid targets for volumes with NFS protocol enabled:
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
type
↔ Output<
String> -
Types of Quota Rule.
Possible values are:
INDIVIDUAL_USER_QUOTA,INDIVIDUAL_GROUP_QUOTA,DEFAULT_USER_QUOTA,DEFAULT_GROUP_QUOTA.latefinal -
urn
↔ Output<
String> -
latefinalinherited
-
volumeName
↔ Output<
String> -
Name of the volume to create the quotaRule in.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {VolumeQuotaRuleState? state, CustomResourceOptions? options}) → VolumeQuotaRule -
Gets an existing VolumeQuotaRule resource's state with the given
nameandid.