Skip to content

Can't run terraformer on an EC2 instance with IAM role #2010

Open
@federicochiesa

Description

@federicochiesa

I'm trying to run terraformer to import our existing EC2 infrastructure from an EC2 instance. This instance has an IAM role that allows it to operate on AWS, it does have AWS CLI installed but no configuration in ~/.aws because it operates based on its role. Terraform works fine, but Terraformer gives me the following error: "aws error initializing resources in service vpc, err: failed to get shared config profile, default"

This is my main.tf file, which works with Terraform:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.16"
    }
  }

  required_version = ">= 1.2.0"
}

provider "aws" {
  region  = "eu-central-1"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions