provider "aws" {
  region = "${var.region}"
}

// Stores the state of terraform.
terraform {
  backend "s3" {
    bucket          = "orcd-terraform-state"
    key             = "prod/lambda-artist-info-sync/terraform.tfstate"
    region          = "us-east-1"
    encrypt         = true
  }
}

// Current account identity.
data "aws_caller_identity" "current" {}

// Lambda function asigning an artist_info_id to track and release artists.
# module "artist_info_sync_lambda" {
#   source = "git@github.com:theorchard/terraform-lambda.git"
#
#   environment                                     = "${var.environment}"
#   event_source_mapping_batch_size                 = "1"
#   event_source_mapping_enabled                    = true
#   event_source_mapping_resource_type              = "kinesis"
#   event_source_mapping_starting_position          = "LATEST"
#   event_source_mapping_stream_name                = "prod-maxwell-cloudsearch"
#   lambda_name                                     = "artist-info-sync"
#   lambda_description                              = "Assign an artist_info_id value to track and release artists."
#   lambda_function_reserved_concurrent_executions  = "48" // This will be limited by the number of shards the Kinesis stream has.
#   lambda_function_timeout                         = "300"
#   lambda_function_memory_size                     = "512"
#   vpc_subnet_ids                                  = ["subnet-cb4dbae0", "subnet-5366ef24"]
#   vpc_security_group_ids                          = ["sg-21f1ed44"]
#   iam_policy_file_enabled                         = true
#   use_custom_function_name                        = true
#   custom_function_name                            = "artist-info-sync-prod"
#
#   lambda_function_environment_variables = {
#     Environment = "${var.environment}"
#     SENTRY_DSN = "${var.sentry_dsn}"
#   }
# }
