|
| 1 | +--- |
| 2 | +subcategory: "Cloud Container Instance (CCI)" |
| 3 | +layout: "huaweicloud" |
| 4 | +page_title: "HuaweiCloud: huaweicloud_cciv2_persistent_volume_claim" |
| 5 | +description: |- |
| 6 | + Manages a CCI persistent volume claim resource within HuaweiCloud. |
| 7 | +--- |
| 8 | + |
| 9 | +# huaweicloud_cciv2_persistent_volume_claim |
| 10 | + |
| 11 | +Manages a CCI persistent volume claim resource within HuaweiCloud. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```hcl |
| 16 | +resource "kubernetes_persistent_volume_claim" "my-pvc" { |
| 17 | + name = "my-pvc-obs" |
| 18 | + namespace = "default" |
| 19 | +
|
| 20 | + annotations = { |
| 21 | + "everest.io/obs-volume-type" = "STANDARD" |
| 22 | + "csi.storage.k8s.io/fstype" = "s3fs" |
| 23 | + "everest.io/enterprise-project-id" = "0" |
| 24 | + } |
| 25 | +
|
| 26 | + access_modes = ["ReadWriteMany"] |
| 27 | + resources { |
| 28 | + requests = { |
| 29 | + storage = "1Gi" |
| 30 | + } |
| 31 | + } |
| 32 | + storage_class_name = "csi-obs" |
| 33 | +
|
| 34 | + volume_mode = "Filesystem" |
| 35 | +} |
| 36 | +
|
| 37 | +``` |
| 38 | + |
| 39 | +## Argument Reference |
| 40 | + |
| 41 | +The following arguments are supported: |
| 42 | + |
| 43 | +* `region` - (Optional, String, ForceNew) Specifies the region in which to create the resource. |
| 44 | + If omitted, the provider-level region will be used. |
| 45 | + Changing this creates a new resource. |
| 46 | + |
| 47 | +* `name` - (Required, String, NonUpdatable) The name of the persistent volume claim in the namespace. |
| 48 | + |
| 49 | +* `namespace` - (Required, String, NonUpdatable) The name of the namespace. |
| 50 | + |
| 51 | +* `annotations` - (Optional, Map, NonUpdatable) Specifies the annotations of the persistent volume claim. |
| 52 | + |
| 53 | +* `labels` - (Optional, Map, NonUpdatable) Specifies the labels of the persistent volume claim. |
| 54 | + |
| 55 | +* `access_modes` - (Optional, List, NonUpdatable) Specifies the access_modes of the persistent volume claim. |
| 56 | + |
| 57 | +* `resources` - (Optional, List, NonUpdatable) Specifies the access_modes of the persistent volume claim. |
| 58 | + The [resources](#resources) structure is documented below. |
| 59 | + |
| 60 | +* `selector` - (Optional, List) Specifies the selector of the persistent volume claim. |
| 61 | + The [selector](#selector) structure is documented below. |
| 62 | + |
| 63 | +* `storage_class_name` - (Optional, String, NonUpdatable) Specifies the storage class name of the persistent volume claim. |
| 64 | + |
| 65 | +* `volume_mode` - (Optional, String, NonUpdatable) Specifies the volume mode of the persistent volume claim. |
| 66 | + |
| 67 | +* `valume_name` - (Optional, String, NonUpdatable) Specifies the valume name of the persistent volume claim. |
| 68 | + |
| 69 | +<a name="resources"></a> |
| 70 | +The `resources` block supports: |
| 71 | + |
| 72 | +* `limits` - (Optional, Map, NonUpdatable) Specifies the limits expressions of the resources. |
| 73 | + |
| 74 | +* `requests` - (Optional, Map, NonUpdatable) Specifies the requests labels of the resources. |
| 75 | + |
| 76 | +<a name="selector"></a> |
| 77 | +The `selector` block supports: |
| 78 | + |
| 79 | +* `match_expressions` - (Optional, List) Specifies the match expressions of the selector. |
| 80 | + The [match_expressions](#match_expressions) structure is documented below. |
| 81 | + |
| 82 | +* `match_labels` - (Optional, Map) Specifies the match labels of the selector. |
| 83 | + |
| 84 | +<a name="match_expressions"></a> |
| 85 | +The `match_expressions` block supports: |
| 86 | + |
| 87 | +* `key` - (Optional, String) Specifies the key of the match expressions. |
| 88 | + |
| 89 | +* `operator` - (Optional, String) Specifies the operator of the match expressions. |
| 90 | + |
| 91 | +* `values` - (Optional, List) Specifies the values of the match expressions. |
| 92 | + |
| 93 | +## Attribute Reference |
| 94 | + |
| 95 | +In addition to all arguments above, the following attributes are exported: |
| 96 | + |
| 97 | +* `id` - The resource ID. |
| 98 | + |
| 99 | +* `annotations` - The annotations of the persistent volume claim. |
| 100 | + |
| 101 | +* `api_version` - The API version of the persistent volume claim. |
| 102 | + |
| 103 | +* `creation_timestamp` - The creation timestamp of the persistent volume claim. |
| 104 | + |
| 105 | +* `finalizers` - The finalizers of the persistent volume claim. |
| 106 | + |
| 107 | +* `kind` - The kind of the persistent volume claim. |
| 108 | + |
| 109 | +* `labels` - The labels of the persistent volume claim. |
| 110 | + |
| 111 | +* `resource_version` - The resource version of the persistent volume claim. |
| 112 | + |
| 113 | +* `status` - The status of the persistent volume claim. |
| 114 | + |
| 115 | +* `uid` - The uid of the persistent volume claim. |
| 116 | + |
| 117 | +## Import |
| 118 | + |
| 119 | +The persistent volume claim can be imported using `namespace` and `name`, e.g. |
| 120 | + |
| 121 | +```bash |
| 122 | +$ terraform import huaweicloud_cciv2_persistent_volume_claim.test <namespace/name> |
| 123 | +``` |
0 commit comments