TroubleshootingFix Terraform Kinesis Stream - ResourceInUseException
Fix AWS Kinesis stream name conflict errors in Terraform. Handle duplicate streams, import existing resources, shard count changes, and stream modes.
Troubleshooting
Resolve WAFv2 WebACL creation errors in Terraform. Fix invalid rule priorities, scope mismatches, and managed rule group configuration issues.

WAFInvalidParameterException when creating an aws_wafv2_web_acl means a rule or setting in the Web ACL is invalid for its scope — commonly using CLOUDFRONT scope outside us-east-1, a rule priority collision, a malformed rule statement, or a managed rule group name/vendor that doesn't exist. WAFv2 validates the entire ACL atomically, so one bad rule fails the whole resource. This guide covers the parameters WAFv2 checks and how to fix them.
Error: Error Creating WAFv2 WebACL - WAFInvalidParameterExceptionThis error typically appears during terraform apply or terraform plan when Terraform encounters a conflict or misconfiguration with the target resource.
First, verify whether the resource already exists:
# For AWS resources
aws <service> describe-<resource> --name <resource-name>
# Check Terraform state
terraform state list | grep <resource-type>If the resource exists but isn't in your state:
terraform import <resource_address> <resource_id>Review your Terraform configuration for issues:
# Ensure unique naming
resource "aws_<resource>" "example" {
name = "${var.project}-${var.environment}-<resource>"
# Add explicit dependencies if needed
depends_on = [aws_<dependency>.this]
}# Check current provider version
terraform providers
# Upgrade to latest
terraform init -upgrade# Refresh state to match actual infrastructure
terraform refresh
# Or use plan with refresh
terraform plan -refresh=trueIf the resource was manually deleted:
# Remove from state
terraform state rm <resource_address>
# Re-apply
terraform applyterraform plan before every applylifecycle blocks for critical resourcesresource "aws_<resource>" "critical" {
# ...
lifecycle {
prevent_destroy = true
create_before_destroy = true
}
}The Error Creating WAFv2 WebACL - WAFInvalidParameterException error is usually caused by resource conflicts or permission issues. By checking existing resources, fixing configuration, and keeping your state clean, you can resolve this error quickly and prevent it from recurring.
TroubleshootingFix AWS Kinesis stream name conflict errors in Terraform. Handle duplicate streams, import existing resources, shard count changes, and stream modes.
TroubleshootingFix AWS MSK cluster throttling errors in Terraform. Handle API rate limits, retry configuration, reduce parallelism, and manage long cluster creation times.
TroubleshootingFix ElastiCache cluster name conflicts in Terraform. Import existing clusters, use unique naming conventions, and handle replication group configurations.
TroubleshootingFix AWS Step Functions duplicate state machine errors in Terraform. Covers naming conflicts, import, definition updates, and versioning patterns.