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

Terraform_DEPLOY_AHA.tf: Terraform warns is_enabled deprecated #80

Open
rkrenzis opened this issue May 22, 2024 · 0 comments
Open

Terraform_DEPLOY_AHA.tf: Terraform warns is_enabled deprecated #80

rkrenzis opened this issue May 22, 2024 · 0 comments

Comments

@rkrenzis
Copy link

is_enabled is deprecated. Terraform 1.8.3 recommends using 'state' instead.

Terraform version:
1.8.3

AHA Version:
2.2.2

Affected Resources
aws_cloudwatch_event_rule

Expected Behavior
terraform validate or plan should complete without warnings

Actual Behavior

Output from terraform plan:

 Warning: Argument is deprecated
│ 
│   with aws_cloudwatch_event_rule.AHA-LambdaSchedule-PrimaryRegion,
│   on Terraform_DEPLOY_AHA.tf line 755, in resource "aws_cloudwatch_event_rule" "AHA-LambdaSchedule-PrimaryRegion":
│  755:   is_enabled          = true
│ 
│ Use "state" instead
|
│ (and 3 more similar warnings elsewhere)

Output from terraform validate -json formatted

Detail               Address                                                       Filename                 Line
------               -------                                                       --------                 ----
Use "state" instead  aws_cloudwatch_event_rule.AHA-LambdaSchedule-SecondaryRegion  Terraform_DEPLOY_AHA.tf  767
Use "state" instead  aws_cloudwatch_event_rule.AHA-LambdaSchedule-PrimaryRegion    Terraform_DEPLOY_AHA.tf  755

Additional remarks: terraform plan states 3 similar warnings when terraform validate -json reports only 2.

Terraform configuration:

# Terraform_DEPLOY_AHA.tf
# EventBridge - Schedule to run lambda
resource "aws_cloudwatch_event_rule" "AHA-LambdaSchedule-PrimaryRegion" {
  description         = "Lambda trigger Event"
  event_bus_name      = "default"
  is_enabled          = true
  name                = "AHA-LambdaSchedule-${random_string.resource_code.result}"
  schedule_expression = "rate(1 minute)"
  tags = {
    "Name" = "AHA-LambdaSchedule"
  }
}
resource "aws_cloudwatch_event_rule" "AHA-LambdaSchedule-SecondaryRegion" {
  count               = var.aha_secondary_region == "" ? 0 : 1
  provider            = aws.secondary_region
  description         = "Lambda trigger Event"
  event_bus_name      = "default"
  is_enabled          = true
  name                = "AHA-LambdaSchedule-${random_string.resource_code.result}"
  schedule_expression = "rate(1 minute)"
  tags = {
    "Name" = "AHA-LambdaSchedule"
  }
}

Steps to reproduce:

  1. Use terraform 1.8.3 on x86_64
  2. Follow directions to deploy Terraform_DEPLOY_AHA (AHA WITH AWS Organizations on Management Account using Terraform)
@rkrenzis rkrenzis changed the title Terraform_DEPLOY_AHA.tf: Add state; is_enabled is deprecated in recent versions of Terraform Terraform_DEPLOY_AHA.tf: is_enabled deprecated in recent versions of Terraform May 22, 2024
@rkrenzis rkrenzis changed the title Terraform_DEPLOY_AHA.tf: is_enabled deprecated in recent versions of Terraform Terraform_DEPLOY_AHA.tf: Terraform warns is_enabled deprecated May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant