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!: Upgrade module to include capacity providers and bump minimum supported versions #60

Merged

Conversation

bryantbiggs
Copy link
Member

Description

  • Minimum supported version of Terraform AWS provider updated to v4.6 to support the latest resources utilized
  • Minimum supported version of Terraform updated to v1.0
  • ecs-instance-profile sub-module has been removed; this functionality is available through the terraform-aws-modules/terraform-aws-autoscaling module starting with version v6.5.0. Please see the examples/ec2 example for a demonstration on how to use and integrate with the terraform-aws-autoscaling module.
  • The container_insights and capacity_providers variables have been replaced by new variables

See UPGRADE-4.0.md for more details

Motivation and Context

Breaking Changes

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@bryantbiggs

This comment was marked as outdated.

@bryantbiggs bryantbiggs marked this pull request as ready for review June 4, 2022 00:44
source = "terraform-aws-modules/ecs/aws//modules/ecs-instance-profile"
# Users can pin and stay on v3.5.0 until they able to use the IAM instance
# profile provided through the autoscaling group module
version = "3.5.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

I did try to migrate the instance role and profile from the sub-module in v3.x to the autoscaling group, but the instance profile path and name is different from the role and currently the autoscaling group module makes the assumption that the IAM role and instance profile names and paths are the same. Users can pin their profile to v3.5.0 and continue to use without issue and avoid any disruption when upgrading

user_data = base64encode(local.user_data)
ignore_desired_capacity_changes = true

create_iam_instance_profile = true
Copy link
Member Author

@bryantbiggs bryantbiggs Jun 4, 2022

Choose a reason for hiding this comment

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

Lines L128-L134 are the replacement for the ecs-instance-profile sub-module, which is provided through the autoscaling group now. The plan is to replace this similar functionality in the EKS module and rely on the ASG module which will reduce quite a bit of code through consolidation (you can see some of that here but that changeset doesn't yet include the removal of the IAM role and instance profile since that was a recent change to the ASG module)


required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.48"
version = ">= 4.6"
Copy link
Member Author

@bryantbiggs bryantbiggs Jun 4, 2022

Choose a reason for hiding this comment

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

why v4.6 - this is the latest change for ECS service which was released in v4.6. The service sub-module is coming up next which will use this. We could do v4.0 but figured this was more grounded around a feature set that would be used

Copy link
Member

Choose a reason for hiding this comment

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

I agree. It is totally ok to rely on a newer version in such a major release.


Configuration in this directory creates:

- ECS cluster using Fargate (on-demand and spot) capacity provider
Copy link
Member Author

Choose a reason for hiding this comment

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

Once the service sub-module is added, its usage will be added here along with example usage of using ALB and NLB to route traffic to tasks.


⚠️ Module is under active development ⚠️

## TODO
Copy link
Member Author

@bryantbiggs bryantbiggs Jun 4, 2022

Choose a reason for hiding this comment

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

This just lays out the rough shape for this sub-module, it will be built out in subsequent PRs

@@ -0,0 +1 @@
locals {}
Copy link
Member Author

Choose a reason for hiding this comment

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

Worlds best module, simple elegance 🤣

outputs.tf Outdated Show resolved Hide resolved
@bryantbiggs bryantbiggs changed the title feat!: Upgrade module to include capacity providers, cloudwatch log group, and minimum supported versions feat!: Upgrade module to include capacity providers and bump minimum supported versions Jun 5, 2022
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

Looks good, there will be a bit more when more code is there :)

UPGRADE-4.0.md Outdated Show resolved Hide resolved
UPGRADE-4.0.md Outdated Show resolved Hide resolved
examples/ec2/main.tf Outdated Show resolved Hide resolved
examples/ec2/main.tf Outdated Show resolved Hide resolved
examples/ec2/main.tf Outdated Show resolved Hide resolved
examples/ec2/main.tf Outdated Show resolved Hide resolved

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.48"
version = ">= 4.6"
Copy link
Member

Choose a reason for hiding this comment

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

I agree. It is totally ok to rely on a newer version in such a major release.

main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
outputs.tf Outdated Show resolved Hide resolved
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

LGTM

@bryantbiggs bryantbiggs merged commit 7a41657 into terraform-aws-modules:master Jun 8, 2022
@bryantbiggs bryantbiggs deleted the feat/cluster-upgrade branch June 8, 2022 13:25
antonbabenko pushed a commit that referenced this pull request Jun 8, 2022
## [4.0.0](v3.5.0...v4.0.0) (2022-06-08)

### ⚠ BREAKING CHANGES

* Upgrade module to include capacity providers and bump minimum supported versions (#60)

### Features

* Upgrade module to include capacity providers and bump minimum supported versions ([#60](#60)) ([7a41657](7a41657))
@antonbabenko
Copy link
Member

This PR is included in version 4.0.0 🎉

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants