-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from jdno/datadog-fastly
Deploy Datadog integration for Fastly account
- Loading branch information
Showing
10 changed files
with
190 additions
and
1 deletion.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
terragrunt/accounts/legacy/datadog-fastly/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
terraform { | ||
source = "../../../modules//datadog-fastly" | ||
} | ||
|
||
include { | ||
path = find_in_parent_folders() | ||
merge_strategy = "deep" | ||
} | ||
|
||
inputs = { | ||
services = { | ||
"5qaYFyyiorVua6uCZg7It0" = { | ||
env = "staging" | ||
app = "releases" | ||
service = "dev-static-rust-lang-org" | ||
}, | ||
"gEfRWQihVaQqh6vsPlY0H1" = { | ||
env = "prod" | ||
app = "crates-io" | ||
service = "static-crates-io" | ||
}, | ||
"MWlq3AIDXubpbw725c7og3" = { | ||
env = "prod" | ||
app = "releases" | ||
service = "static-rust-lang-org" | ||
}, | ||
"liljrvY3Xt0CzNk0mpuLa7" = { | ||
env = "staging" | ||
app = "crates-io" | ||
service = "static-staging-crates-io" | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
51b9ceee5db8ed60e1f86d1acd0231a7a2a2ba81 | ||
04334ff7f9612c5a945e3b043b6c62c552f3c12c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Fastly Integration for Datadog | ||
|
||
[Datadog] is a monitoring and observability platform that we use to monitor | ||
our cloud infrastructure. Datadog provides an | ||
[integration for Fastly][datadog-fastly] and a [Terraform module] to manage it, | ||
which we use in this module. | ||
|
||
We use [tags](https://docs.datadoghq.com/getting_started/tagging/) to make it | ||
easy to filter and group metrics in Datadog. Each Fastly service is tagged with | ||
the following variables: | ||
|
||
- `env`: The environment of the service, either `prod` or `staging` | ||
- `app`: The app or component that this service belongs to, e.g. `crates-io` | ||
- `service`: The name of the service, e.g. `static-crates-io` | ||
|
||
[datadog]: https://datadoghq.com | ||
[datadog-fastly]: https://docs.datadoghq.com/integrations/fastly | ||
[terraform module]: https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/integration_fastly_account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
terraform { | ||
required_version = "~> 1.0" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.32" | ||
} | ||
datadog = { | ||
source = "datadog/datadog" | ||
version = "3.28.0" | ||
} | ||
fastly = { | ||
source = "fastly/fastly" | ||
version = "5.2.2" | ||
} | ||
} | ||
} | ||
|
||
provider "datadog" {} | ||
provider "fastly" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
data "aws_ssm_parameter" "fastly_api_key" { | ||
name = "/prod/datadog-fastly/fastly-api-key" | ||
with_decryption = false | ||
} | ||
|
||
resource "datadog_integration_fastly_account" "account" { | ||
name = "Rust Foundation" | ||
api_key = data.aws_ssm_parameter.fastly_api_key.value | ||
} | ||
|
||
resource "datadog_integration_fastly_service" "service" { | ||
for_each = var.services | ||
|
||
account_id = datadog_integration_fastly_account.account.id | ||
service_id = each.key | ||
|
||
tags = [ | ||
"env:${each.value.env}", | ||
"app:${each.value.app}", | ||
"service:${each.value.service}", | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
variable "services" { | ||
description = "List of Fastly services" | ||
type = map(object({ | ||
env = string | ||
app = string | ||
service = string | ||
})) | ||
default = {} | ||
|
||
validation { | ||
condition = alltrue([ | ||
for e in var.services : | ||
contains(["staging", "prod"], e.env) | ||
]) | ||
error_message = "The environment must be 'staging' or 'prod'." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters