variable "aws_region" {
  description = "AWS region to deploy resources in"
  default     = "us-east-1"
}

variable "environment" {
  description = "Name of the environment, e.g. dev, qa, prod"
  default     = "prod"
}

variable "application_family" {
  default = "product-builder"
}

variable "api_gateway_instance_name" {
  description = "Name of the api gateway"
  default     = "new-release-json-blaster"
}

variable "s3_path" {
  description = "Path within S3 bucket"
  default     = "releases.theorchard.com"
}

variable "api_gateway_certificate_arn" {
  description = "ARN of existing certificate for use with API gateway"
  default     = "arn:aws:acm:us-east-1:437795906767:certificate/a76e4883-28aa-4062-a4cc-c06b8012ae28"
}

variable "api_gateway_domain_name" {
  description = "Custom domain name for api gateway"
  default     = "new-release-data.theorchard.io"
}

variable "aws_route53_params" {
  description = "AWS route 53 parameters"
  default = {
    zone_id = "Z2RSKZ9M7TJ9Z"
    type    = "A"
  }
}

variable "s3_object" {
  description = "Object or parameter name of final uri object"
  default     = "data.json"
}

variable "s3_spec_object" {
  description = "Object or parameter name of spec endpoint object"
  default     = "swagger.yaml"
}

variable "s3_region" {
  description = "Region of S3 bucket"
  default     = "us-east-1"
}

variable datadog_function_destination_lambda_name {
  description = "Name of datadog function for shipping cloudwatch logs"
  default     = "DatadogLambdaFunction"
}

locals {
  s3_bucket                        = "${var.environment}-orcdbucket"
  invoke_api_iam_user_name         = "${var.environment}-45press-invoke-${var.api_gateway_instance_name}"
  api_gateway_name                 = "${var.environment}-${var.api_gateway_instance_name}"
  datadog_function_destination_arn = "arn:aws:lambda:${var.aws_region}:${data.aws_caller_identity.current.account_id}:function:${var.datadog_function_destination_lambda_name}"
}
