All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.spotinst.gke.OceanLaunchSpec Maven / Gradle / Ivy

The newest version!
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.spotinst.gke;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.spotinst.Utilities;
import com.pulumi.spotinst.gke.OceanLaunchSpecArgs;
import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecState;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecAutoscaleHeadroom;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecAutoscaleHeadroomsAutomatic;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecCreateOptions;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecLabel;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecMetadata;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecNetworkInterface;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecResourceLimits;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecSchedulingTask;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecShieldedInstanceConfig;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecStorage;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecStrategy;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecTaint;
import com.pulumi.spotinst.gke.outputs.OceanLaunchSpecUpdatePolicy;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a custom Spotinst Ocean GKE Launch Spec resource.
 * 
 * > This resource can be imported from GKE node pool or not. If you want to import the node pool and create the VNG from it, please provide `node_pool_name`.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.spotinst.gke.OceanLaunchSpec;
 * import com.pulumi.spotinst.gke.OceanLaunchSpecArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecCreateOptionsArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecShieldedInstanceConfigArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecStorageArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecResourceLimitsArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecMetadataArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecLabelArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecTaintArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecAutoscaleHeadroomsAutomaticArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecAutoscaleHeadroomArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecStrategyArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecSchedulingTaskArgs;
 * import com.pulumi.spotinst.gke.inputs.OceanLaunchSpecNetworkInterfaceArgs;
 * 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) {
 *         var example = new OceanLaunchSpec("example", OceanLaunchSpecArgs.builder()
 *             .oceanId("o-123456")
 *             .nodePoolName("default-pool")
 *             .name("specialty.nodes.spotk8s.com")
 *             .sourceImage("image")
 *             .restrictScaleDown(true)
 *             .rootVolumeSize(10)
 *             .rootVolumeType("pd-standard")
 *             .instanceTypes("n1-standard-1, n1-standard-2")
 *             .tags(            
 *                 "tag1",
 *                 "tag2")
 *             .createOptions(OceanLaunchSpecCreateOptionsArgs.builder()
 *                 .initialNodes(1)
 *                 .build())
 *             .shieldedInstanceConfig(OceanLaunchSpecShieldedInstanceConfigArgs.builder()
 *                 .enableSecureBoot(false)
 *                 .enableIntegrityMonitoring(true)
 *                 .build())
 *             .storage(OceanLaunchSpecStorageArgs.builder()
 *                 .localSsdCount(5)
 *                 .build())
 *             .resourceLimits(OceanLaunchSpecResourceLimitsArgs.builder()
 *                 .maxInstanceCount(3)
 *                 .minInstanceCount(0)
 *                 .build())
 *             .serviceAccount("default")
 *             .metadatas(OceanLaunchSpecMetadataArgs.builder()
 *                 .key("gci-update-strategy")
 *                 .value("update_disabled")
 *                 .build())
 *             .labels(OceanLaunchSpecLabelArgs.builder()
 *                 .key("labelKey")
 *                 .value("labelVal")
 *                 .build())
 *             .taints(OceanLaunchSpecTaintArgs.builder()
 *                 .key("taintKey")
 *                 .value("taintVal")
 *                 .effect("taintEffect")
 *                 .build())
 *             .autoscaleHeadroomsAutomatics(OceanLaunchSpecAutoscaleHeadroomsAutomaticArgs.builder()
 *                 .autoHeadroomPercentage(5)
 *                 .build())
 *             .autoscaleHeadrooms(OceanLaunchSpecAutoscaleHeadroomArgs.builder()
 *                 .numOfUnits(5)
 *                 .cpuPerUnit(1000)
 *                 .gpuPerUnit(0)
 *                 .memoryPerUnit(2048)
 *                 .build())
 *             .strategies(OceanLaunchSpecStrategyArgs.builder()
 *                 .preemptiblePercentage(30)
 *                 .build())
 *             .schedulingTasks(OceanLaunchSpecSchedulingTaskArgs.builder()
 *                 .isEnabled(true)
 *                 .cronExpression("0 1 * * *")
 *                 .taskType("manualHeadroomUpdate")
 *                 .taskHeadrooms(OceanLaunchSpecSchedulingTaskTaskHeadroomArgs.builder()
 *                     .numOfUnits(5)
 *                     .cpuPerUnit(1000)
 *                     .gpuPerUnit(0)
 *                     .memoryPerUnit(2048)
 *                     .build())
 *                 .build())
 *             .networkInterfaces(OceanLaunchSpecNetworkInterfaceArgs.builder()
 *                 .network("test-vng-network")
 *                 .projectId("test-vng-network-project")
 *                 .accessConfigs(OceanLaunchSpecNetworkInterfaceAccessConfigArgs.builder()
 *                     .name("external-nat-vng")
 *                     .type("ONE_TO_ONE_NAT")
 *                     .build())
 *                 .aliasIpRanges(OceanLaunchSpecNetworkInterfaceAliasIpRangeArgs.builder()
 *                     .ipCidrRange("/25")
 *                     .subnetworkRangeName("gke-test-native-vpc-pods-123456-vng")
 *                     .build())
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * */ @ResourceType(type="spotinst:gke/oceanLaunchSpec:OceanLaunchSpec") public class OceanLaunchSpec extends com.pulumi.resources.CustomResource { /** * Set custom headroom per launch spec. provide list of headrooms object. * */ @Export(name="autoscaleHeadrooms", refs={List.class,OceanLaunchSpecAutoscaleHeadroom.class}, tree="[0,1]") private Output> autoscaleHeadrooms; /** * @return Set custom headroom per launch spec. provide list of headrooms object. * */ public Output>> autoscaleHeadrooms() { return Codegen.optional(this.autoscaleHeadrooms); } /** * Set automatic headroom per launch spec. * */ @Export(name="autoscaleHeadroomsAutomatics", refs={List.class,OceanLaunchSpecAutoscaleHeadroomsAutomatic.class}, tree="[0,1]") private Output> autoscaleHeadroomsAutomatics; /** * @return Set automatic headroom per launch spec. * */ public Output>> autoscaleHeadroomsAutomatics() { return Codegen.optional(this.autoscaleHeadroomsAutomatics); } @Export(name="createOptions", refs={OceanLaunchSpecCreateOptions.class}, tree="[0]") private Output createOptions; public Output> createOptions() { return Codegen.optional(this.createOptions); } /** * List of supported machine types for the Launch Spec. * */ @Export(name="instanceTypes", refs={List.class,String.class}, tree="[0,1]") private Output> instanceTypes; /** * @return List of supported machine types for the Launch Spec. * */ public Output> instanceTypes() { return this.instanceTypes; } /** * Optionally adds labels to instances launched in an Ocean cluster. * */ @Export(name="labels", refs={List.class,OceanLaunchSpecLabel.class}, tree="[0,1]") private Output> labels; /** * @return Optionally adds labels to instances launched in an Ocean cluster. * */ public Output> labels() { return this.labels; } /** * Cluster's metadata. * */ @Export(name="metadatas", refs={List.class,OceanLaunchSpecMetadata.class}, tree="[0,1]") private Output> metadatas; /** * @return Cluster's metadata. * */ public Output> metadatas() { return this.metadatas; } /** * The launch specification name. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The launch specification name. * */ public Output name() { return this.name; } /** * Settings for network interfaces. * */ @Export(name="networkInterfaces", refs={List.class,OceanLaunchSpecNetworkInterface.class}, tree="[0,1]") private Output> networkInterfaces; /** * @return Settings for network interfaces. * */ public Output>> networkInterfaces() { return Codegen.optional(this.networkInterfaces); } /** * The node pool you wish to use in your Launch Spec. * */ @Export(name="nodePoolName", refs={String.class}, tree="[0]") private Output nodePoolName; /** * @return The node pool you wish to use in your Launch Spec. * */ public Output> nodePoolName() { return Codegen.optional(this.nodePoolName); } /** * The Ocean cluster ID. * */ @Export(name="oceanId", refs={String.class}, tree="[0]") private Output oceanId; /** * @return The Ocean cluster ID. * */ public Output oceanId() { return this.oceanId; } /** * The Ocean virtual node group resource limits object. * */ @Export(name="resourceLimits", refs={OceanLaunchSpecResourceLimits.class}, tree="[0]") private Output resourceLimits; /** * @return The Ocean virtual node group resource limits object. * */ public Output> resourceLimits() { return Codegen.optional(this.resourceLimits); } /** * Boolean. When set to `true`, VNG nodes will be treated as if all pods running have the restrict-scale-down label. Therefore, Ocean will not scale nodes down unless empty. * */ @Export(name="restrictScaleDown", refs={Boolean.class}, tree="[0]") private Output restrictScaleDown; /** * @return Boolean. When set to `true`, VNG nodes will be treated as if all pods running have the restrict-scale-down label. Therefore, Ocean will not scale nodes down unless empty. * */ public Output restrictScaleDown() { return this.restrictScaleDown; } /** * Root volume size (in GB). * */ @Export(name="rootVolumeSize", refs={Integer.class}, tree="[0]") private Output rootVolumeSize; /** * @return Root volume size (in GB). * */ public Output rootVolumeSize() { return this.rootVolumeSize; } /** * Root volume disk type. Valid values: `"pd-standard"`, `"pd-ssd"`. * */ @Export(name="rootVolumeType", refs={String.class}, tree="[0]") private Output rootVolumeType; /** * @return Root volume disk type. Valid values: `"pd-standard"`, `"pd-ssd"`. * */ public Output rootVolumeType() { return this.rootVolumeType; } /** * Used to define scheduled tasks such as a manual headroom update. * */ @Export(name="schedulingTasks", refs={List.class,OceanLaunchSpecSchedulingTask.class}, tree="[0,1]") private Output> schedulingTasks; /** * @return Used to define scheduled tasks such as a manual headroom update. * */ public Output>> schedulingTasks() { return Codegen.optional(this.schedulingTasks); } /** * The account used by applications running on the VM to call GCP APIs. * */ @Export(name="serviceAccount", refs={String.class}, tree="[0]") private Output serviceAccount; /** * @return The account used by applications running on the VM to call GCP APIs. * */ public Output serviceAccount() { return this.serviceAccount; } /** * The Ocean shielded instance configuration object. * */ @Export(name="shieldedInstanceConfig", refs={OceanLaunchSpecShieldedInstanceConfig.class}, tree="[0]") private Output shieldedInstanceConfig; /** * @return The Ocean shielded instance configuration object. * */ public Output shieldedInstanceConfig() { return this.shieldedInstanceConfig; } /** * Image URL. * */ @Export(name="sourceImage", refs={String.class}, tree="[0]") private Output sourceImage; /** * @return Image URL. * */ public Output sourceImage() { return this.sourceImage; } /** * The Ocean virtual node group storage object. * */ @Export(name="storage", refs={OceanLaunchSpecStorage.class}, tree="[0]") private Output storage; /** * @return The Ocean virtual node group storage object. * */ public Output storage() { return this.storage; } /** * The Ocean Launch Spec Strategy object. * */ @Export(name="strategies", refs={List.class,OceanLaunchSpecStrategy.class}, tree="[0,1]") private Output> strategies; /** * @return The Ocean Launch Spec Strategy object. * */ public Output>> strategies() { return Codegen.optional(this.strategies); } /** * Every node launched from this configuration will be tagged with those tags. Note: during creation some tags are automatically imported to the state file, it is required to manually add it to the template configuration * */ @Export(name="tags", refs={List.class,String.class}, tree="[0,1]") private Output> tags; /** * @return Every node launched from this configuration will be tagged with those tags. Note: during creation some tags are automatically imported to the state file, it is required to manually add it to the template configuration * */ public Output> tags() { return this.tags; } /** * Optionally adds labels to instances launched in an Ocean cluster. * */ @Export(name="taints", refs={List.class,OceanLaunchSpecTaint.class}, tree="[0,1]") private Output> taints; /** * @return Optionally adds labels to instances launched in an Ocean cluster. * */ public Output> taints() { return this.taints; } @Export(name="updatePolicy", refs={OceanLaunchSpecUpdatePolicy.class}, tree="[0]") private Output updatePolicy; public Output> updatePolicy() { return Codegen.optional(this.updatePolicy); } /** * * @param name The _unique_ name of the resulting resource. */ public OceanLaunchSpec(java.lang.String name) { this(name, OceanLaunchSpecArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public OceanLaunchSpec(java.lang.String name, OceanLaunchSpecArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public OceanLaunchSpec(java.lang.String name, OceanLaunchSpecArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("spotinst:gke/oceanLaunchSpec:OceanLaunchSpec", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private OceanLaunchSpec(java.lang.String name, Output id, @Nullable OceanLaunchSpecState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("spotinst:gke/oceanLaunchSpec:OceanLaunchSpec", name, state, makeResourceOptions(options, id), false); } private static OceanLaunchSpecArgs makeArgs(OceanLaunchSpecArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? OceanLaunchSpecArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static OceanLaunchSpec get(java.lang.String name, Output id, @Nullable OceanLaunchSpecState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new OceanLaunchSpec(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy