Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(module/asg): Introduce Instance Refresh for ASG module #3

Merged
merged 7 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
148 changes: 74 additions & 74 deletions examples/centralized_design_autoscale/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions examples/centralized_design_autoscale/example.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,23 @@ vmseries_asgs = {
}
}

launch_template_version = "1"
sebastianczech marked this conversation as resolved.
Show resolved Hide resolved

instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 3600
checkpoint_percentages = [50, 100]
instance_warmup = 1200
min_healthy_percentage = 50
skip_matching = false
auto_rollback = false
scale_in_protected_instances = "Ignore"
standby_instances = "Ignore"
}
triggers = []
}

application_lb = {
name = "public-alb"
rules = {
Expand Down
2 changes: 2 additions & 0 deletions examples/centralized_design_autoscale/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ module "vm_series_asg" {
min_size = each.value.asg.min_size
desired_capacity = each.value.asg.desired_cap
lambda_execute_pip_install_once = each.value.asg.lambda_execute_pip_install_once
instance_refresh = each.value.instance_refresh
launch_template_version = each.value.launch_template_version
vmseries_iam_instance_profile = aws_iam_instance_profile.vm_series_iam_instance_profile.name
subnet_ids = [for i, j in var.vpcs[each.value.vpc].subnets : module.subnet_sets[format("%s-lambda", each.value.vpc)].subnets[j.az].id if j.set == "lambda"]
security_group_ids = contains(keys(module.vpc[each.value.vpc].security_group_ids), "lambda") ? [module.vpc[each.value.vpc].security_group_ids["lambda"]] : []
Expand Down
36 changes: 36 additions & 0 deletions examples/centralized_design_autoscale/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ variable "vmseries_asgs" {
- `statistic`: statistic of the metric. Valid values: Average, Maximum, Minimum, SampleCount, Sum
- `cloudwatch_namespace`: name of CloudWatch namespace, where metrics are available (it should be the same as namespace configured in VM-Series plugin in PAN-OS)
- `tags`: tags configured for dynamic scaling policy
- `launch_template_version`: launch template version to use to launch instances
- `instance_refresh`: instance refresh for ASG defined by several attributes (please README for module `asg` for more details)
sebastianczech marked this conversation as resolved.
Show resolved Hide resolved

Example:
```
Expand Down Expand Up @@ -378,6 +380,23 @@ variable "vmseries_asgs" {
}
}

launch_template_version = "1"

instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 3600
checkpoint_percentages = [50, 100]
instance_warmup = 1200
min_healthy_percentage = 50
skip_matching = false
auto_rollback = false
scale_in_protected_instances = "Ignore"
standby_instances = "Ignore"
}
triggers = []
}

application_lb = null
network_lb = null
}
Expand Down Expand Up @@ -434,6 +453,23 @@ variable "vmseries_asgs" {
tags = map(string)
})

launch_template_version = string

instance_refresh = object({
strategy = string
preferences = object({
checkpoint_delay = number
checkpoint_percentages = list(number)
instance_warmup = number
min_healthy_percentage = number
skip_matching = bool
auto_rollback = bool
scale_in_protected_instances = string
standby_instances = string
})
triggers = list(string)
})

application_lb = object({
name = string
rules = any
Expand Down
148 changes: 74 additions & 74 deletions examples/combined_design/README.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions examples/combined_design_autoscale/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,23 @@ vmseries_asgs = {
}
}

launch_template_version = "1"

instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 3600
checkpoint_percentages = [50, 100]
instance_warmup = 1200
min_healthy_percentage = 50
skip_matching = false
auto_rollback = false
scale_in_protected_instances = "Ignore"
standby_instances = "Ignore"
}
triggers = []
}

delicense = {
enabled = true
ssm_param_name = "NAME_OF_THE_SECURE_STRING_PARAMETER" # TODO: update here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,23 @@ vmseries_asgs = {
}
}

launch_template_version = "1"

instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 3600
checkpoint_percentages = [50, 100]
instance_warmup = 1200
min_healthy_percentage = 50
skip_matching = false
auto_rollback = false
scale_in_protected_instances = "Ignore"
standby_instances = "Ignore"
}
triggers = []
}

delicense = {
enabled = false
ssm_param_name = null
Expand Down
17 changes: 17 additions & 0 deletions examples/combined_design_autoscale/example.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,23 @@ vmseries_asgs = {
}
}

launch_template_version = "1"

instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 3600
checkpoint_percentages = [50, 100]
instance_warmup = 1200
min_healthy_percentage = 50
skip_matching = false
auto_rollback = false
scale_in_protected_instances = "Ignore"
standby_instances = "Ignore"
}
triggers = []
}

delicense = {
enabled = false
ssm_param_name = null
Expand Down
2 changes: 2 additions & 0 deletions examples/combined_design_autoscale/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ module "vm_series_asg" {
min_size = each.value.asg.min_size
desired_capacity = each.value.asg.desired_cap
lambda_execute_pip_install_once = each.value.asg.lambda_execute_pip_install_once
instance_refresh = each.value.instance_refresh
launch_template_version = each.value.launch_template_version
vmseries_iam_instance_profile = aws_iam_instance_profile.vm_series_iam_instance_profile.name
subnet_ids = [for i, j in var.vpcs[each.value.vpc].subnets : module.subnet_sets[format("%s-lambda", each.value.vpc)].subnets[j.az].id if j.set == "lambda"]
security_group_ids = contains(keys(module.vpc[each.value.vpc].security_group_ids), "lambda") ? [module.vpc[each.value.vpc].security_group_ids["lambda"]] : []
Expand Down
36 changes: 36 additions & 0 deletions examples/combined_design_autoscale/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ variable "vmseries_asgs" {
- `statistic`: statistic of the metric. Valid values: Average, Maximum, Minimum, SampleCount, Sum
- `cloudwatch_namespace`: name of CloudWatch namespace, where metrics are available (it should be the same as namespace configured in VM-Series plugin in PAN-OS)
- `tags`: tags configured for dynamic scaling policy
- `launch_template_version`: launch template version to use to launch instances
- `instance_refresh`: instance refresh for ASG defined by several attributes (please README for module `asg` for more details)

Example:
```
Expand Down Expand Up @@ -380,6 +382,23 @@ variable "vmseries_asgs" {
}
}

launch_template_version = "1"

instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 3600
checkpoint_percentages = [50, 100]
instance_warmup = 1200
min_healthy_percentage = 50
skip_matching = false
auto_rollback = false
scale_in_protected_instances = "Ignore"
standby_instances = "Ignore"
}
triggers = []
}

delicense = {
enabled = true
ssm_param_name = "example_param_store_delicense" # TODO: update here
Expand Down Expand Up @@ -438,6 +457,23 @@ variable "vmseries_asgs" {
tags = map(string)
})

launch_template_version = string

instance_refresh = object({
strategy = string
preferences = object({
checkpoint_delay = number
checkpoint_percentages = list(number)
instance_warmup = number
min_healthy_percentage = number
skip_matching = bool
auto_rollback = bool
scale_in_protected_instances = string
standby_instances = string
})
triggers = list(string)
})

delicense = object({
enabled = bool
ssm_param_name = string
Expand Down
Loading
Loading