|
| 1 | +--- |
| 2 | +page_title: "Rancher2: rancher2_config_map_v2 Resource" |
| 3 | +--- |
| 4 | + |
| 5 | +# rancher2\_config\_map\_v2 Resource |
| 6 | + |
| 7 | +Provides a Rancher ConfigMap v2 resource. This can be used to create k8s configMaps for Rancher v2 environments and retrieve their information. ConfigMap v2 resource is available at Rancher v2.5.x and above. |
| 8 | + |
| 9 | +## Example Usage |
| 10 | + |
| 11 | +```hcl |
| 12 | +# Create a new Rancher2 ConfigMap V2 |
| 13 | +resource "rancher2_config_map_v2" "foo" { |
| 14 | + cluster_id = <CLUSTER_ID> |
| 15 | + name = "foo" |
| 16 | + data = { |
| 17 | + mydata1 = "<data1>" |
| 18 | + mydata2 = "<data2>" |
| 19 | + mydata3 = "<data3>" |
| 20 | + } |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +## Argument Reference |
| 25 | + |
| 26 | +The following arguments are supported: |
| 27 | + |
| 28 | +* `cluster_id` - (Required/ForceNew) The cluster id of the configMap V2 (string) |
| 29 | +* `data` - (Required) The data of the configMap v2 (map) |
| 30 | +* `name` - (Required/ForceNew) The name of the configMap v2 (string) |
| 31 | +* `namespace` - (Optional/ForceNew) The namespaces of the configMap v2. Default: `default` (string) |
| 32 | +* `immutable` - (Optional) If set to true, any configMap update will remove and recreate the configMap. This is a beta field enabled by k8s `ImmutableEphemeralVolumes` feature gate. Default: `false` (bool) |
| 33 | +* `annotations` - (Optional/Computed) Annotations for the configMap v2 (map) |
| 34 | +* `labels` - (Optional/Computed) Labels for the configMap v2 (map) |
| 35 | + |
| 36 | +## Attributes Reference |
| 37 | + |
| 38 | +The following attributes are exported: |
| 39 | + |
| 40 | +* `id` - (Computed) The ID of the resource (string) |
| 41 | +* `resource_version` - (Computed) The k8s resource version (string) |
| 42 | + |
| 43 | +## Timeouts |
| 44 | + |
| 45 | +`rancher2_configMap` provides the following |
| 46 | +[Timeouts](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) configuration options: |
| 47 | + |
| 48 | +- `create` - (Default `10 minutes`) Used for creating v2 configMaps. |
| 49 | +- `update` - (Default `10 minutes`) Used for v2 configMap modifications. |
| 50 | +- `delete` - (Default `10 minutes`) Used for deleting v2 configMaps. |
| 51 | + |
| 52 | +## Import |
| 53 | + |
| 54 | +V2 configMaps can be imported using the Rancher cluster ID, ConfigMap V2 namespace and name. |
| 55 | + |
| 56 | +``` |
| 57 | +$ terraform import rancher2_config_map_v2.foo <CLUSTER_ID>.<SECRET_V2_NAMESPACE>/<SECRET_V2_NAME> |
| 58 | +``` |
0 commit comments