This page documents the language specification for the spotinst package. If you're looking for help working with the inputs, outputs, or functions of spotinst resources in a Pulumi program, please see the resource documentation for examples and API reference.
gcp¶
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-spotinst repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-spotinst repo.
- class
pulumi_spotinst.gcp.Elastigroup(resource_name, opts=None, auto_healing=None, availability_zones=None, backend_services=None, description=None, desired_capacity=None, disks=None, draining_timeout=None, fallback_to_ondemand=None, gpu=None, health_check_grace_period=None, health_check_type=None, instance_types_customs=None, instance_types_ondemand=None, instance_types_preemptibles=None, integration_docker_swarm=None, integration_gke=None, ip_forwarding=None, labels=None, max_size=None, metadatas=None, min_size=None, name=None, network_interfaces=None, ondemand_count=None, preemptible_percentage=None, scaling_down_policies=None, scaling_up_policies=None, scheduled_tasks=None, service_account=None, shutdown_script=None, startup_script=None, subnets=None, tags=None, unhealthy_duration=None, __props__=None, __name__=None, __opts__=None)¶ Provides a Spotinst elastigroup GCP resource.
import pulumi import pulumi_spotinst as spotinst example = spotinst.gcp.Elastigroup("example", availability_zones=[ "asia-east1-c", "us-central1-a", ], backend_services_config=[{ "ports": [{ "portName": "port-name", "ports": [ 8000, 6000, ], }], "serviceName": "spotinst-elb-backend-service", }], description="spotinst gcp group", desired_capacity=1, disks=[{ "autoDelete": True, "boot": True, "deviceName": "device", "initializeParams": [{ "diskSizeGb": 10, "diskType": "pd-standard", "source_image": "", }], "interface": "SCSI", "mode": "READ_WRITE", "type": "PERSISTENT", }], draining_timeout=180, fallback_to_ondemand=True, instance_types_customs=[{ "memoryGiB": 7.5, "vCPU": 2, }], instance_types_ondemand=["n1-standard-1"], instance_types_preemptibles=[ "n1-standard-1", "n1-standard-2", ], labels=[{ "key": "test_key", "value": "test_value", }], max_size=1, min_size=0, network_interfaces=[{ "network": "spot-network", }], preemptible_percentage=50, scaling=[{ "up": [{ "action": [{ "adjustment": 1, "type": "adjustment", }], "cooldown": 300, "dimensions": [{ "name": "storage_type", "value": "pd-ssd", }], "evaluationPeriods": 1, "metricName": "instance/disk/read_ops_count", "namespace": "compute", "operator": "gte", "period": 300, "policyName": "scale_up_1", "source": "stackdriver", "statistic": "average", "threshold": 10000, "unit": "percent", }], }], service_account="example@myProject.iam.gservicecct.com", startup_script="", subnets=[{ "region": "asia-east1", "subnetNames": "", }], tags=[ "http", "https", ])
gpu- (Optional) Defines the GPU configuration.type- (Required) The type of GPU instance. Valid values:nvidia-tesla-v100,nvidia-tesla-p100,nvidia-tesla-k80.count- (Required) The number of GPUs. Must be 0, 2, 4, 6, 8.
Usage:
import pulumi
backend_services- (Optional) Describes the backend service configurations.service_name- (Required) The name of the backend service.location_type- (Optional) Sets which location the backend services will be active. Valid values:regional,global.scheme- (Optional) Use whenlocation_typeis “regional”. Set the traffic for the backend service to either between the instances in the vpc or to traffic from the internet. Valid values:INTERNAL,EXTERNAL.named_port- (Optional) Describes a named port and a list of ports.port_name- (Required) The name of the port.ports- (Required) A list of ports.
Usage:
import pulumi
disks- (Optional) Array of disks associated with this instance. Persistent disks must be created before you can assign them.auto_delete- (Optional) Specifies whether the disk will be auto-deleted when the instance is deleted.boot- (Optional) Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.device_name- (Optional) Specifies a unique device name of your choice.interface- (Optional, Default:SCSI) Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME.mode- (Optional, Default:READ_WRITE) The mode in which to attach this disk, either READ_WRITE or READ_ONLY.source- (Optional) Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.type- (Optional, Default:PERSISTENT) Specifies the type of disk, either SCRATCH or PERSISTENT.initialize_params- (Optional) Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.disk_size_gb- (Optional) Specifies disk size in gigabytes. Must be in increments of 2.disk_type- (Optional, Default”pd-standard) Specifies the disk type to use to create the instance. Valid values: pd-ssd, local-ssd.source_image- (Optional) A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project.
Usage:
import pulumi
Each of the
network_interfaceattributes controls a portion of the GCP Instance’s “Network Interfaces”. It’s a good idea to familiarize yourself with GCP’s Network Interfaces docs to understand the implications of using these attributes.network_interface- (Required, minimum 1) Array of objects representing the network configuration for the elastigroup.network- (Required) Network resource for this group.access_configs- (Optional) Array of configurations.name- (Optional) Name of this access configuration.type- (Optional) Array of configurations for this interface. Currently, only ONE_TO_ONE_NAT is supported.
import pulumi
scaling_up_policy- (Optional) Contains scaling policies for scaling the Elastigroup up.scaling_down_policy- (Optional) Contains scaling policies for scaling the Elastigroup down.
Each
scaling_*_policysupports the following:policy_name- (Optional) Name of scaling policy.metric_name- (Optional) Metric to monitor. Valid values: “Percentage CPU”, “Network In”, “Network Out”, “Disk Read Bytes”, “Disk Write Bytes”, “Disk Write Operations/Sec”, “Disk Read Operations/Sec”.statistic- (Optional) Statistic by which to evaluate the selected metric. Valid values: “AVERAGE”, “SAMPLE_COUNT”, “SUM”, “MINIMUM”, “MAXIMUM”, “PERCENTILE”, “COUNT”.threshold- (Optional) The value at which the scaling action is triggered.period- (Optional) Amount of time (seconds) for which the threshold must be met in order to trigger the scaling action.evaluation_periods- (Optional) Number of consecutive periods in which the threshold must be met in order to trigger a scaling action.cooldown- (Optional) Time (seconds) to wait after a scaling action before resuming monitoring.operator- (Optional) The operator used to evaluate the threshold against the current metric value. Valid values: “gt” (greater than), “get” (greater-than or equal), “lt” (less than), “lte” (less than or equal).action- (Optional) Scaling action to take when the policy is triggered.type- (Optional) Type of scaling action to take when the scaling policy is triggered. Valid values: “adjustment”, “setMinTarget”, “updateCapacity”, “percentageAdjustment”adjustment- (Optional) Value to which the action type will be adjusted. Required if using “numeric” or “percentageAdjustment” action types.
dimensions- (Optional) A list of dimensions describing qualities of the metric.name- (Required) The dimension name.value- (Required) The dimension value.
Usage:
import pulumi
integration_docker_swarm- (Optional) Describes the Docker Swarm integration.master_host- (Required) IP or FQDN of one of your swarm managers.master_port- (Required) Network port used by your swarm.
Usage:
import pulumi
Each
scheduled_tasksupports the following:task_type- (Required) The task type to run. Valid values:"setCapacity".cron_expression- (Optional) A valid cron expression. The cron is running in UTC time zone and is in Unix cron format.is_enabled- (Optional, Default:true) Setting the task to being enabled or disabled.target_capacity- (Optional) The desired number of instances the group should have.min_capacity- (Optional) The minimum number of instances the group should have.max_capacity- (Optional) The maximum number of instances the group should have.
Usage:
import pulumi
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
availability_zones (pulumi.Input[list]) – List of availability zones for the group.
description (pulumi.Input[str]) – The region your GCP group will be created in.
desired_capacity (pulumi.Input[float]) – The desired number of instances the group should have at any time.
draining_timeout (pulumi.Input[float]) – Time (seconds) the instance is allowed to run after it is detached from the group. This is to allow the instance time to drain all the current TCP connections before terminating it.
fallback_to_ondemand (pulumi.Input[bool]) – Activate fallback-to-on-demand. When provisioning an instance, if no Preemptible market is available, fallback-to-on-demand will provision an On-Demand instance to maintain the group capacity.
instance_types_customs (pulumi.Input[list]) – Defines a set of custom instance types. Required if instance_types_preemptible and instance_types_ondemand are not set.
instance_types_ondemand (pulumi.Input[str]) – The regular VM instance type to use for mixed-type groups and when falling back to on-demand. Required if instance_types_preemptible is not set.
instance_types_preemptibles (pulumi.Input[list]) – The preemptible VMs instance type. To maximize cost savings and market availability, select as many types as possible. Required if instance_types_ondemand is not set.
labels (pulumi.Input[list]) – Array of objects with key-value pairs.
max_size (pulumi.Input[float]) – The maximum number of instances the group should have at any time.
metadatas (pulumi.Input[list]) – Array of objects with key-value pairs.
min_size (pulumi.Input[float]) – The minimum number of instances the group should have at any time.
name (pulumi.Input[str]) – The group name.
preemptible_percentage (pulumi.Input[float]) – Percentage of Preemptible VMs to spin up from the “desired_capacity”.
service_account (pulumi.Input[str]) – The email of the service account in which the group instances will be launched.
shutdown_script (pulumi.Input[str]) – The Base64-encoded shutdown script that executes prior to instance termination, for more information please see: Shutdown Script
startup_script (pulumi.Input[str]) – Create and run your own startup scripts on your virtual machines to perform automated tasks every time your instance boots up.
subnets (pulumi.Input[list]) – A list of regions and subnets.
tags (pulumi.Input[list]) – Tags to mark created instances.
The backend_services object supports the following:
locationType(pulumi.Input[str])namedPorts(pulumi.Input[list])name(pulumi.Input[str]) - The group name.ports(pulumi.Input[list])
scheme(pulumi.Input[str])serviceName(pulumi.Input[str])
The disks object supports the following:
autoDelete(pulumi.Input[bool])boot(pulumi.Input[bool])deviceName(pulumi.Input[str])initializeParams(pulumi.Input[list])diskSizeGb(pulumi.Input[str])diskType(pulumi.Input[str])source_image(pulumi.Input[str])
interface(pulumi.Input[str])mode(pulumi.Input[str])source(pulumi.Input[str])type(pulumi.Input[str])
The gpu object supports the following:
count(pulumi.Input[float])type(pulumi.Input[str])
The instance_types_customs object supports the following:
memoryGib(pulumi.Input[float]) - The memory (in GiB) in the custom instance types. GCP has a number of limitations on accepted memory values.For more information, see the GCP documentation (here.)[https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#specifications]vcpu(pulumi.Input[float])
The integration_docker_swarm object supports the following:
masterHost(pulumi.Input[str])masterPort(pulumi.Input[float])
The integration_gke object supports the following:
autoUpdate(pulumi.Input[bool])autoscaleCooldown(pulumi.Input[float])autoscaleDown(pulumi.Input[dict])evaluationPeriods(pulumi.Input[float])
autoscaleHeadroom(pulumi.Input[dict])cpuPerUnit(pulumi.Input[float])memoryPerUnit(pulumi.Input[float])numOfUnits(pulumi.Input[float])
autoscaleIsAutoConfig(pulumi.Input[bool])autoscaleIsEnabled(pulumi.Input[bool])autoscaleLabels(pulumi.Input[list])key(pulumi.Input[str]) - Labels key.value(pulumi.Input[str]) - Labels value.
cluster_id(pulumi.Input[str])location(pulumi.Input[str])
The labels object supports the following:
key(pulumi.Input[str]) - Labels key.value(pulumi.Input[str]) - Labels value.
The metadatas object supports the following:
key(pulumi.Input[str]) - Labels key.value(pulumi.Input[str]) - Labels value.
The network_interfaces object supports the following:
accessConfigs(pulumi.Input[list])name(pulumi.Input[str]) - The group name.type(pulumi.Input[str])
aliasIpRanges(pulumi.Input[list])ipCidrRange(pulumi.Input[str])subnetworkRangeName(pulumi.Input[str])
network(pulumi.Input[str])
The scaling_down_policies object supports the following:
actionType(pulumi.Input[str])adjustment(pulumi.Input[float])cooldown(pulumi.Input[float])dimensions(pulumi.Input[list])name(pulumi.Input[str]) - The group name.value(pulumi.Input[str]) - Labels value.
evaluationPeriods(pulumi.Input[float])metricName(pulumi.Input[str])namespace(pulumi.Input[str])operator(pulumi.Input[str])period(pulumi.Input[float])policyName(pulumi.Input[str])source(pulumi.Input[str])statistic(pulumi.Input[str])threshold(pulumi.Input[float])unit(pulumi.Input[str])
The scaling_up_policies object supports the following:
actionType(pulumi.Input[str])adjustment(pulumi.Input[float])cooldown(pulumi.Input[float])dimensions(pulumi.Input[list])name(pulumi.Input[str]) - The group name.value(pulumi.Input[str]) - Labels value.
evaluationPeriods(pulumi.Input[float])metricName(pulumi.Input[str])namespace(pulumi.Input[str])operator(pulumi.Input[str])period(pulumi.Input[float])policyName(pulumi.Input[str])source(pulumi.Input[str])statistic(pulumi.Input[str])threshold(pulumi.Input[float])unit(pulumi.Input[str])
The scheduled_tasks object supports the following:
cronExpression(pulumi.Input[str])isEnabled(pulumi.Input[bool])maxCapacity(pulumi.Input[str])minCapacity(pulumi.Input[str])targetCapacity(pulumi.Input[str])taskType(pulumi.Input[str])
The subnets object supports the following:
region(pulumi.Input[str]) - The region for the group of subnets.subnetNames(pulumi.Input[list]) - The names of the subnets in the region.
availability_zones: pulumi.Output[list] = None¶List of availability zones for the group.
description: pulumi.Output[str] = None¶The region your GCP group will be created in.
desired_capacity: pulumi.Output[float] = None¶The desired number of instances the group should have at any time.
draining_timeout: pulumi.Output[float] = None¶Time (seconds) the instance is allowed to run after it is detached from the group. This is to allow the instance time to drain all the current TCP connections before terminating it.
fallback_to_ondemand: pulumi.Output[bool] = None¶Activate fallback-to-on-demand. When provisioning an instance, if no Preemptible market is available, fallback-to-on-demand will provision an On-Demand instance to maintain the group capacity.
instance_types_customs: pulumi.Output[list] = None¶Defines a set of custom instance types. Required if instance_types_preemptible and instance_types_ondemand are not set.
memoryGib(float) - The memory (in GiB) in the custom instance types. GCP has a number of limitations on accepted memory values.For more information, see the GCP documentation (here.)[https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#specifications]vcpu(float)
instance_types_ondemand: pulumi.Output[str] = None¶The regular VM instance type to use for mixed-type groups and when falling back to on-demand. Required if instance_types_preemptible is not set.
instance_types_preemptibles: pulumi.Output[list] = None¶The preemptible VMs instance type. To maximize cost savings and market availability, select as many types as possible. Required if instance_types_ondemand is not set.
labels: pulumi.Output[list] = None¶Array of objects with key-value pairs.
key(str) - Labels key.value(str) - Labels value.
max_size: pulumi.Output[float] = None¶The maximum number of instances the group should have at any time.
metadatas: pulumi.Output[list] = None¶Array of objects with key-value pairs.
key(str) - Labels key.value(str) - Labels value.
min_size: pulumi.Output[float] = None¶The minimum number of instances the group should have at any time.
name: pulumi.Output[str] = None¶The group name.
preemptible_percentage: pulumi.Output[float] = None¶Percentage of Preemptible VMs to spin up from the “desired_capacity”.
service_account: pulumi.Output[str] = None¶The email of the service account in which the group instances will be launched.
shutdown_script: pulumi.Output[str] = None¶The Base64-encoded shutdown script that executes prior to instance termination, for more information please see: Shutdown Script
startup_script: pulumi.Output[str] = None¶Create and run your own startup scripts on your virtual machines to perform automated tasks every time your instance boots up.
subnets: pulumi.Output[list] = None¶A list of regions and subnets.
region(str) - The region for the group of subnets.subnetNames(list) - The names of the subnets in the region.
Tags to mark created instances.
- static
get(resource_name, id, opts=None, auto_healing=None, availability_zones=None, backend_services=None, description=None, desired_capacity=None, disks=None, draining_timeout=None, fallback_to_ondemand=None, gpu=None, health_check_grace_period=None, health_check_type=None, instance_types_customs=None, instance_types_ondemand=None, instance_types_preemptibles=None, integration_docker_swarm=None, integration_gke=None, ip_forwarding=None, labels=None, max_size=None, metadatas=None, min_size=None, name=None, network_interfaces=None, ondemand_count=None, preemptible_percentage=None, scaling_down_policies=None, scaling_up_policies=None, scheduled_tasks=None, service_account=None, shutdown_script=None, startup_script=None, subnets=None, tags=None, unhealthy_duration=None)¶ Get an existing Elastigroup resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
availability_zones (pulumi.Input[list]) – List of availability zones for the group.
description (pulumi.Input[str]) – The region your GCP group will be created in.
desired_capacity (pulumi.Input[float]) – The desired number of instances the group should have at any time.
draining_timeout (pulumi.Input[float]) – Time (seconds) the instance is allowed to run after it is detached from the group. This is to allow the instance time to drain all the current TCP connections before terminating it.
fallback_to_ondemand (pulumi.Input[bool]) – Activate fallback-to-on-demand. When provisioning an instance, if no Preemptible market is available, fallback-to-on-demand will provision an On-Demand instance to maintain the group capacity.
instance_types_customs (pulumi.Input[list]) – Defines a set of custom instance types. Required if instance_types_preemptible and instance_types_ondemand are not set.
instance_types_ondemand (pulumi.Input[str]) – The regular VM instance type to use for mixed-type groups and when falling back to on-demand. Required if instance_types_preemptible is not set.
instance_types_preemptibles (pulumi.Input[list]) – The preemptible VMs instance type. To maximize cost savings and market availability, select as many types as possible. Required if instance_types_ondemand is not set.
labels (pulumi.Input[list]) – Array of objects with key-value pairs.
max_size (pulumi.Input[float]) – The maximum number of instances the group should have at any time.
metadatas (pulumi.Input[list]) – Array of objects with key-value pairs.
min_size (pulumi.Input[float]) – The minimum number of instances the group should have at any time.
name (pulumi.Input[str]) – The group name.
preemptible_percentage (pulumi.Input[float]) – Percentage of Preemptible VMs to spin up from the “desired_capacity”.
service_account (pulumi.Input[str]) – The email of the service account in which the group instances will be launched.
shutdown_script (pulumi.Input[str]) –
The Base64-encoded shutdown script that executes prior to instance termination, for more information please see: Shutdown Script
startup_script (pulumi.Input[str]) – Create and run your own startup scripts on your virtual machines to perform automated tasks every time your instance boots up.
subnets (pulumi.Input[list]) – A list of regions and subnets.
tags (pulumi.Input[list]) – Tags to mark created instances.
The backend_services object supports the following:
locationType(pulumi.Input[str])namedPorts(pulumi.Input[list])name(pulumi.Input[str]) - The group name.ports(pulumi.Input[list])
scheme(pulumi.Input[str])serviceName(pulumi.Input[str])
The disks object supports the following:
autoDelete(pulumi.Input[bool])boot(pulumi.Input[bool])deviceName(pulumi.Input[str])initializeParams(pulumi.Input[list])diskSizeGb(pulumi.Input[str])diskType(pulumi.Input[str])source_image(pulumi.Input[str])
interface(pulumi.Input[str])mode(pulumi.Input[str])source(pulumi.Input[str])type(pulumi.Input[str])
The gpu object supports the following:
count(pulumi.Input[float])type(pulumi.Input[str])
The instance_types_customs object supports the following:
memoryGib(pulumi.Input[float]) - The memory (in GiB) in the custom instance types. GCP has a number of limitations on accepted memory values.For more information, see the GCP documentation (here.)[https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#specifications]vcpu(pulumi.Input[float])
The integration_docker_swarm object supports the following:
masterHost(pulumi.Input[str])masterPort(pulumi.Input[float])
The integration_gke object supports the following:
autoUpdate(pulumi.Input[bool])autoscaleCooldown(pulumi.Input[float])autoscaleDown(pulumi.Input[dict])evaluationPeriods(pulumi.Input[float])
autoscaleHeadroom(pulumi.Input[dict])cpuPerUnit(pulumi.Input[float])memoryPerUnit(pulumi.Input[float])numOfUnits(pulumi.Input[float])
autoscaleIsAutoConfig(pulumi.Input[bool])autoscaleIsEnabled(pulumi.Input[bool])autoscaleLabels(pulumi.Input[list])key(pulumi.Input[str]) - Labels key.value(pulumi.Input[str]) - Labels value.
cluster_id(pulumi.Input[str])location(pulumi.Input[str])
The labels object supports the following:
key(pulumi.Input[str]) - Labels key.value(pulumi.Input[str]) - Labels value.
The metadatas object supports the following:
key(pulumi.Input[str]) - Labels key.value(pulumi.Input[str]) - Labels value.
The network_interfaces object supports the following:
accessConfigs(pulumi.Input[list])name(pulumi.Input[str]) - The group name.type(pulumi.Input[str])
aliasIpRanges(pulumi.Input[list])ipCidrRange(pulumi.Input[str])subnetworkRangeName(pulumi.Input[str])
network(pulumi.Input[str])
The scaling_down_policies object supports the following:
actionType(pulumi.Input[str])adjustment(pulumi.Input[float])cooldown(pulumi.Input[float])dimensions(pulumi.Input[list])name(pulumi.Input[str]) - The group name.value(pulumi.Input[str]) - Labels value.
evaluationPeriods(pulumi.Input[float])metricName(pulumi.Input[str])namespace(pulumi.Input[str])operator(pulumi.Input[str])period(pulumi.Input[float])policyName(pulumi.Input[str])source(pulumi.Input[str])statistic(pulumi.Input[str])threshold(pulumi.Input[float])unit(pulumi.Input[str])
The scaling_up_policies object supports the following:
actionType(pulumi.Input[str])adjustment(pulumi.Input[float])cooldown(pulumi.Input[float])dimensions(pulumi.Input[list])name(pulumi.Input[str]) - The group name.value(pulumi.Input[str]) - Labels value.
evaluationPeriods(pulumi.Input[float])metricName(pulumi.Input[str])namespace(pulumi.Input[str])operator(pulumi.Input[str])period(pulumi.Input[float])policyName(pulumi.Input[str])source(pulumi.Input[str])statistic(pulumi.Input[str])threshold(pulumi.Input[float])unit(pulumi.Input[str])
The scheduled_tasks object supports the following:
cronExpression(pulumi.Input[str])isEnabled(pulumi.Input[bool])maxCapacity(pulumi.Input[str])minCapacity(pulumi.Input[str])targetCapacity(pulumi.Input[str])taskType(pulumi.Input[str])
The subnets object supports the following:
region(pulumi.Input[str]) - The region for the group of subnets.subnetNames(pulumi.Input[list]) - The names of the subnets in the region.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str