-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
57 lines (49 loc) · 1.23 KB
/
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
47
48
49
50
51
52
53
54
55
terraform {
required_version = ">= 1.5.7"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.17.0"
}
}
backend "s3" {
bucket = "dogsbody-terraform-state"
key = "dbt-lambda-functions.state"
region = "eu-west-2"
}
}
provider "aws" {
region = "eu-west-2"
alias = "main"
}
provider "aws" {
region = "us-east-1"
alias = "useast1"
}
resource "aws_api_gateway_rest_api" "api" {
name = "dbt-lambda-functions"
description = "The Dogsbody Technology Lamdbda Functions"
disable_execute_api_endpoint = true
endpoint_configuration {
types = ["EDGE"]
}
}
resource "aws_acm_certificate" "cert" {
provider = aws.useast1
domain_name = "webhook03.dogsbody.com"
validation_method = "DNS"
lifecycle {
create_before_destroy = true
}
}
resource "aws_api_gateway_domain_name" "domain" {
domain_name = "webhook03.dogsbody.com"
certificate_arn = aws_acm_certificate.cert.id
endpoint_configuration {
types = ["EDGE"]
}
}
resource "aws_api_gateway_base_path_mapping" "base_path_mapping" {
api_id = aws_api_gateway_rest_api.api.id
domain_name = aws_api_gateway_domain_name.domain.domain_name
}