Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

refactor(examples/autoscale): Autoscale example refactor #228

Merged
merged 16 commits into from
Dec 14, 2023

Conversation

horiagunica
Copy link
Contributor

@horiagunica horiagunica commented Nov 30, 2023

Description

Motivation and Context

  • Example refactoring

How Has This Been Tested?

  • Local environment and terratest idempotency tests.

Screenshots (if appropriate)

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@horiagunica horiagunica requested a review from a team as a code owner November 30, 2023 10:16
@horiagunica horiagunica changed the title Autoscale example refactor refactor(examples/autoscale): Autoscale example refactor Nov 30, 2023
}
}
# Autoscale
autoscale_regional_mig = true
Copy link
Contributor

Choose a reason for hiding this comment

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

This param can be moved to per autoscale deployment configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this parameters was left intentionally there - because otherwise this section of the code would have become a lot more complicated due to the fact that we need to iterate over autoscale variable within lb_internal module :

  backend_instance_groups = var.autoscale_regional_mig ? { for v in each.value.backends : v => module.autoscale[v].regional_instance_group_id } : merge([
    for v in each.value.backends :
    {
      for z_k, z_v in var.autoscale[v].zones :
      "${v}_${z_k}" => module.autoscale[v].zonal_instance_group_ids[z_k]
    }
  ]...)

}

autoscale = {
fw-autoscale-common = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd propose to rename this deployment, so that it does not include "common" suffix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's discuss this one during the planning.

examples/vpc_peering_common_with_autoscale/example.tfvars Outdated Show resolved Hide resolved
examples/vpc_peering_common_with_autoscale/example.tfvars Outdated Show resolved Hide resolved
examples/vpc_peering_common_with_autoscale/example.tfvars Outdated Show resolved Hide resolved
examples/vpc_peering_common_with_autoscale/main.tf Outdated Show resolved Hide resolved
examples/vpc_peering_common_with_autoscale/README.md Outdated Show resolved Hide resolved
examples/vpc_peering_common_with_autoscale/main.tf Outdated Show resolved Hide resolved
horiagunica and others added 9 commits December 6, 2023 20:05
Co-authored-by: michalbil <92343355+michalbil@users.noreply.github.com>
Co-authored-by: michalbil <92343355+michalbil@users.noreply.github.com>
Co-authored-by: michalbil <92343355+michalbil@users.noreply.github.com>
Co-authored-by: michalbil <92343355+michalbil@users.noreply.github.com>
Co-authored-by: michalbil <92343355+michalbil@users.noreply.github.com>
Co-authored-by: michalbil <92343355+michalbil@users.noreply.github.com>
@horiagunica horiagunica merged commit 032c896 into main Dec 14, 2023
23 checks passed
@horiagunica horiagunica deleted the autoscale-example-refactor branch December 14, 2023 09:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example: vpc_peering_dedicated_with_autoscale Example: vpc_peering_common_with_autoscale
2 participants