-
Notifications
You must be signed in to change notification settings - Fork 13
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
upgrade to latest module 'cloudposse/label/null' + fixes #10 #14
Conversation
main.tf
Outdated
enabled = var.session_logging_enabled && var.session_logging_encryption_enabled && var.session_logging_kms_key_arn == "" | ||
context = module.logs_label.context | ||
enabled = var.session_logging_enabled && var.session_logging_encryption_enabled && length(var.session_logging_kms_key_arn) == 0 | ||
context = module.this.context |
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.
Because we're keeping the same context EXCEPT the attributes
, we'd break existing users usage of this module when they upgrade. Let's add that attributes, so we don't mess up folks usage of this module.
context = module.this.context | |
context = module.this.context | |
attributes = attributes = compact(concat(["logs"], module.this.attributes)) |
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.
@Gowiem I decided to keep label modules for logs, role and ASG in order to avoid undesired recreation of the resources caused by renaming. We could circle back on the refactoring like this in case we work on other major updates sometime later that will require the replacement.
main.tf
Outdated
@@ -320,17 +305,18 @@ resource "aws_launch_template" "default" { | |||
} | |||
|
|||
resource "aws_autoscaling_group" "default" { | |||
name_prefix = "${module.label.id}-asg" | |||
tags = module.label.tags_as_list_of_maps | |||
name_prefix = module.this.id |
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.
Should we use asg_label
here?
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.
Updated 👍
b2c27f6
to
5f5331f
Compare
@Gowiem the variable With all the above, the plan for existing infra should be like: # module.ssm_agent.aws_autoscaling_group.default will be updated in-place
~ resource "aws_autoscaling_group" "default" {
+ force_delete_warm_pool = false
id = "sts-prod-ssm-agent-asg20201203003845865900000004"
name = "sts-prod-ssm-agent-asg20201203003845865900000004"
~ tags = [
+ {
+ "key" = "Attributes"
+ "propagate_at_launch" = "true"
+ "value" = "asg"
},
- {
- "key" = "Name"
- "propagate_at_launch" = "true"
- "value" = "sts-prod-ssm-agent"
},
+ {
+ "key" = "Name"
+ "propagate_at_launch" = "true"
+ "value" = "sts-prod-ssm-agent-asg"
},
+ {},
# (2 unchanged elements hidden)
]
# (23 unchanged attributes hidden)
# (1 unchanged block hidden)
} |
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.
@gberenice looks great, let's !
Info