Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Subscription

Provides a Spotinst subscription resource.

Example Usage

using Pulumi;
using SpotInst = Pulumi.SpotInst;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a Subscription
        var default_subscription = new SpotInst.Subscription("default-subscription", new SpotInst.SubscriptionArgs
        {
            Endpoint = "http://endpoint.com",
            EventType = "AWS_EC2_INSTANCE_LAUNCH",
            Format = 
            {
                { "event", "%event%" },
                { "instance_id", "%instance-id%" },
                { "resource_id", "%resource-id%" },
                { "resource_name", "%resource-name%" },
                { "tags", "foo,baz,baz" },
            },
            Protocol = "http",
            ResourceId = spotinst_elastigroup_aws.My_eg.Id,
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-spotinst/sdk/v2/go/spotinst"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := spotinst.NewSubscription(ctx, "default_subscription", &spotinst.SubscriptionArgs{
            Endpoint:  pulumi.String("http://endpoint.com"),
            EventType: pulumi.String("AWS_EC2_INSTANCE_LAUNCH"),
            Format: pulumi.StringMap{
                "event":         pulumi.String(fmt.Sprintf("%v%v%v", "%", "event", "%")),
                "instance_id":   pulumi.String(fmt.Sprintf("%v%v%v", "%", "instance-id", "%")),
                "resource_id":   pulumi.String(fmt.Sprintf("%v%v%v", "%", "resource-id", "%")),
                "resource_name": pulumi.String(fmt.Sprintf("%v%v%v", "%", "resource-name", "%")),
                "tags":          pulumi.String("foo,baz,baz"),
            },
            Protocol:   pulumi.String("http"),
            ResourceId: pulumi.Any(spotinst_elastigroup_aws.My - eg.Id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_spotinst as spotinst

# Create a Subscription
default_subscription = spotinst.Subscription("default-subscription",
    endpoint="http://endpoint.com",
    event_type="AWS_EC2_INSTANCE_LAUNCH",
    format={
        "event": "%event%",
        "instance_id": "%instance-id%",
        "resource_id": "%resource-id%",
        "resource_name": "%resource-name%",
        "tags": "foo,baz,baz",
    },
    protocol="http",
    resource_id=spotinst_elastigroup_aws["my-eg"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as spotinst from "@pulumi/spotinst";

// Create a Subscription
const default_subscription = new spotinst.Subscription("default-subscription", {
    endpoint: "http://endpoint.com",
    eventType: "AWS_EC2_INSTANCE_LAUNCH",
    format: {
        event: "%event%",
        instance_id: "%instance-id%",
        resource_id: "%resource-id%",
        resource_name: "%resource-name%",
        tags: "foo,baz,baz",
    },
    protocol: "http",
    resourceId: spotinst_elastigroup_aws_my_eg.id,
});

Create a Subscription Resource

new Subscription(name: string, args: SubscriptionArgs, opts?: CustomResourceOptions);
def Subscription(resource_name: str, opts: Optional[ResourceOptions] = None, endpoint: Optional[str] = None, event_type: Optional[str] = None, format: Optional[Mapping[str, Any]] = None, protocol: Optional[str] = None, resource_id: Optional[str] = None)
func NewSubscription(ctx *Context, name string, args SubscriptionArgs, opts ...ResourceOption) (*Subscription, error)
public Subscription(string name, SubscriptionArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Subscription Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Subscription resource accepts the following input properties:

Endpoint string

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

EventType string

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

Protocol string

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

ResourceId string

Spotinst Resource id (Elastigroup or Ocean ID).

Format Dictionary<string, object>

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

Endpoint string

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

EventType string

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

Protocol string

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

ResourceId string

Spotinst Resource id (Elastigroup or Ocean ID).

Format map[string]interface{}

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

endpoint string

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

eventType string

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

protocol string

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

resourceId string

Spotinst Resource id (Elastigroup or Ocean ID).

format {[key: string]: any}

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

endpoint str

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

event_type str

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

protocol str

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

resource_id str

Spotinst Resource id (Elastigroup or Ocean ID).

format Mapping[str, Any]

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

Outputs

All input properties are implicitly available as output properties. Additionally, the Subscription resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Subscription Resource

Get an existing Subscription resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SubscriptionState, opts?: CustomResourceOptions): Subscription
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, endpoint: Optional[str] = None, event_type: Optional[str] = None, format: Optional[Mapping[str, Any]] = None, protocol: Optional[str] = None, resource_id: Optional[str] = None) -> Subscription
func GetSubscription(ctx *Context, name string, id IDInput, state *SubscriptionState, opts ...ResourceOption) (*Subscription, error)
public static Subscription Get(string name, Input<string> id, SubscriptionState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Endpoint string

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

EventType string

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

Format Dictionary<string, object>

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

Protocol string

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

ResourceId string

Spotinst Resource id (Elastigroup or Ocean ID).

Endpoint string

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

EventType string

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

Format map[string]interface{}

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

Protocol string

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

ResourceId string

Spotinst Resource id (Elastigroup or Ocean ID).

endpoint string

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

eventType string

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

format {[key: string]: any}

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

protocol string

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

resourceId string

Spotinst Resource id (Elastigroup or Ocean ID).

endpoint str

The endpoint the notification will be sent to. url in case of "http"/"https"/"web", email address in case of "email"/"email-json" and sns-topic-arn in case of "aws-sns".

event_type str

The event to send the notification when triggered. Valid values: "AWS_EC2_INSTANCE_TERMINATE", "AWS_EC2_INSTANCE_TERMINATED", "AWS_EC2_INSTANCE_LAUNCH", "AWS_EC2_INSTANCE_READY_SIGNAL_TIMEOUT", "AWS_EC2_CANT_SPIN_OD", "AWS_EC2_INSTANCE_UNHEALTHY_IN_ELB", "GROUP_ROLL_FAILED", "GROUP_ROLL_FINISHED", "CANT_SCALE_UP_GROUP_MAX_CAPACITY", "GROUP_UPDATED", "AWS_EMR_PROVISION_TIMEOUT", "GROUP_BEANSTALK_INIT_READY", "AZURE_VM_TERMINATED", "AZURE_VM_TERMINATE", "AWS_EC2_MANAGED_INSTANCE_PAUSING", "AWS_EC2_MANAGED_INSTANCE_RESUMING", "AWS_EC2_MANAGED_INSTANCE_RECYCLING","AWS_EC2_MANAGED_INSTANCE_DELETING". Ocean Events:"CLUSTER_ROLL_FINISHED","GROUP_ROLL_FAILED".

format Mapping[str, Any]

The format of the notification content (JSON Format - Key+Value). Valid Values : "instance-id", "event", "resource-id", "resource-name", "subnet-id", "availability-zone", "reason", "private-ip", "launchspec-id" Example: {“event”: "event", "resourceId": "resource-id", "resourceName": "resource-name"”, "myCustomKey": "My content is set here" } Default: {"event": "<event>", "instanceId": "<instance-id>", "resourceId": "<resource-id>", "resourceName": "<resource-name>" }.

protocol str

The protocol to send the notification. Valid values: "email", "email-json", "aws-sns", "web". The following values are deprecated: "http" , "https" You can use the generic "web" protocol instead. "aws-sns" is only supported with AWS provider

resource_id str

Spotinst Resource id (Elastigroup or Ocean ID).

Package Details

Repository
https://github.com/pulumi/pulumi-spotinst
License
Apache-2.0
Notes
This Pulumi package is based on the spotinst Terraform Provider.