1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. SpotDatafeedSubscription

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

aws.ec2.SpotDatafeedSubscription

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

    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 System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultBucketV2 = new Aws.S3.BucketV2("defaultBucketV2");
    
        var defaultSpotDatafeedSubscription = new Aws.Ec2.SpotDatafeedSubscription("defaultSpotDatafeedSubscription", new()
        {
            Bucket = defaultBucketV2.Id,
            Prefix = "my_subdirectory",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultBucketV2, err := s3.NewBucketV2(ctx, "defaultBucketV2", nil)
    		if err != nil {
    			return err
    		}
    		_, err = ec2.NewSpotDatafeedSubscription(ctx, "defaultSpotDatafeedSubscription", &ec2.SpotDatafeedSubscriptionArgs{
    			Bucket: defaultBucketV2.ID(),
    			Prefix: pulumi.String("my_subdirectory"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.BucketV2;
    import com.pulumi.aws.ec2.SpotDatafeedSubscription;
    import com.pulumi.aws.ec2.SpotDatafeedSubscriptionArgs;
    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 defaultBucketV2 = new BucketV2("defaultBucketV2");
    
            var defaultSpotDatafeedSubscription = new SpotDatafeedSubscription("defaultSpotDatafeedSubscription", SpotDatafeedSubscriptionArgs.builder()        
                .bucket(defaultBucketV2.id())
                .prefix("my_subdirectory")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    default_bucket_v2 = aws.s3.BucketV2("defaultBucketV2")
    default_spot_datafeed_subscription = aws.ec2.SpotDatafeedSubscription("defaultSpotDatafeedSubscription",
        bucket=default_bucket_v2.id,
        prefix="my_subdirectory")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const defaultBucketV2 = new aws.s3.BucketV2("defaultBucketV2", {});
    const defaultSpotDatafeedSubscription = new aws.ec2.SpotDatafeedSubscription("defaultSpotDatafeedSubscription", {
        bucket: defaultBucketV2.id,
        prefix: "my_subdirectory",
    });
    
    resources:
      defaultBucketV2:
        type: aws:s3:BucketV2
      defaultSpotDatafeedSubscription:
        type: aws:ec2:SpotDatafeedSubscription
        properties:
          bucket: ${defaultBucketV2.id}
          prefix: my_subdirectory
    

    Create 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)
    public SpotDatafeedSubscription(String name, SpotDatafeedSubscriptionArgs args)
    public SpotDatafeedSubscription(String name, SpotDatafeedSubscriptionArgs args, CustomResourceOptions options)
    
    type: aws:ec2:SpotDatafeedSubscription
    properties: # The arguments to resource properties.
    options: # 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.
    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.
    name String
    The unique name of the resource.
    args SpotDatafeedSubscriptionArgs
    The arguments to resource properties.
    options 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 Architecture and Concepts 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 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.

    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.

    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 string

    The provider-assigned unique ID for this managed resource.

    id str

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up 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)
    public static SpotDatafeedSubscription get(String name, Output<String> id, SpotDatafeedSubscriptionState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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 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.

    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.

    Import

    Using pulumi import, import a Spot Datafeed Subscription using the word spot-datafeed-subscription. For example:

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

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi