Error: Error modifying FMS Policy Rule: InternalErrorException

When we are trying to update the wafv2 firewall policy we are getting below error message while applying.

Error: Error modifying FMS Policy Rule: InternalErrorException: 
│ 
│   with module.FirewallManger_WAFv2_Prod_Policy.aws_fms_policy.wafv2_policy,
│   on ../../../TerraformModules/fm_policies/wafv2_policy.tf line 8, in resource "aws_fms_policy" "wafv2_policy":
│    8: resource "aws_fms_policy" "wafv2_policy" {

in the wafv2_policy.tf file the code is as given below:

resource "aws_fms_policy" "wafv2_policy" {

  name                  = var.wafv2_policy_name

  exclude_resource_tags = var.exclude_resource_tags

  remediation_enabled   = var.remediation_enabled

  resource_type_list    = [var.wafv2_resource_type_list]

  include_map {

    account   = var.aws_account_ids

  }

  security_service_policy_data {

    type = service_type

    managed_service_data = service_data

  }

}

Terraform version 1.1.0
AWS provider version 3.7.20

The same policy and resource code are working till last week. Suddenly it started failing. Any help on the above is highly appreciated.

1 Like

I am getting same issue as well on one of the policy that was working fine few weeks back.
Terraform v1.1.7
on windows_386

Error: error updating FMS Policy (a73353fb-8288-49ee-b36c-0803b48ace85): InternalErrorException: │ │ with aws_fms_policy.xxxxxx, │ on r_wafruleset.tf line 1, in resource "aws_fms_policy" "xxxxxxx": │ 1: resource "aws_fms_policy" "xxxxxxxxx" {

Hi all, thank you for reporting this issue. A fix has been implemented to retry on this system error returned from the AWS API (internal/conns: add retry handling for `InternalErrorException` when calling FMS `PutPolicy` by anGie44 · Pull Request #23952 · hashicorp/terraform-provider-aws · GitHub). This will likely land in next week’s release of the Terraform AWS Provider (v4.9.0)