Skip to content

Commit

Permalink
Add ECS cluster service Datadog service definitions
Browse files Browse the repository at this point in the history
* Adds metadata to the services within Datadog
  • Loading branch information
Stretch96 committed Oct 11, 2024
1 parent fc7e174 commit c661035
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This project creates and manages resources within an AWS account for infrastruct
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.70.0 |
| <a name="provider_aws.awsroute53root"></a> [aws.awsroute53root](#provider\_aws.awsroute53root) | 5.70.0 |
| <a name="provider_aws.useast1"></a> [aws.useast1](#provider\_aws.useast1) | 5.70.0 |
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.46.0 |
| <a name="provider_external"></a> [external](#provider\_external) | 2.3.4 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.6.3 |
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |
Expand Down Expand Up @@ -444,6 +445,7 @@ This project creates and manages resources within an AWS account for infrastruct
| [aws_wafv2_ip_set.infrastructure_ecs_cluster_ipv6_allow_list](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_ip_set) | resource |
| [aws_wafv2_ip_set.infrastructure_ecs_cluster_ipv6_deny_list](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_ip_set) | resource |
| [aws_wafv2_web_acl.infrastructure_ecs_cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl) | resource |
| [datadog_service_definition_yaml.infrastructure_ecs_cluster_service](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/service_definition_yaml) | resource |
| [random_password.infrastructure_ecs_cluster_service_cloudfront_bypass_protection_secret](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |
| [random_password.infrastructure_rds_root](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |
| [terraform_data.infrastructure_ecs_cluster_datadog_agent_image_build_trigger_codebuild](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/resources/data) | resource |
Expand Down
17 changes: 17 additions & 0 deletions ecs-cluster-infrastructure-service-datadog-definition.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "datadog_service_definition_yaml" "infrastructure_ecs_cluster_service" {
for_each = local.enable_infrastructure_ecs_cluster_datadog_agent ? local.infrastructure_ecs_cluster_services : {}

service_definition = yamlencode({
schema-version = "v2.2",
dd-service = aws_ecs_task_definition.infrastructure_ecs_cluster_service[each.key].family
team = ""
links = [
{
name = "Home"
type = "other"
provider = "URL"
url = each.value["domain_names"] != null ? join(",", [for domain in each.value["domain_names"] : "https://${domain}"]) : "https://${each.key}.${local.infrastructure_route53_domain}"
}
]
})
}

0 comments on commit c661035

Please sign in to comment.