com.pulumi.nomad.kotlin.ExternalVolumeArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-nomad-kotlin Show documentation
Show all versions of pulumi-nomad-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.nomad.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.nomad.ExternalVolumeArgs.builder
import com.pulumi.nomad.kotlin.inputs.ExternalVolumeCapabilityArgs
import com.pulumi.nomad.kotlin.inputs.ExternalVolumeCapabilityArgsBuilder
import com.pulumi.nomad.kotlin.inputs.ExternalVolumeMountOptionsArgs
import com.pulumi.nomad.kotlin.inputs.ExternalVolumeMountOptionsArgsBuilder
import com.pulumi.nomad.kotlin.inputs.ExternalVolumeTopologyRequestArgs
import com.pulumi.nomad.kotlin.inputs.ExternalVolumeTopologyRequestArgsBuilder
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* ## Example Usage
* Creating a volume:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as nomad from "@pulumi/nomad";
* // It can sometimes be helpful to wait for a particular plugin to be available
* const ebs = nomad.getPlugin({
* pluginId: "aws-ebs0",
* waitForHealthy: true,
* });
* const mysqlVolume = new nomad.ExternalVolume("mysql_volume", {
* type: "csi",
* pluginId: "aws-ebs0",
* volumeId: "mysql_volume",
* name: "mysql_volume",
* capacityMin: "10GiB",
* capacityMax: "20GiB",
* capabilities: [{
* accessMode: "single-node-writer",
* attachmentMode: "file-system",
* }],
* mountOptions: {
* fsType: "ext4",
* },
* topologyRequest: {
* required: {
* topologies: [
* {
* segments: {
* rack: "R1",
* zone: "us-east-1a",
* },
* },
* {
* segments: {
* rack: "R2",
* },
* },
* ],
* },
* },
* }, {
* dependsOn: [ebs],
* });
* ```
* ```python
* import pulumi
* import pulumi_nomad as nomad
* # It can sometimes be helpful to wait for a particular plugin to be available
* ebs = nomad.get_plugin(plugin_id="aws-ebs0",
* wait_for_healthy=True)
* mysql_volume = nomad.ExternalVolume("mysql_volume",
* type="csi",
* plugin_id="aws-ebs0",
* volume_id="mysql_volume",
* name="mysql_volume",
* capacity_min="10GiB",
* capacity_max="20GiB",
* capabilities=[{
* "access_mode": "single-node-writer",
* "attachment_mode": "file-system",
* }],
* mount_options={
* "fs_type": "ext4",
* },
* topology_request={
* "required": {
* "topologies": [
* {
* "segments": {
* "rack": "R1",
* "zone": "us-east-1a",
* },
* },
* {
* "segments": {
* "rack": "R2",
* },
* },
* ],
* },
* },
* opts = pulumi.ResourceOptions(depends_on=[ebs]))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Nomad = Pulumi.Nomad;
* return await Deployment.RunAsync(() =>
* {
* // It can sometimes be helpful to wait for a particular plugin to be available
* var ebs = Nomad.GetPlugin.Invoke(new()
* {
* PluginId = "aws-ebs0",
* WaitForHealthy = true,
* });
* var mysqlVolume = new Nomad.ExternalVolume("mysql_volume", new()
* {
* Type = "csi",
* PluginId = "aws-ebs0",
* VolumeId = "mysql_volume",
* Name = "mysql_volume",
* CapacityMin = "10GiB",
* CapacityMax = "20GiB",
* Capabilities = new[]
* {
* new Nomad.Inputs.ExternalVolumeCapabilityArgs
* {
* AccessMode = "single-node-writer",
* AttachmentMode = "file-system",
* },
* },
* MountOptions = new Nomad.Inputs.ExternalVolumeMountOptionsArgs
* {
* FsType = "ext4",
* },
* TopologyRequest = new Nomad.Inputs.ExternalVolumeTopologyRequestArgs
* {
* Required = new Nomad.Inputs.ExternalVolumeTopologyRequestRequiredArgs
* {
* Topologies = new[]
* {
* new Nomad.Inputs.ExternalVolumeTopologyRequestRequiredTopologyArgs
* {
* Segments =
* {
* { "rack", "R1" },
* { "zone", "us-east-1a" },
* },
* },
* new Nomad.Inputs.ExternalVolumeTopologyRequestRequiredTopologyArgs
* {
* Segments =
* {
* { "rack", "R2" },
* },
* },
* },
* },
* },
* }, new CustomResourceOptions
* {
* DependsOn =
* {
* ebs,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // It can sometimes be helpful to wait for a particular plugin to be available
* ebs, err := nomad.GetPlugin(ctx, &nomad.GetPluginArgs{
* PluginId: "aws-ebs0",
* WaitForHealthy: pulumi.BoolRef(true),
* }, nil)
* if err != nil {
* return err
* }
* _, err = nomad.NewExternalVolume(ctx, "mysql_volume", &nomad.ExternalVolumeArgs{
* Type: pulumi.String("csi"),
* PluginId: pulumi.String("aws-ebs0"),
* VolumeId: pulumi.String("mysql_volume"),
* Name: pulumi.String("mysql_volume"),
* CapacityMin: pulumi.String("10GiB"),
* CapacityMax: pulumi.String("20GiB"),
* Capabilities: nomad.ExternalVolumeCapabilityArray{
* &nomad.ExternalVolumeCapabilityArgs{
* AccessMode: pulumi.String("single-node-writer"),
* AttachmentMode: pulumi.String("file-system"),
* },
* },
* MountOptions: &nomad.ExternalVolumeMountOptionsArgs{
* FsType: pulumi.String("ext4"),
* },
* TopologyRequest: &nomad.ExternalVolumeTopologyRequestArgs{
* Required: &nomad.ExternalVolumeTopologyRequestRequiredArgs{
* Topologies: nomad.ExternalVolumeTopologyRequestRequiredTopologyArray{
* &nomad.ExternalVolumeTopologyRequestRequiredTopologyArgs{
* Segments: pulumi.StringMap{
* "rack": pulumi.String("R1"),
* "zone": pulumi.String("us-east-1a"),
* },
* },
* &nomad.ExternalVolumeTopologyRequestRequiredTopologyArgs{
* Segments: pulumi.StringMap{
* "rack": pulumi.String("R2"),
* },
* },
* },
* },
* },
* }, pulumi.DependsOn([]pulumi.Resource{
* ebs,
* }))
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.nomad.NomadFunctions;
* import com.pulumi.nomad.inputs.GetPluginArgs;
* import com.pulumi.nomad.ExternalVolume;
* import com.pulumi.nomad.ExternalVolumeArgs;
* import com.pulumi.nomad.inputs.ExternalVolumeCapabilityArgs;
* import com.pulumi.nomad.inputs.ExternalVolumeMountOptionsArgs;
* import com.pulumi.nomad.inputs.ExternalVolumeTopologyRequestArgs;
* import com.pulumi.nomad.inputs.ExternalVolumeTopologyRequestRequiredArgs;
* 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) {
* // It can sometimes be helpful to wait for a particular plugin to be available
* final var ebs = NomadFunctions.getPlugin(GetPluginArgs.builder()
* .pluginId("aws-ebs0")
* .waitForHealthy(true)
* .build());
* var mysqlVolume = new ExternalVolume("mysqlVolume", ExternalVolumeArgs.builder()
* .type("csi")
* .pluginId("aws-ebs0")
* .volumeId("mysql_volume")
* .name("mysql_volume")
* .capacityMin("10GiB")
* .capacityMax("20GiB")
* .capabilities(ExternalVolumeCapabilityArgs.builder()
* .accessMode("single-node-writer")
* .attachmentMode("file-system")
* .build())
* .mountOptions(ExternalVolumeMountOptionsArgs.builder()
* .fsType("ext4")
* .build())
* .topologyRequest(ExternalVolumeTopologyRequestArgs.builder()
* .required(ExternalVolumeTopologyRequestRequiredArgs.builder()
* .topologies(
* ExternalVolumeTopologyRequestRequiredTopologyArgs.builder()
* .segments(Map.ofEntries(
* Map.entry("rack", "R1"),
* Map.entry("zone", "us-east-1a")
* ))
* .build(),
* ExternalVolumeTopologyRequestRequiredTopologyArgs.builder()
* .segments(Map.of("rack", "R2"))
* .build())
* .build())
* .build())
* .build(), CustomResourceOptions.builder()
* .dependsOn(ebs.applyValue(getPluginResult -> getPluginResult))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* mysqlVolume:
* type: nomad:ExternalVolume
* name: mysql_volume
* properties:
* type: csi
* pluginId: aws-ebs0
* volumeId: mysql_volume
* name: mysql_volume
* capacityMin: 10GiB
* capacityMax: 20GiB
* capabilities:
* - accessMode: single-node-writer
* attachmentMode: file-system
* mountOptions:
* fsType: ext4
* topologyRequest:
* required:
* topologies:
* - segments:
* rack: R1
* zone: us-east-1a
* - segments:
* rack: R2
* options:
* dependson:
* - ${ebs}
* variables:
* # It can sometimes be helpful to wait for a particular plugin to be available
* ebs:
* fn::invoke:
* Function: nomad:getPlugin
* Arguments:
* pluginId: aws-ebs0
* waitForHealthy: true
* ```
*
* @property capabilities `(``Capability``: )` - Options for validating the capability of a volume.
* @property capacityMax `(string: )` - Option to signal a maximum volume size. This may not be supported by all storage providers.
* @property capacityMin `(string: )` - Option to signal a minimum volume size. This may not be supported by all storage providers.
* @property cloneId `(string: )` - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with `snapshot_id`.
* @property mountOptions `(block: optional)` Options for mounting `block-device` volumes without a pre-formatted file system.
* @property name `(string: )` - The display name for the volume.
* @property namespace `(string: "default")` - The namespace in which to register the volume.
* @property parameters `(map[string]string: optional)` An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
* @property pluginId `(string: )` - The ID of the Nomad plugin for registering this volume.
* @property secrets `(map[string]string: optional)` An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
* @property snapshotId `(string: )` - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with `clone_id`.
* @property topologyRequest `(``TopologyRequest``: )` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
* @property type `(string: )` - The type of the volume. Currently, only `csi` is supported.
* @property volumeId `(string: )` - The unique ID of the volume.
*/
public data class ExternalVolumeArgs(
public val capabilities: Output>? = null,
public val capacityMax: Output? = null,
public val capacityMin: Output? = null,
public val cloneId: Output? = null,
public val mountOptions: Output? = null,
public val name: Output? = null,
public val namespace: Output? = null,
public val parameters: Output