Skip to content

Terraform module for Spotinst provider resource spotinst_ocean_ecs_launch_spec

License

Notifications You must be signed in to change notification settings

spotinst/terraform-spotinst-ocean-aws-ecs-vng

Repository files navigation

Spot Ocean ECS Launchspec Terraform Module

Prerequisites

  • Have an ECS cluster created and integrated with Ocean on Spot.io
  • Spot Account and API Token

Usage

### Create Ocean ECS Cluster ###
module "ocean_ecs" {
  source = "spotinst/ocean-aws-ecs/spotinst"

  cluster_name                    = "ECS-Workshop"
  desired_capacity                = 0
  region                          = "us-west-2"
  subnet_ids                      = ["subnet-123456789, subnet-123456789, subnet-123456789, subnet-123456789"]
  security_group_ids              = ["sg-123456789"]
  iam_instance_profile            = "arn:aws:iam::123456789:instance-profile/ecsInstanceRole"
  
  tags                            = {CreatedBy = "terraform"}
}

### Create Ocean ECS Launchspec ###
module "ocean_ecs_launchspec" {
  source = "spotinst/ocean-aws-ecs-vng/spotinst"

  name                            = "VNG1"
  ocean_id                        = module.ocean_ecs.ocean_id
  attributes                      = {Test = "example"}
  images                          = [{image_id="ami-123456"},{image_id="ami-67890"}]
  tags                            = {CreatedBy = "terraform"}
}

### Outputs ###
output "ocean_id" {
  value = module.ocean_ecs.ocean_id
}
output "ocean_launchspec_id" {
  value = module.ocean_ecs_launchspec.launchspec_id
}

Providers

Name Version
spotinst >= 1.78.0

Modules

  • ocean-aws-ecs - Creates Ocean Cluster Doc
  • ocean-aws-ecs-vng - (Optional) Add custom virtual node groups

Documentation

If you're new to Spot and want to get started, please checkout our Getting Started guide, available on the Spot Documentation website.

Getting Help

We use GitHub issues for tracking bugs and feature requests. Please use these community resources for getting help:

Community

Inputs

Name Description Type Default Required
ocean_id The Ocean cluster identifier. Required for Launch Spec creation. string null yes
name User given name of the virtual node group.. string null no
images You can configure VNG with either the imageId or images objects, but not both simultaneously.
For each architecture type (amd64, arm64) only one AMI is allowed.
Valid values: null, or an array with at least one element.
list(object({
image_id = string
}))
null no

Contributing

Please see the contribution guidelines.

License

Code is licensed under the Apache License 2.0.

About

Terraform module for Spotinst provider resource spotinst_ocean_ecs_launch_spec

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published