SpotDatafeedSubscription

Note: There is only a single subscription allowed per account.

To help you understand the charges for your Spot instances, Amazon EC2 provides a data feed that describes your Spot instance usage and pricing. This data feed is sent to an Amazon S3 bucket that you specify when you subscribe to the data feed.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultBucket = new Aws.S3.Bucket("defaultBucket", new Aws.S3.BucketArgs
        {
        });
        var defaultSpotDatafeedSubscription = new Aws.Ec2.SpotDatafeedSubscription("defaultSpotDatafeedSubscription", new Aws.Ec2.SpotDatafeedSubscriptionArgs
        {
            Bucket = defaultBucket.BucketName,
            Prefix = "my_subdirectory",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultBucket, err := s3.NewBucket(ctx, "defaultBucket", nil)
		if err != nil {
			return err
		}
		_, err = ec2.NewSpotDatafeedSubscription(ctx, "defaultSpotDatafeedSubscription", &ec2.SpotDatafeedSubscriptionArgs{
			Bucket: defaultBucket.Bucket,
			Prefix: pulumi.String("my_subdirectory"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

default_bucket = aws.s3.Bucket("defaultBucket")
default_spot_datafeed_subscription = aws.ec2.SpotDatafeedSubscription("defaultSpotDatafeedSubscription",
    bucket=default_bucket.bucket,
    prefix="my_subdirectory")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const defaultBucket = new aws.s3.Bucket("defaultBucket", {});
const defaultSpotDatafeedSubscription = new aws.ec2.SpotDatafeedSubscription("defaultSpotDatafeedSubscription", {
    bucket: defaultBucket.bucket,
    prefix: "my_subdirectory",
});

Create a SpotDatafeedSubscription Resource

new SpotDatafeedSubscription(name: string, args: SpotDatafeedSubscriptionArgs, opts?: CustomResourceOptions);
@overload
def SpotDatafeedSubscription(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             bucket: Optional[str] = None,
                             prefix: Optional[str] = None)
@overload
def SpotDatafeedSubscription(resource_name: str,
                             args: SpotDatafeedSubscriptionArgs,
                             opts: Optional[ResourceOptions] = None)
func NewSpotDatafeedSubscription(ctx *Context, name string, args SpotDatafeedSubscriptionArgs, opts ...ResourceOption) (*SpotDatafeedSubscription, error)
public SpotDatafeedSubscription(string name, SpotDatafeedSubscriptionArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SpotDatafeedSubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SpotDatafeedSubscriptionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SpotDatafeedSubscriptionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SpotDatafeedSubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

SpotDatafeedSubscription Resource Properties

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

Inputs

The SpotDatafeedSubscription resource accepts the following input properties:

Bucket string
The Amazon S3 bucket in which to store the Spot instance data feed.
Prefix string
Path of folder inside bucket to place spot pricing data.
Bucket string
The Amazon S3 bucket in which to store the Spot instance data feed.
Prefix string
Path of folder inside bucket to place spot pricing data.
bucket string
The Amazon S3 bucket in which to store the Spot instance data feed.
prefix string
Path of folder inside bucket to place spot pricing data.
bucket str
The Amazon S3 bucket in which to store the Spot instance data feed.
prefix str
Path of folder inside bucket to place spot pricing data.

Outputs

All input properties are implicitly available as output properties. Additionally, the SpotDatafeedSubscription 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 SpotDatafeedSubscription Resource

Get an existing SpotDatafeedSubscription 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?: SpotDatafeedSubscriptionState, opts?: CustomResourceOptions): SpotDatafeedSubscription
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        prefix: Optional[str] = None) -> SpotDatafeedSubscription
func GetSpotDatafeedSubscription(ctx *Context, name string, id IDInput, state *SpotDatafeedSubscriptionState, opts ...ResourceOption) (*SpotDatafeedSubscription, error)
public static SpotDatafeedSubscription Get(string name, Input<string> id, SpotDatafeedSubscriptionState? 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:

Bucket string
The Amazon S3 bucket in which to store the Spot instance data feed.
Prefix string
Path of folder inside bucket to place spot pricing data.
Bucket string
The Amazon S3 bucket in which to store the Spot instance data feed.
Prefix string
Path of folder inside bucket to place spot pricing data.
bucket string
The Amazon S3 bucket in which to store the Spot instance data feed.
prefix string
Path of folder inside bucket to place spot pricing data.
bucket str
The Amazon S3 bucket in which to store the Spot instance data feed.
prefix str
Path of folder inside bucket to place spot pricing data.

Import

A Spot Datafeed Subscription can be imported using the word spot-datafeed-subscription, e.g.

 $ pulumi import aws:ec2/spotDatafeedSubscription:SpotDatafeedSubscription mysubscription spot-datafeed-subscription

Package Details

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