Skip to content

Commit 01ac8d2

Browse files
authored
Custom deployment policy (#141)
* Custom deployment policy * Custom deployment policy
1 parent 853d20a commit 01ac8d2

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ Available targets:
323323
| <a name="input_deployment_batch_size"></a> [deployment\_batch\_size](#input\_deployment\_batch\_size) | Percentage or fixed number of Amazon EC2 instances in the Auto Scaling group on which to simultaneously perform deployments. Valid values vary per deployment\_batch\_size\_type setting | `number` | `1` | no |
324324
| <a name="input_deployment_batch_size_type"></a> [deployment\_batch\_size\_type](#input\_deployment\_batch\_size\_type) | The type of number that is specified in deployment\_batch\_size\_type | `string` | `"Fixed"` | no |
325325
| <a name="input_deployment_ignore_health_check"></a> [deployment\_ignore\_health\_check](#input\_deployment\_ignore\_health\_check) | Do not cancel a deployment due to failed health checks | `bool` | `false` | no |
326+
| <a name="input_deployment_policy"></a> [deployment\_policy](#input\_deployment\_policy) | Use the DeploymentPolicy option to set the deployment type. The following values are supported: `AllAtOnce`, `Rolling`, `RollingWithAdditionalBatch`, `Immutable`, `TrafficSplitting` | `string` | `"Rolling"` | no |
326327
| <a name="input_deployment_timeout"></a> [deployment\_timeout](#input\_deployment\_timeout) | Number of seconds to wait for an instance to complete executing commands | `number` | `600` | no |
327328
| <a name="input_description"></a> [description](#input\_description) | Short description of the Environment | `string` | `""` | no |
328329
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
@@ -527,7 +528,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
527528

528529
## Copyright
529530

530-
Copyright © 2017-2021 [Cloud Posse, LLC](https://cpco.io/copyright)
531+
Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright)
531532

532533

533534

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
| <a name="input_deployment_batch_size"></a> [deployment\_batch\_size](#input\_deployment\_batch\_size) | Percentage or fixed number of Amazon EC2 instances in the Auto Scaling group on which to simultaneously perform deployments. Valid values vary per deployment\_batch\_size\_type setting | `number` | `1` | no |
7979
| <a name="input_deployment_batch_size_type"></a> [deployment\_batch\_size\_type](#input\_deployment\_batch\_size\_type) | The type of number that is specified in deployment\_batch\_size\_type | `string` | `"Fixed"` | no |
8080
| <a name="input_deployment_ignore_health_check"></a> [deployment\_ignore\_health\_check](#input\_deployment\_ignore\_health\_check) | Do not cancel a deployment due to failed health checks | `bool` | `false` | no |
81+
| <a name="input_deployment_policy"></a> [deployment\_policy](#input\_deployment\_policy) | Use the DeploymentPolicy option to set the deployment type. The following values are supported: `AllAtOnce`, `Rolling`, `RollingWithAdditionalBatch`, `Immutable`, `TrafficSplitting` | `string` | `"Rolling"` | no |
8182
| <a name="input_deployment_timeout"></a> [deployment\_timeout](#input\_deployment\_timeout) | Number of seconds to wait for an instance to complete executing commands | `number` | `600` | no |
8283
| <a name="input_description"></a> [description](#input\_description) | Short description of the Environment | `string` | `""` | no |
8384
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ resource "aws_elastic_beanstalk_environment" "default" {
726726
setting {
727727
namespace = "aws:elasticbeanstalk:command"
728728
name = "DeploymentPolicy"
729-
value = var.rolling_update_type == "Immutable" ? "Immutable" : "Rolling"
729+
value = var.deployment_policy
730730
resource = ""
731731
}
732732

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ variable "rolling_update_type" {
179179
description = "`Health` or `Immutable`. Set it to `Immutable` to apply the configuration change to a fresh group of instances"
180180
}
181181

182+
variable "deployment_policy" {
183+
type = string
184+
default = "Rolling"
185+
description = "Use the DeploymentPolicy option to set the deployment type. The following values are supported: `AllAtOnce`, `Rolling`, `RollingWithAdditionalBatch`, `Immutable`, `TrafficSplitting`"
186+
}
187+
182188
variable "updating_min_in_service" {
183189
type = number
184190
default = 1

0 commit comments

Comments
 (0)