philips-labs / terraform-aws-github-runner

Terraform module for scalable GitHub action runners on AWS
https://philips-labs.github.io/terraform-aws-github-runner/
MIT License
2.55k stars 610 forks source link

Warning: Argument is deprecated aws_cloudwatch_event_rule.ami_housekeeper.is_enabled #3652

Closed officel closed 9 months ago

officel commented 10 months ago

Hi there,

Thanks for the great module. I noticed today that I seem to get warnings.

image

│ Warning: Argument is deprecated
│
│   with module.github-runner.module.ami_housekeeper.aws_cloudwatch_event_rule.ami_housekeeper,
│   on .terraform/modules/github-runner/modules/ami-housekeeper/main.tf line 106, in resource "aws_cloudwatch_event_rule" "ami_housekeeper":
│  106:   is_enabled          = true
│
│ Use "state" instead
npalm commented 9 months ago

Thanks for reporting, would you have time to raise a PR with a fix?

officel commented 9 months ago

Yes, I'm not good at English or(and?) contributing to OSS, but I'll try my best.

This time it is because of resource/aws_cloudwatch_event_rule: Add state parameter and deprecate is_enabled parameter in AWS Provider v5.27.0.

https://github.com/hashicorp/terraform-provider-aws/releases/tag/v5.27.0

I think I can fix this place. Just change is_enabled to state.

https://github.com/philips-labs/terraform-aws-github-runner/blob/main/modules/ami-housekeeper/main.tf#L106

Should I modify the version information here to "~> 5.27.0"?

https://github.com/philips-labs/terraform-aws-github-runner/blob/main/modules/ami-housekeeper/versions.tf#L7

Should I throw a PR and then ask questions about these things? I am curious about the etiquette.

officel commented 9 months ago

I have similar statements elsewhere, so we should fix them together.... README and examples seem to be two different things.

terraform-aws-github-runner $ gg is_enabled
README.md:264:  is_enabled = true
examples/permissions-boundary/main.tf:19:  is_enabled = true
modules/ami-housekeeper/main.tf:106:  is_enabled          = true
modules/runner-binaries-syncer/runner-binaries-syncer.tf:127:  is_enabled          = var.enable_event_rule_binaries_syncer
modules/runners/ssm-housekeeper.tf:68:  is_enabled          = local.ssm_housekeeper.enabled