Skip to content

EC2 Instance not creating #463

@amaan-igs

Description

@amaan-igs

Description

Trying to create ec2 but module is broken

Versions

  • Module version [Required]: 6.1.4

  • Terraform version: 1.14.0

  • Provider version(s): 6.22.1 aws

Steps to reproduce the behavior:

no yes added module
module "bastion-host" {
  source  = "terraform-aws-modules/ec2-instance/aws"
  version = "6.1.4"

  name = "${local.name}-${local.bastion_host_name}"

  ami                    = local.ubuntu_ami_id
  instance_type          = var.bastion_host_instance_type
  availability_zone      = element(local.azs, 0)
  subnet_id              = element(module.vpc.public_subnets, 0)
  vpc_security_group_ids = [module.bastion-sg.security_group_id]
  create_eip             = true
  disable_api_stop       = false

  key_name = local.key_pair_name

  create_iam_instance_profile = var.create_iam_instance_profile
  iam_role_name               = "${local.name}-${local.instance_role_name}"
  iam_role_description        = "IAM role for ${local.name}-${local.bastion_host_name}-EC2-Bastion-Host"
  iam_role_policies           = var.pub1_iam_role_policies

  metadata_options = local.meta_options

  enable_volume_tags = false
  root_block_device = {
    encrypted   = true
    volume_type = "gp3"
    volume_size = 32
    tags = {
      Name = "${local.name}-${local.bastion_host_name}-root-block"
    }
  }

  tags = local.tags
}

Expected behavior

TF APPLY GIVING OUT ERROR

Actual behavior

Terminal Output Screenshot(s)

Image

TRIED GIVING REGION TO ACTUAL REGION TRIED GIVING NULL TRIED WITHOUT REGION DIDNT WORK

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions