opentofu/builtin/providers/aws
Paul Hinze 112724fc39 provider/aws: spot_instance_request
This is an iteration on the great work done by @dalehamel in PRs #2095
and #2109.

The core team went back and forth on how to best model Spot Instance
Requests, requesting and then rejecting a separate-resource
implementation in #2109.

After more internal discussion, we landed once again on a separate
resource to model Spot Instance Requests. Out of respect for
@dalehamel's already-significant donated time, with this I'm attempting
to pick up the work to take this across the finish line.

Important architectural decisions represented here:

 * Spot Instance Requests are always of type "persistent", to properly
   match Terraform's declarative model.
 * The spot_instance_request resource exports several attributes that
   are expected to be constantly changing as the spot market changes:
   spot_bid_status, spot_request_state, and instance_id. Creating
   additional resource dependencies based on these attributes is not
   recommended, as Terraform diffs will be continually generated to keep
   up with the live changes.
 * When a Spot Instance Request is deleted/canceled, an attempt is made
   to terminate the last-known attached spot instance. Race conditions
   dictate that this attempt cannot guarantee that the associated spot
   instance is terminated immediately.

Implementation notes:

 * This version of aws_spot_instance_request borrows a lot of common
   code from aws_instance.
 * In order to facilitate borrowing, we introduce `awsInstanceOpts`, an
   internal representation of instance details that's meant to be shared
   between resources. The goal here would be to refactor ASG Launch
   Configurations to use the same struct.
 * The new aws_spot_instance_request acc. test is passing.
 * All aws_instance acc. tests remain passing.
2015-06-07 17:33:32 -05:00
..
autoscaling_tags_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
autoscaling_tags.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
config.go provider/aws: Add new resource - aws_ecs_cluster 2015-06-03 22:47:05 +01:00
hosted_zones_test.go providers/aws: Extract normalizeRegion 2015-05-08 10:49:21 -04:00
hosted_zones.go providers/aws: Extract normalizeRegion 2015-05-08 10:49:21 -04:00
network_acl_entry_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
network_acl_entry.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
provider_test.go Read the "standard" AWS environment variables 2015-01-22 16:09:25 -05:00
provider.go provider/aws: spot_instance_request 2015-06-07 17:33:32 -05:00
resource_aws_app_cookie_stickiness_policy_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_app_cookie_stickiness_policy.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_autoscaling_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_autoscaling_group.go provider/aws: clarify scaling timeout error 2015-06-05 17:14:21 -04:00
resource_aws_autoscaling_notification_test.go refactor the internals of this 2015-06-05 10:00:39 -05:00
resource_aws_autoscaling_notification.go refactor the internals of this 2015-06-05 10:00:39 -05:00
resource_aws_customer_gateway_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_customer_gateway.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_instance_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_instance.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_parameter_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_parameter_group.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_security_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_security_group.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_subnet_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_db_subnet_group.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_ebs_volume_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_ebs_volume.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_ecs_cluster_test.go provider/aws: Add new resource - aws_ecs_cluster 2015-06-03 22:47:05 +01:00
resource_aws_ecs_cluster.go provider/aws: Add new resource - aws_ecs_cluster 2015-06-03 22:47:05 +01:00
resource_aws_ecs_service_test.go provider/aws: Add new resource - aws_ecs_service 2015-06-03 22:48:17 +01:00
resource_aws_ecs_service.go provider/aws: Add new resource - aws_ecs_service 2015-06-03 22:48:17 +01:00
resource_aws_ecs_task_definition_test.go provider/aws: Add new resource - aws_ecs_task_definition 2015-06-03 22:47:32 +01:00
resource_aws_ecs_task_definition.go provider/aws: Add new resource - aws_ecs_task_definition 2015-06-03 22:47:32 +01:00
resource_aws_eip_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_eip.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_elasticache_cluster_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_elasticache_cluster.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_elasticache_security_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_elasticache_security_group.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_elasticache_subnet_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_elasticache_subnet_group.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_elb_test.go provider/aws: fix case in ELB listener protocols 2015-06-05 10:20:07 -05:00
resource_aws_elb.go provider/aws: fix case in ELB listener protocols 2015-06-05 10:20:07 -05:00
resource_aws_iam_access_key_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_access_key.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_group_policy_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_group_policy.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_group.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_instance_profile_test.go providers/aws: update test name 2015-05-06 09:18:41 -05:00
resource_aws_iam_instance_profile.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_policy.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_role_policy_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_role_policy.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_role_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_role.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_server_certificate_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_server_certificate.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_user_policy_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_user_policy.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_user_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_iam_user.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_instance_migrate_test.go providers/aws: handle empty instancestate in state migration 2015-03-26 13:07:04 -05:00
resource_aws_instance_migrate.go providers/aws: handle empty instancestate in state migration 2015-03-26 13:07:04 -05:00
resource_aws_instance_test.go provider/aws: Correctly default Instance source_dest_check to true 2015-06-03 15:54:01 -05:00
resource_aws_instance.go provider/aws: spot_instance_request 2015-06-07 17:33:32 -05:00
resource_aws_internet_gateway_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_internet_gateway.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_key_pair_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_key_pair.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_kinesis_stream_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_kinesis_stream.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_launch_configuration_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_launch_configuration.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_lb_cookie_stickiness_policy_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_lb_cookie_stickiness_policy.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_main_route_table_association_test.go mass search-replace of ec2SDKconn 2015-04-16 15:05:55 -05:00
resource_aws_main_route_table_association.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_network_acl_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_network_acl.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_network_interface_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_network_interface.go Fixing bugs with aws_network_interface and added docs. 2015-06-04 11:44:33 -04:00
resource_aws_proxy_protocol_policy_test.go provider/aws: Add acceptance tests for aws_proxy_protocol_policy 2015-04-30 17:56:46 +09:00
resource_aws_proxy_protocol_policy.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route53_record_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route53_record.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route53_zone_association_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route53_zone_association.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route53_zone_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route53_zone.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route_table_association_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route_table_association.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route_table_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_route_table.go provider/aws: fix panic when route has no cidr_block 2015-06-03 13:43:05 -05:00
resource_aws_s3_bucket_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_s3_bucket.go Corrected Frankfurt S3 Website Endpoint fixes #2258 2015-06-07 11:39:18 +02:00
resource_aws_security_group_rule_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_security_group_rule.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_security_group_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_security_group.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_sns_topic_subscription_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_sns_topic_subscription.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_sns_topic_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_sns_topic.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_spot_instance_request_test.go provider/aws: spot_instance_request 2015-06-07 17:33:32 -05:00
resource_aws_spot_instance_request.go provider/aws: spot_instance_request 2015-06-07 17:33:32 -05:00
resource_aws_sqs_queue_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_sqs_queue.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_subnet_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_subnet.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_volume_attachment_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_volume_attachment.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc_dhcp_options_association_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc_dhcp_options_association.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc_dhcp_options_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc_dhcp_options.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc_peering_connection_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc_peering_connection.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpc.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpn_connection_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpn_connection.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpn_gateway_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_aws_vpn_gateway.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_vpn_connection_route_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
resource_vpn_connection_route.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
s3_tags_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
s3_tags.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
structure_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
structure.go provider/aws: Add new resource - aws_ecs_service 2015-06-03 22:48:17 +01:00
tags_route53_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tags_route53.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tags_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tags.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tagsEC_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tagsEC.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tagsELB_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tagsELB.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tagsRDS_test.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
tagsRDS.go provider/aws: handle upstream aws-sdk-go repo move 2015-06-03 13:36:57 -05:00
website_endpoint_url_test.go Corrected Frankfurt S3 Website Endpoint fixes #2258 2015-06-07 11:39:18 +02:00