Skip to content

Resource: awsSpotDatafeedSubscription

-> 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

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsS3BucketDefault = new aws.s3Bucket.S3Bucket(this, "default", {
  bucket: "tf-spot-datafeed",
});
const awsSpotDatafeedSubscriptionDefault =
  new aws.spotDatafeedSubscription.SpotDatafeedSubscription(this, "default_1", {
    bucket: awsS3BucketDefault.id,
    prefix: "my_subdirectory",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsSpotDatafeedSubscriptionDefault.overrideLogicalId("default");

Argument Reference

  • bucket - (Required) The Amazon S3 bucket in which to store the Spot instance data feed.
  • prefix - (Optional) Path of folder inside bucket to place spot pricing data.

Attributes Reference

No additional attributes are exported.

Import

A Spot Datafeed Subscription can be imported using the word spotDatafeedSubscription, e.g.,

$ terraform import aws_spot_datafeed_subscription.mysubscription spot-datafeed-subscription