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,
});
}
}
Coming soon!
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, opts=None, endpoint=None, event_type=None, format=None, protocol=None, resource_id=None, __props__=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".- Event
Type 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- Resource
Id 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".- Event
Type 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- Resource
Id 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".- event
Type 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- resource
Id 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 Dict[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:
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): Subscriptionstatic get(resource_name, id, opts=None, endpoint=None, event_type=None, format=None, protocol=None, resource_id=None, __props__=None);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".- Event
Type 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- Resource
Id 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".- Event
Type 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- Resource
Id 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".- event
Type 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- resource
Id 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 Dict[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
spotinstTerraform Provider.