image_id: ami-6cd6f714 # Amazon Linux 2 AMI (HVM), SSD Volume Type instance_type: t3.small <% if @options -%> key_name: <%= @options %> <% else -%> # key_name: default # make sure that the “default” keypair exist in the region <% end -%> max_count: 1 min_count: 1 user_data: “<%%= user_data(”bootstrap“) %>” <% if @options -%> iam_instance_profile:
name: <%= @options[:iam] %>
<% else -%> # iam_instance_profile: # name: ExampleIamProfile <% end -%> # public network settings security_group_ids: <%%= @security_group_ids %> subnet_id: <%%= @subnets.shuffle.first %> # block_device_mappings: # - device_name: /dev/xvda # ebs: # volume_size: 100 # in GB <%% if ENV %> instance_market_options:
market_type: spot # https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateSpotMarketOptionsRequest.html # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/EC2/Types/SpotMarketOptions.html spot_options: max_price: "0.018" # $0.020/hr = $14.40/mo # $0.018/hr = $12.96/mo # valid combinations: # spot_instance_type: persistent # instance_interruption_behavior: hibernate # or # spot_instance_type: one-time # More info: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html spot_instance_type: one-time
<%% end %>