-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
46 lines (39 loc) · 981 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
terraform {
required_version = ">=1.0.0"
cloud {
hostname = "app.terraform.io"
workspaces {
name = "github-webhook-relay"
}
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
github = {
source = "integrations/github"
version = "~> 4.0"
}
archive = {
source = "hashicorp/archive"
version = "~> 2.2.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.2.0"
}
}
}
provider "aws" {
region = var.aws_region
}
provider "github" {
owner = var.github_owner
}
data "aws_caller_identity" "current" {}
locals {
custom_domain = var.custom_domain_name != "" && var.hosted_zone_id != "" ? true : false
webhook_secret = var.custom_webhook_secret != "" ? var.custom_webhook_secret : random_password.secret[0].result
api_endpoint = local.custom_domain ? "https://${var.custom_domain_name}" : aws_apigatewayv2_api.this.api_endpoint
}