Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require TF >=1.3, make variables optional if we already accepted null #37

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Terraform Setup
uses: hashicorp/setup-terraform@v1
with:
terraform_version: '1.1.x'
terraform_version: '1.3.x'

- name: Terraform Format
working-directory: "./"
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: [ '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.x', '1.1.x' ]
terraform: [ '1.3.x' ]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down
110 changes: 55 additions & 55 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/ci/ci.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.12"
required_version = ">= 1.3"

required_providers {
aws = {
Expand Down
23 changes: 13 additions & 10 deletions examples/logging/logging.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
terraform {
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}

provider "aws" {
version = "~> 3.0"
region = "us-west-2"
region = "us-west-2"
}

module "acs" {
Expand All @@ -14,7 +24,7 @@ data "aws_elb_service_account" "main" {}
// name = "fake-example-cluster"
//}
module "fargate_api" {
source = "github.com/byu-oit/terraform-aws-fargate-api?ref=v4.0.1"
source = "github.com/byu-oit/terraform-aws-fargate-api?ref=v5.0.0"
// source = "../../" // for local testing
app_name = "example-api"
// ecs_cluster_name = aws_ecs_cluster.existing.name
Expand All @@ -29,18 +39,11 @@ module "fargate_api" {
secrets = {
foo = "/super-secret"
}
efs_volume_mounts = null
ulimits = null
}

autoscaling_config = null
codedeploy_test_listener_port = 8443
codedeploy_lifecycle_hooks = {
BeforeInstall = null
AfterInstall = null
AfterAllowTestTraffic = "testLifecycle"
BeforeAllowTraffic = null
AfterAllowTraffic = null
}

hosted_zone = module.acs.route53_zone
Expand Down
25 changes: 14 additions & 11 deletions examples/simple/simple.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
terraform {
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}

provider "aws" {
version = "~> 3.0"
region = "us-west-2"
region = "us-west-2"
}

module "acs" {
Expand All @@ -11,8 +21,8 @@ module "acs" {
// name = "fake-example-cluster"
//}
module "fargate_api" {
source = "github.com/byu-oit/terraform-aws-fargate-api?ref=v4.0.1"
// source = "../../" // for local testing
source = "github.com/byu-oit/terraform-aws-fargate-api?ref=v5.0.0"
// source = "../../" // for local testing
app_name = "example-api"
// ecs_cluster_name = aws_ecs_cluster.existing.name
container_port = 8000
Expand All @@ -26,18 +36,11 @@ module "fargate_api" {
secrets = {
foo = "/super-secret"
}
efs_volume_mounts = null
ulimits = null
}

autoscaling_config = null
codedeploy_test_listener_port = 8443
codedeploy_lifecycle_hooks = {
BeforeInstall = null
AfterInstall = null
AfterAllowTestTraffic = "testLifecycle"
BeforeAllowTraffic = null
AfterAllowTraffic = null
}

hosted_zone = module.acs.route53_zone
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.12.21"
required_version = ">= 1.3.0"
required_providers {
aws = ">= 3.0.0"
}
Expand Down
35 changes: 18 additions & 17 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ variable "primary_container_definition" {
name = string
image = string
ports = list(number)
environment_variables = map(string)
secrets = map(string)
efs_volume_mounts = list(object({
environment_variables = optional(map(string))
secrets = optional(map(string))
efs_volume_mounts = optional(list(object({
name = string
file_system_id = string
root_directory = string
container_path = string
}))
ulimits = list(object({
})))
ulimits = optional(list(object({
name = string
soft_limit = number
hard_limit = number
}))
})))
})
description = "The primary container definition for your application. This one will be the only container that receives traffic from the ALB, so make sure the 'ports' field contains the same port as the 'image_port'"
}
Expand All @@ -33,19 +33,19 @@ variable "extra_container_definitions" {
name = string
image = string
ports = list(number)
environment_variables = map(string)
secrets = map(string)
efs_volume_mounts = list(object({
environment_variables = optional(map(string))
secrets = optional(map(string))
efs_volume_mounts = optional(list(object({
name = string
file_system_id = string
root_directory = string
container_path = string
}))
ulimits = list(object({
})))
ulimits = optional(list(object({
name = string
soft_limit = number
hard_limit = number
}))
})))
}))
description = "A list of extra container definitions. Defaults to []"
default = []
Expand Down Expand Up @@ -156,11 +156,11 @@ variable "codedeploy_test_listener_port" {
}
variable "codedeploy_lifecycle_hooks" {
type = object({
BeforeInstall = string
AfterInstall = string
AfterAllowTestTraffic = string
BeforeAllowTraffic = string
AfterAllowTraffic = string
BeforeInstall = optional(string)
AfterInstall = optional(string)
AfterAllowTestTraffic = optional(string)
BeforeAllowTraffic = optional(string)
AfterAllowTraffic = optional(string)
})
description = "Define Lambda Functions for CodeDeploy lifecycle event hooks. Or set this variable to null to not have any lifecycle hooks invoked. Defaults to null"
default = null
Expand Down Expand Up @@ -211,6 +211,7 @@ variable "autoscaling_config" {
max_capacity = number
})
description = "Configuration for default autoscaling policies and alarms. Set to null if you want to set up your own autoscaling policies and alarms."
default = null
}
variable "scaling_up_policy_config" {
type = object({
Expand Down