- Have an ECS cluster created and integrated with Ocean on Spot.io
- Spot Account and API Token
### 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
}
Name | Version |
---|---|
spotinst | >= 1.78.0 |
ocean-aws-ecs
- Creates Ocean Cluster Dococean-aws-ecs-vng
- (Optional) Add custom virtual node groups
If you're new to Spot and want to get started, please checkout our Getting Started guide, available on the Spot Documentation website.
We use GitHub issues for tracking bugs and feature requests. Please use these community resources for getting help:
- Ask a question on Stack Overflow and tag it with terraform-spotinst.
- Join our Spot community on Slack.
- Open an issue.
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({ |
null |
no |
Please see the contribution guidelines.
Code is licensed under the Apache License 2.0.