Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions content/en/deployment_gates/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,50 @@
{{% /tab %}}
{{< /tabs >}}

## Managing Deployment Gates

You can manage Deployment Gates via the UI, API or Terraform.

Check warning on line 112 in content/en/deployment_gates/setup.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.words_case_insensitive

Use 'with' or 'through' instead of 'via'.

Check notice on line 112 in content/en/deployment_gates/setup.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.oxfordcomma

Suggestion: Use the Oxford comma in 'You can manage Deployment Gates via the UI, API or'.

- **API**: You can use the [Deployment Gates API][1] to create and manage Deployment Gates.
- **Terraform**: You can use the [Datadog Terraform provider][2] to create and manage Deployment Gates. For example:

```yaml
# Create new deployment_gate resource

resource "datadog_deployment_gate" "foo" {
dry_run = "false"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use boolean for dry_run in Terraform example

The example sets dry_run to the string "false", but the Terraform provider schema for boolean attributes expects an unquoted boolean. With the current snippet, terraform plan/apply will fail with a type error (string provided where bool is required), so readers who copy/paste will get an invalid configuration. Use dry_run = false instead to match the expected type.

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both work!

env = "production"
identifier = "my-gate"
service = "my-service"

rule {
name = "fdd"
type = "faulty_deployment_detection"
dry_run = false
options {
duration = 1300
excluded_resources = ["GET api/v1/test"]
}
}

rule {
name = "monitor"
type = "monitor"
dry_run = false
options {
query = "service:test-service"
duration = 1300
}
}
}
```

Will create a deployment gate and it will be completely managed by terraform. Any changes to the gate applied in the UI will be overwritten by the terraform configuration.

Check warning on line 148 in content/en/deployment_gates/setup.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.tense

Avoid temporal words like 'will'.

Check warning on line 148 in content/en/deployment_gates/setup.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.tense

Avoid temporal words like 'will'.

Check warning on line 148 in content/en/deployment_gates/setup.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.tense

Avoid temporal words like 'Will'.


[1]: https://docs.datadoghq.com/api/latest/deployment-gates/
[2]: https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/deployment_gate

Check warning on line 152 in content/en/deployment_gates/setup.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.words_case_sensitive

Use 'Datadog' instead of 'datadog'.

## Evaluate Deployment Gates

Once you have configured the gates and rules, you can request a gate evaluation when deploying the related service, and decide whether to block or continue the deployment based on the result.
Expand Down
Loading