Skip to content

Commit

Permalink
Update to use latest modules (#9)
Browse files Browse the repository at this point in the history
* update modules

* update README
  • Loading branch information
sarkis authored Jul 20, 2018
1 parent d8f0760 commit fbf9f6e
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 42 deletions.
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,27 @@ Available targets:
| container_memory | The amount of RAM to allow container to use in MB. | string | `128` | no |
| container_port | The port number on the container bound to assigned host_port. | string | `80` | no |
| delimiter | The delimiter to be used in labels. | string | `-` | no |
| ecs_alarms_cpu_utilization_threshold | The max percentage of CPU usage for ECS Service. | string | `80` | no |
| ecs_alarms_cpu_utilization_high_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High Alarm action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_high_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_cpu_utilization_high_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High OK action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_high_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_cpu_utilization_high_threshold | The maximum percentage of CPU utilization average. | string | `80` | no |
| ecs_alarms_cpu_utilization_low_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization Low Alarm action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_low_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_cpu_utilization_low_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization Low OK action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_low_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_cpu_utilization_low_threshold | The minimum percentage of CPU utilization average. | string | `20` | no |
| ecs_alarms_enabled | A boolean to enable/disable CloudWatch Alarms for ECS Service metrics. | string | `false` | no |
| ecs_alarms_evaluation_periods | The number of periods to analyze for ECS CloudWatch Alarms. | string | `1` | no |
| ecs_alarms_memory_utilization_threshold | The max percentage of Memory usage for ECS Service. | string | `80` | no |
| ecs_alarms_period | The period (in seconds) to analyze for ECS CloudWatch Alarms. | string | `300` | no |
| ecs_alarms_memory_utilization_high_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization High Alarm action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_high_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_memory_utilization_high_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization High OK action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_high_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_memory_utilization_high_threshold | The maximum percentage of Memory utilization average. | string | `80` | no |
| ecs_alarms_memory_utilization_low_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low Alarm action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_low_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_memory_utilization_low_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low OK action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_low_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_memory_utilization_low_threshold | The minimum percentage of Memory utilization average. | string | `20` | no |
| ecs_cluster_arn | The ECS Cluster ARN where ECS Service will be provisioned. | string | - | yes |
| ecs_cluster_name | The ECS Cluster Name to use in ECS Code Pipeline Deployment step. | string | - | yes |
| ecs_private_subnet_ids | List of Private Subnet IDs to provision ECS Service onto. | list | - | yes |
Expand All @@ -103,7 +119,7 @@ Available targets:
| listener_arns_count | Number of elements in list of ALB Listener ARNs for the ECS service. | string | - | yes |
| name | Name (unique identifier for app or service) | string | - | yes |
| namespace | Namespace (e.g. `cp` or `cloudposse`) | string | - | yes |
| notify_arns | List of ARNs to send notifications on CloudWatch `ALARM` and `OK` actions. | list | - | yes |
| notify_arns | List of ARNs to send notifications on CloudWatch `ALARM` and `OK` actions. | list | `<list>` | no |
| protocol | The protocol used for the port mapping. Options: tcp or udp. | string | `tcp` | no |
| repo_name | GitHub repository name of the application to be built and deployed to ECS. | string | `` | no |
| repo_owner | GitHub Organization or Username. | string | `` | no |
Expand Down Expand Up @@ -141,11 +157,11 @@ Check out these related projects.

File a GitHub [issue](https://github.com/cloudposse/terraform-aws-ecs-web-app/issues), send us an [email][email] or join our [Slack Community][slack].

## Commerical Support
## Commercial Support

Work directly with our team of DevOps experts via email, slack, and video conferencing.

We provide *commercial support* for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a fulltime engineer.
We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer.

[![E-Mail](https://img.shields.io/badge/[email protected])](mailto:[email protected])

Expand All @@ -155,7 +171,7 @@ We provide *commercial support* for all of our [Open Source][github] projects. A
- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects.
- **Build New Terraform Modules.** We'll develop original modules to provision infrastructure.
- **Cloud Architecture.** We'll assist with your cloud strategy and design.
- **Implementation.** We'll provide hands on support to implement our reference architectures.
- **Implementation.** We'll provide hands-on support to implement our reference architectures.


## Community Forum
Expand Down Expand Up @@ -239,6 +255,7 @@ Check out [our other projects][github], [apply for a job][jobs], or [hire us][hi
[docs]: https://docs.cloudposse.com/
[website]: https://cloudposse.com/
[github]: https://github.com/cloudposse/
[commercial_support]: https://github.com/orgs/cloudposse/projects
[jobs]: https://cloudposse.com/jobs/
[hire]: https://cloudposse.com/contact/
[slack]: https://slack.cloudposse.com/
Expand Down
26 changes: 21 additions & 5 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,27 @@
| container_memory | The amount of RAM to allow container to use in MB. | string | `128` | no |
| container_port | The port number on the container bound to assigned host_port. | string | `80` | no |
| delimiter | The delimiter to be used in labels. | string | `-` | no |
| ecs_alarms_cpu_utilization_threshold | The max percentage of CPU usage for ECS Service. | string | `80` | no |
| ecs_alarms_cpu_utilization_high_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High Alarm action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_high_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_cpu_utilization_high_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High OK action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_high_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_cpu_utilization_high_threshold | The maximum percentage of CPU utilization average. | string | `80` | no |
| ecs_alarms_cpu_utilization_low_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization Low Alarm action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_low_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_cpu_utilization_low_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization Low OK action. | list | `<list>` | no |
| ecs_alarms_cpu_utilization_low_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_cpu_utilization_low_threshold | The minimum percentage of CPU utilization average. | string | `20` | no |
| ecs_alarms_enabled | A boolean to enable/disable CloudWatch Alarms for ECS Service metrics. | string | `false` | no |
| ecs_alarms_evaluation_periods | The number of periods to analyze for ECS CloudWatch Alarms. | string | `1` | no |
| ecs_alarms_memory_utilization_threshold | The max percentage of Memory usage for ECS Service. | string | `80` | no |
| ecs_alarms_period | The period (in seconds) to analyze for ECS CloudWatch Alarms. | string | `300` | no |
| ecs_alarms_memory_utilization_high_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization High Alarm action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_high_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_memory_utilization_high_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization High OK action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_high_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_memory_utilization_high_threshold | The maximum percentage of Memory utilization average. | string | `80` | no |
| ecs_alarms_memory_utilization_low_alarm_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low Alarm action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_low_evaluation_periods | Number of periods to evaluate for the alarm. | string | `1` | no |
| ecs_alarms_memory_utilization_low_ok_actions | A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low OK action. | list | `<list>` | no |
| ecs_alarms_memory_utilization_low_period | Duration in seconds to evaluate for the alarm. | string | `300` | no |
| ecs_alarms_memory_utilization_low_threshold | The minimum percentage of Memory utilization average. | string | `20` | no |
| ecs_cluster_arn | The ECS Cluster ARN where ECS Service will be provisioned. | string | - | yes |
| ecs_cluster_name | The ECS Cluster Name to use in ECS Code Pipeline Deployment step. | string | - | yes |
| ecs_private_subnet_ids | List of Private Subnet IDs to provision ECS Service onto. | list | - | yes |
Expand All @@ -41,7 +57,7 @@
| listener_arns_count | Number of elements in list of ALB Listener ARNs for the ECS service. | string | - | yes |
| name | Name (unique identifier for app or service) | string | - | yes |
| namespace | Namespace (e.g. `cp` or `cloudposse`) | string | - | yes |
| notify_arns | List of ARNs to send notifications on CloudWatch `ALARM` and `OK` actions. | list | - | yes |
| notify_arns | List of ARNs to send notifications on CloudWatch `ALARM` and `OK` actions. | list | `<list>` | no |
| protocol | The protocol used for the port mapping. Options: tcp or udp. | string | `tcp` | no |
| repo_name | GitHub repository name of the application to be built and deployed to ECS. | string | `` | no |
| repo_owner | GitHub Organization or Username. | string | `` | no |
Expand Down
60 changes: 44 additions & 16 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module "default_label" {
source = "git::https://github.com/cloudposse/terraform-terraform-label.git?ref=tags/0.1.3"
source = "git::https://github.com/cloudposse/terraform-terraform-label.git?ref=tags/0.1.4"
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
}

module "ecr" {
source = "git::https://github.com/cloudposse/terraform-aws-ecr.git?ref=tags/0.2.5"
source = "git::https://github.com/cloudposse/terraform-aws-ecr.git?ref=tags/0.2.8"
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
Expand Down Expand Up @@ -49,7 +49,7 @@ module "container_definition" {
}

module "ecs_alb_service_task" {
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.3.0"
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.4.0"
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
Expand Down Expand Up @@ -78,26 +78,54 @@ module "ecs_codepipeline" {
service_name = "${module.ecs_alb_service_task.service_name}"
ecs_cluster_name = "${var.ecs_cluster_name}"
privileged_mode = "true"

environment_variables = [{
"name" = "CONTAINER_NAME"

"value" = "${module.default_label.id}"
}]
}

module "ecs_alarms" {
enabled = "${var.ecs_alarms_enabled}"
source = "git::https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms.git?ref=tags/0.3.0"
notify_arns = ["${var.notify_arns}"]
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
cluster_name = "${var.ecs_cluster_name}"
service_name = "${module.ecs_alb_service_task.service_name}"
cpu_utilization_threshold = "${var.ecs_alarms_cpu_utilization_threshold}"
memory_utilization_threshold = "${var.ecs_alarms_memory_utilization_threshold}"
period = "${var.ecs_alarms_period}"
evaluation_periods = "${var.ecs_alarms_evaluation_periods}"
source = "git::https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms.git?ref=tags/0.4.0"
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
attributes = "${var.attributes}"
tags = "${var.tags}"

enabled = "${var.ecs_alarms_enabled}"
cluster_name = "${var.ecs_cluster_name}"
service_name = "${module.ecs_alb_service_task.service_name}"

cpu_utilization_high_threshold = "${var.ecs_alarms_cpu_utilization_high_threshold}"
cpu_utilization_high_evaluation_periods = "${var.ecs_alarms_cpu_utilization_high_evaluation_periods}"
cpu_utilization_high_period = "${var.ecs_alarms_cpu_utilization_high_period}"
cpu_utilization_high_alarm_actions = "${var.ecs_alarms_cpu_utilization_high_alarm_actions}"
cpu_utilization_high_ok_actions = "${var.ecs_alarms_cpu_utilization_high_ok_actions}"

cpu_utilization_low_threshold = "${var.ecs_alarms_cpu_utilization_low_threshold}"
cpu_utilization_low_evaluation_periods = "${var.ecs_alarms_cpu_utilization_low_evaluation_periods}"
cpu_utilization_low_period = "${var.ecs_alarms_cpu_utilization_low_period}"
cpu_utilization_low_alarm_actions = "${var.ecs_alarms_cpu_utilization_low_alarm_actions}"
cpu_utilization_low_ok_actions = "${var.ecs_alarms_cpu_utilization_low_ok_actions}"

memory_utilization_high_threshold = "${var.ecs_alarms_memory_utilization_high_threshold}"
memory_utilization_high_evaluation_periods = "${var.ecs_alarms_memory_utilization_high_evaluation_periods}"
memory_utilization_high_period = "${var.ecs_alarms_memory_utilization_high_period}"
memory_utilization_high_alarm_actions = "${var.ecs_alarms_memory_utilization_high_alarm_actions}"
memory_utilization_high_ok_actions = "${var.ecs_alarms_memory_utilization_high_ok_actions}"

memory_utilization_low_threshold = "${var.ecs_alarms_memory_utilization_low_threshold}"
memory_utilization_low_evaluation_periods = "${var.ecs_alarms_memory_utilization_low_evaluation_periods}"
memory_utilization_low_period = "${var.ecs_alarms_memory_utilization_low_period}"
memory_utilization_low_alarm_actions = "${var.ecs_alarms_memory_utilization_low_alarm_actions}"
memory_utilization_low_ok_actions = "${var.ecs_alarms_memory_utilization_low_ok_actions}"
}

module "alb_target_group_alarms" {
enabled = "${var.alb_target_group_alarms_enabled}"
source = "git::https://github.com/cloudposse/terraform-aws-alb-target-group-cloudwatch-sns-alarms.git?ref=tags/0.2.0"
source = "git::https://github.com/cloudposse/terraform-aws-alb-target-group-cloudwatch-sns-alarms.git?ref=tags/0.4.0"
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
Expand Down
Loading

0 comments on commit fbf9f6e

Please sign in to comment.