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/v2/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v2/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("default", {});
const defaultSpotDatafeedSubscription = new aws.ec2.SpotDatafeedSubscription("default", {
bucket: defaultBucket.bucket,
prefix: "my_subdirectory",
});Create a SpotDatafeedSubscription Resource
new SpotDatafeedSubscription(name: string, args: SpotDatafeedSubscriptionArgs, opts?: CustomResourceOptions);def SpotDatafeedSubscription(resource_name, opts=None, bucket=None, prefix=None, __props__=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.
- 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 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:
Outputs
All input properties are implicitly available as output properties. Additionally, the SpotDatafeedSubscription resource produces the following output properties:
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): SpotDatafeedSubscriptionstatic get(resource_name, id, opts=None, bucket=None, prefix=None, __props__=None);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:
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.