Skip to content

Commit

Permalink
Add depends_on to prevent branch policy being created before the corr…
Browse files Browse the repository at this point in the history
…esponding environment (which results in an error), add more detail about the error thrown if deployment_branch_policy.custom_branch_policies is not set to true, tf fmt example
  • Loading branch information
calebplum committed Aug 3, 2023
1 parent db8ab33 commit b416863
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ resource "github_repository_environment" "env" {
}
resource "github_repository_deployment_branch_policy" "foo" {
repository = "my_repo"
depends_on = [github_repository_environment.env]
repository = "my_repo"
environment_name = "my_env"
name = "foo"
name = "foo"
}
```

Expand All @@ -36,7 +38,7 @@ The following arguments are supported:

* `repository` - (Required) The repository to create the policy in.

* `environment_name` - (Required) The name of the environment. This environment must have `deployment_branch_policy.custom_branch_policies` set to true.
* `environment_name` - (Required) The name of the environment. This environment must have `deployment_branch_policy.custom_branch_policies` set to true or a 404 error will be thrown.

* `name` - (Required) The name pattern that branches must match in order to deploy to the environment.

Expand Down

0 comments on commit b416863

Please sign in to comment.