Introduction
This article provides step-by-step guidance for troubleshooting terraform runs failures related to the error:
"Unsupported block type" — specifically when encountering the message: "Blocks of type 'inference_accelerator' are not expected here."
This issue typically occurs when the inference_accelerator
block is used in a resource that does not support it, or when an incompatible provider version is being used.
Prerequisites
- Terraform Version: Any (the issue is provider-specific)
-
AWS Provider Version:
6.0.0
and later
Cause
The following attribute has been deprecated in AWS provider version 6.0.0
and later, which is why you're encountering "Unsupported block type" errors:
- The attribute
inference_accelerator
has been deprecated from theaws_ecs_task_definition
resource.
As this attributes is no longer supported in the newer provider versions, their usage leads to the errors observed in your configuration.
Version
6.0.0
of the AWS provider for Terraform is a major release and includes changes that you need to consider when upgrading. So here is the guide - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-6-upgrade#removed-provider-arguments that outlines all the changes (including all the deprecated arguments for resources) that have been introduced with this version and later.
Solutions:
To resolve the "unsupported argument" errors, we have two options:
- Pin the AWS Provider to the last Supported 5.x Version
Since these attributes are no longer supported in version 6.0.0
and above, you can pin the AWS provider to version 5.99.1
, where they are still valid. This allows your configuration to work without modification.
Update your terraform
block as follows:
terraform { required_providers { aws = { source = "hashicorp/aws" version = "= 5.99.1" } } }
2. Update Your Configuration for Provider 6.0.0 and Above
If you'd prefer to continue using version 6.0.0
or later, you’ll need to modify your Terraform code to remove or replace deprecated attributes. Specifically, review and update the following resources:
-
aws_ecs_task_definition
– removeinference_accelerator
After making the necessary updates to your configuration, re-run terraform plan
or apply
to proceed with the deployment.
Additional Information
- Terraform AWS Provider Version 6 Upgrade Guide
- If you're still experiencing issues, please contact HCP Terraform Support by submitting a ticket through our support portal