Skip to content

Commit

Permalink
feat: Add aws_ecs_cluster_capacity_providers resource (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
stewartcampbell authored Mar 18, 2022
1 parent 6fb4b63 commit bff70b3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ module "ecs" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.48 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.74 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.48 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74 |

## Modules

Expand All @@ -75,6 +75,7 @@ No modules.
| Name | Type |
|------|------|
| [aws_ecs_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_cluster) | resource |
| [aws_ecs_cluster_capacity_providers.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_cluster_capacity_providers) | resource |

## Inputs

Expand Down
4 changes: 2 additions & 2 deletions examples/complete-ecs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ Current version creates an high-available VPC with instances that are attached t
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.48 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.74 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.48 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/complete-ecs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.48"
version = ">= 3.74"
}
}
}
20 changes: 13 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ resource "aws_ecs_cluster" "this" {

name = var.name

setting {
name = "containerInsights"
value = var.container_insights ? "enabled" : "disabled"
}

tags = var.tags
}

resource "aws_ecs_cluster_capacity_providers" "this" {
count = var.create_ecs ? 1 : 0

cluster_name = aws_ecs_cluster.this[0].name

capacity_providers = var.capacity_providers

dynamic "default_capacity_provider_strategy" {
Expand All @@ -15,11 +28,4 @@ resource "aws_ecs_cluster" "this" {
base = lookup(strategy.value, "base", null)
}
}

setting {
name = "containerInsights"
value = var.container_insights ? "enabled" : "disabled"
}

tags = var.tags
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.48"
version = ">= 3.74"
}
}
}

0 comments on commit bff70b3

Please sign in to comment.