Skip to content
Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
Close

Search

Knowledge Base

An argument named “root_block_device” is not expected here. Did you mean to define a block of type “root_block_device”?

By Laszlo Pinter
December 10, 2021 1 Min Read
0

In the Terraform script to create an AWS EC2 instance, we can specify the volume sizes. Separate arguments describe the root and data volumes. This feature enables the script to create the volumes without specifying the connection attributes in another block.

The Terraform documentation does not show the syntax, and the Terraform example at the time of writing this in GitHub is NOT correct at https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/blob/528613d4580f2c1266e87d8d24fc25bf5290fe2c/examples/complete/main.tf#L113

If the syntax is not correct get the error message:

An argument named “root_block_device” is not expected here. Did you mean to define a block of type “root_block_device”?

An argument named “ebs_block_device” is not expected here. Did you mean to define a block of type “ebs_block_device”?

The correct syntax is

resource "aws_instance" "default" {

  ami                         = "ami-0da7a37366e7ee5f0"
  instance_type               = "t3.medium"
...
  root_block_device {
      volume_type = "gp2"
      volume_size = 100
      tags = {
        Name = "my-root-block"
      }
    }

  ebs_block_device {
      device_name = "xvdf"
      delete_on_termination = true
      volume_type = "gp2"
      volume_size  = 500
    }
  ...
}

Tags:

AWSDevOpsTerraform
Author

Laszlo Pinter

Follow Me
Other Articles
Previous

A Calibre e-könyv konvertáló program rossz formátumra konvertál

Next

Cannot connect to an AWS EC2 Windows instance with WINRM

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Last Changes

  • Argument of type '(number | null)[]' is not assignable to parameter of type '(err: Error, result: QueryResult) => void' June 20, 2026
  • Cities: Skylines II Developer Mode June 20, 2026
  • How to stop the rain and snow in Cities: Skylines II June 20, 2026
  • 'CSII_MANAGEDPATH' has incorrect path(s) when building Cities: Skylines II mod June 20, 2026
  • Decompiling the Cities: Skylines II code June 20, 2026

Tags

.NET .NETcore 3Dprinting ASP.NET Core AutodeskInventor AWS C# Chef cloud DevOps Docker EntityFramework Games Git Go iOS iPad iPhone iPod Java Kubernetes Linux MacOSX MSSQL MVC Node.js Packer PowerShell Python RDS RightScale Ruby security Splunk TeamCity Terraform TestKitchen Tomcat Ubuntu Vagrant VirtualBox VisualStudio Windows WordPress Xcode

Recent Comments

  • Zengei László on MyHeritage családfa exportálása és küldése emailben
  • Raúl Castillo on DynDns update error
  • MICHAEL on Windows Media Player 12 cannot find the album information
  • Nargis on Configure Epson ET-3850 scanning on Windows 11
  • Venczelné Zemen Erika on Delta S2302 termosztát programozása

–

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright 2026 — Pinter Computing. All rights reserved.