-
-
Notifications
You must be signed in to change notification settings - Fork 645
feat!: Add support for ECS managed instances #364
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
base: master
Are you sure you want to change the base?
feat!: Add support for ECS managed instances #364
Conversation
|
Still working on finding a solution for:
New APIs, fun times ... fun may vary |
|
Looking forward for the managed instances support! |
3b89420 to
e4910ad
Compare
e4910ad to
d88ff02
Compare
antonbabenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| capacity_provider_names = var.capacity_providers != null ? join(",", [for k, v in var.capacity_providers : aws_ecs_capacity_provider.this[k].name]) : "" | ||
| # This is done so that the output of `capacity_providers` also waits for them to be `ACTIVE` | ||
| # for the scenarios where users define separate cluster and service modules (serivce needs the provider to be ACTIVE) | ||
| capacity_providers = var.capacity_providers != null ? jsonencode(aws_ecs_capacity_provider.this) : "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pure magic! Hope it works :)
| default = {} | ||
| } | ||
|
|
||
| variable "disable_v7_default_name_description" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach with such disable_* vars is new to our modules, right? I wonder if it is a good idea to introduce such tmp vars and then remove them. Maybe we can have something long-term so users can flip true/false as needed in future versions of the module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this is the first time we would have used something like this. How long term are you thinking? Theres sort of two sides:
- We adopt some approach like this to ease upgrade disruptions - its a very clear demarcation that we have made a change, we are extending a bit more time for users to adjust to it (beyond when it was first introduced - here I have stated it would exist for 2 major releases, giving users time to remediate as they see fit)
- In this case, we scrap the variable all together and guide users on how to set the name/description to match the prior defaults and avoid the recreation
Approach 1 carries more overhead and some technical baggage but for a finite amount of time - and even once that duration has lapsed, they can still follow approach 2.
If we look at making this indefinite, if that is what you are suggesting, that could be a bit more complicated if we ever decide to alter the defaults again in the future
magreenbaum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🎉
| each.value.tags, | ||
| ) | ||
|
|
||
| # What an awful friggin service API they created with managed instances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it really was a challenge to get things to "mostly" work (see the managed instances example - you MUST do targeted applies and destroys, unfortunately, or else you will end up in a pretty poor state and its difficult to get out of. this was something I simply could not find a solution for). I do fear that we'll see a lot of issues for this feature and we'll have to redirect folks upstream to AWS or the AWS provider - we shall see!
Description
List of backwards incompatible changes
default_capacity_provider_strategyvariable as well as any specified in theautoscaling_capacity_providersvariable. As of v7.0.0, the module will no longer infer the capacity providers that should be associated with the cluster. Instead, users must explicitly specify the desired capacity providers using the newcluster_capacity_providersvariable. The only inference of capacity providers are those created by the module itself when using thecapacity_providersvariable. Essentially, if you are usingFARGATE,FARGATE_SPOT, or an externally created capacity provider, you must now specify those in thecluster_capacity_providersvariable.autoscaling_capacity_providershas been replaced with the more genericcapacity_providersvariable. If you were previously usingautoscaling_capacity_providers, you will need to migrate to the newcapacity_providersvariable by simply renaming it and nesting each ASG capacity provider definition under the argumentauto_scaling_group_provider. See the before vs after section below for an example of this change. Note: your existing ASG capacity providers will continue to work as before, this is simply a variable rename and variable definition modification. No resources will be replaced/destroyed as part of this change.ordered_placement_strategytype definition has been changed frommap(object({...}))tolist(object({...})). The argument needs to preserve order so a list is necessary.Additional changes
Added
var.namevalue and relying on the module, these new defaults help to distinguish resources created by the module. Instead of seeing 4 IAM roles named"example-<random>", you will now see names like"example-service-<random>","example-task-exec-<random>","example-tasks-<random>", and"example-infra-<random>". To aid in the migration, a variabledisable_v7_default_name_descriptionhas been added that allow users to opt out of theses default settings for existing resources (avoid re-creating them). This ensures an easier upgrade path while also letting new resources benefit from the improved naming and descriptions. Note: this variable and therefore its behavior will be removed in versionv9.0of the module, giving users time to remediate.Modified
lifecycle_hookandadvanced_configurationarguments as part of the progressive deployment options. Users can still provide their own role, but the default now matches the rest of the module where the infrastructure IAM role created by the module will be used unless a different IAM role is provided.Variable and output changes
Note
The variables and outputs added for ECS managed instance support has not been added to this list. Those details are not relevant to the upgrade process. See the pull request for more details on what has been added for ECS managed instances support (or consult the documentation/examples within the repository).
Removed variables:
Renamed variables:
autoscaling_capacity_providers->capacity_providersAdded variables:
cluster_capacity_providersdisable_v7_default_name_descriptionRemoved outputs:
Renamed outputs:
autoscaling_capacity_providers->capacity_providersAdded outputs:
Motivation and Context
examples/complete-- advancedConfiguration field is required for all loadBalancers when using the linear deployment strategy #377Breaking Changes
How Has This Been Tested?
examples/*to demonstrate and validate my change(s)examples/*projectspre-commit run -aon my pull request