Skip to content

Commit

Permalink
Updates to Docker build to better support memcached and htaccess modi…
Browse files Browse the repository at this point in the history
…fication
  • Loading branch information
h2ouw8n4 committed Nov 3, 2023
1 parent 95a0a4a commit c4be471
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
13 changes: 3 additions & 10 deletions db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ resource "random_string" "snapshot_suffix" {

resource "aws_rds_cluster" "this" {
cluster_identifier = "${var.prefix}-${var.environment}"
engine = "aurora"
engine_mode = "serverless"
engine = "aurora-mysql"
engine_mode = "provisioned"
database_name = "wordpress"
//engine_version = var.db_engine_version
engine_version = var.db_engine_version
master_username = var.db_master_username
master_password = var.db_master_password
backup_retention_period = var.db_backup_retention_days
Expand All @@ -18,13 +18,6 @@ resource "aws_rds_cluster" "this" {
vpc_security_group_ids = [aws_security_group.db.id]
availability_zones = [data.aws_availability_zones.this.names[0], data.aws_availability_zones.this.names[1], data.aws_availability_zones.this.names[2]]
tags = var.tags
scaling_configuration {
auto_pause = true
min_capacity = 1
max_capacity = 8
seconds_until_auto_pause = 300
timeout_action = "RollbackCapacityChange"
}
}

resource "aws_db_subnet_group" "this" {
Expand Down
9 changes: 6 additions & 3 deletions fargate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ resource "aws_ecs_service" "this" {
task_definition = aws_ecs_task_definition.this.arn
desired_count = var.desired_count
launch_type = "FARGATE"
platform_version = "1.4.0" // required for mounting efs
network_configuration {
security_groups = [aws_security_group.alb.id, aws_security_group.db.id, aws_security_group.efs.id]
subnets = module.vpc.private_subnets
Expand Down Expand Up @@ -180,11 +179,15 @@ resource "aws_ecs_task_definition" "this" {
},
{
"name": "WORDPRESS_CONFIG_EXTRA",
"value": "define( 'DOMAIN_CURRENT_SITE', '${var.site_domain}' );define( 'PATH_CURRENT_SITE', '/' );define( 'BLOG_ID_CURRENT_SITE', 1 );"
"value": ""
},
{
"name": "WP_MEMCACHED_ENDPOINT",
"value": "${aws_elasticache_cluster.this.configuration_endpoint}"
}
],
"essential": true,
"image": "278082022129.dkr.ecr.${data.aws_region.current.name}.amazonaws.com/wp:latest",
"image": "410869614410.dkr.ecr.${data.aws_region.current.name}.amazonaws.com/wp:latest",
"name": "wordpress",
"portMappings": [
{
Expand Down
2 changes: 1 addition & 1 deletion provider.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
terraform {
backend "s3" {
bucket = "muensterman-tf-state"
bucket = "giant-propeller-tf-state"
key = "wordpress"
}
}
Expand Down

0 comments on commit c4be471

Please sign in to comment.