Add CloudFront CDN to Discourse instances
This commit is contained in:
Родитель
234617d9d6
Коммит
a2096af15c
|
@ -6,6 +6,8 @@ module "discourse-production" {
|
|||
discourse_elasticache_instance_size = "cache.t2.medium"
|
||||
service_security_group_id = "${module.mesos-cluster-production.mesos-cluster-slave-sg-id}"
|
||||
elasticache_subnet_group = "${aws_elasticache_subnet_group.elasticache-production-subnet-group.name}"
|
||||
fqdn = "discourse.mozilla-community.org"
|
||||
ssl_certificate = "${lookup(var.ssl_certificates, "community-sites-elb-${var.aws_region}")}"
|
||||
}
|
||||
|
||||
module "discourse-staging" {
|
||||
|
@ -16,4 +18,6 @@ module "discourse-staging" {
|
|||
discourse_elasticache_instance_size = "cache.t2.micro"
|
||||
service_security_group_id = "${module.mesos-cluster-staging.mesos-cluster-slave-sg-id}"
|
||||
elasticache_subnet_group = "${aws_elasticache_subnet_group.elasticache-staging-subnet-group.name}"
|
||||
fqdn = "discourse.staging.paas.mozilla.community"
|
||||
ssl_certificate = "${lookup(var.ssl_certificates, "community-sites-elb-${var.aws_region}")}"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ variable "discourse_elasticache_instance_size" {}
|
|||
variable "elasticache_subnet_group" {}
|
||||
variable "service_security_group_id" {}
|
||||
variable "environment" {}
|
||||
variable "fqdn" {}
|
||||
variable "ssl_certificate" {}
|
||||
|
||||
resource "aws_security_group" "discourse-redis-sg" {
|
||||
name = "discourse-redis-shared-sg"
|
||||
|
@ -66,3 +68,14 @@ resource "aws_s3_bucket" "discourse-content" {
|
|||
project = "discourse"
|
||||
}
|
||||
}
|
||||
|
||||
module "discourse-cdn" {
|
||||
source = "git://github.com/mozilla/partinfra-terraform-cloudfrontssl.git"
|
||||
|
||||
origin_domain_name = "${var.fqdn}"
|
||||
origin_path = "/"
|
||||
origin_id = "discourse-pull-origin"
|
||||
alias = "cdn-${var.environment}.discourse.mozilla-community.org"
|
||||
comment = "Discourse ${var.environment} CDN"
|
||||
acm_certificate_arn = "${var.ssl_certificate}"
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче