Commit 88380ab
fix: add null_resource to register hostname before managed cert creation
Azure API requires the hostname to be bound to a container app before a
managed certificate can be created for it (error: RequireCustomHostnameInEnvironment).
This creates a circular dependency in Terraform: the managed cert needs the
hostname registered, but azurerm_container_app_custom_domain with SniEnabled
needs the cert to exist.
Break the cycle with a null_resource that registers the hostname (Disabled
binding) via az CLI local-exec, giving the cert resource a hostname to
validate against. TF then creates the cert and upgrades the binding to
SniEnabled via azurerm_container_app_custom_domain.
Also adds the hashicorp/null provider (~> 3.0) to providers.tf.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 43b8c0b commit 88380ab
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
189 | 209 | | |
190 | 210 | | |
191 | 211 | | |
| |||
194 | 214 | | |
195 | 215 | | |
196 | 216 | | |
| 217 | + | |
| 218 | + | |
197 | 219 | | |
198 | 220 | | |
199 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments