Skip to content

Commit

Permalink
Autospotting LICENSE lambda env var and evaluation code default (#19)
Browse files Browse the repository at this point in the history
* Autospotting LICENSE lambda env var and evaluation code default

* Add valid LICENSE options to autospotting_license description
  • Loading branch information
recurrence authored Apr 10, 2020
1 parent 4a40d6e commit 33151a3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module "aws_lambda_function" {
autospotting_regions_enabled = var.autospotting_regions_enabled
autospotting_tag_filters = var.autospotting_tag_filters
autospotting_tag_filtering_mode = var.autospotting_tag_filtering_mode
autospotting_license = var.autospotting_license
}

resource "aws_iam_role" "autospotting_role" {
Expand Down
2 changes: 2 additions & 0 deletions modules/lambda/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ resource "aws_lambda_function" "autospotting" {
REGIONS = var.autospotting_regions_enabled
TAG_FILTERS = var.autospotting_tag_filters
TAG_FILTERING_MODE = var.autospotting_tag_filtering_mode
LICENSE = var.autospotting_license
}
}
}
Expand Down Expand Up @@ -61,6 +62,7 @@ resource "aws_lambda_function" "autospotting_from_s3" {
REGIONS = var.autospotting_regions_enabled
TAG_FILTERS = var.autospotting_tag_filters
TAG_FILTERING_MODE = var.autospotting_tag_filtering_mode
LICENSE = var.autospotting_license
}
}
}
Expand Down
1 change: 1 addition & 0 deletions modules/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ variable "autospotting_bidding_policy" {}
variable "autospotting_regions_enabled" {}
variable "autospotting_tag_filters" {}
variable "autospotting_tag_filtering_mode" {}
variable "autospotting_license" {}

variable "lambda_tags" {
description = "Tags to be applied to the Lambda function"
Expand Down
14 changes: 12 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ EOF
default = "opt-in"
}

variable "autospotting_license" {
description = <<EOF
Autospotting License code. Allowed options are:
'evaluation', 'I_am_supporting_it_on_Patreon',
'I_contributed_to_development_within_the_last_year',
'I_built_it_from_source_code'
EOF
default = "evaluation"
}

# Lambda configuration
variable "lambda_zipname" {
description = "Name of the archive, relative to the module"
Expand Down Expand Up @@ -141,7 +151,7 @@ variable "lambda_tags" {
# Label configuration
variable "label_context" {
description = "Used to pass in label module context"
type = object({
type = object({
namespace = string
environment = string
stage = string
Expand All @@ -154,7 +164,7 @@ variable "label_context" {
additional_tag_map = map(string)
regex_replace_chars = string
})
default = {
default = {
namespace = ""
environment = ""
stage = ""
Expand Down

0 comments on commit 33151a3

Please sign in to comment.