Skip to content

Cannot find module 'aws-sdk' #173

@jwatson3d

Description

@jwatson3d

Describe the Bug

Following the Terraform module for AWS Landing Zone (one component: AWS Organization).

To Reproduce

main.tf contains the following:

module "landing_zone" {
  source  = "MitocGroup/landing-zone/aws"
  version = "0.2.4"

  landing_zone_providers = {
    default = {
      account_id = var.account_id
      region     = var.region
    }
  }
  landing_zone_components = {
    landing_zone_organization = "s3://terraform-aws-landing-zone/components/landing_zone_organization/default.tfvars"
  }


  terraform_backend = {
    backend = "s3"
    bucket  = "tf-remote-state"
    key     = "landing_zone/terraform.tfstate"
    region  = "us-east-1"
    encrypt = true
    kms_key_id = "**************" 
  }
}

Executed terraform plan -out tfplan.out then terrform apply tfplan.out

Expected Behavior

An AWS Organization is created.

Screenshots

Desktop

  • Device: MacBook Pro (Intel)
  • OS: Big Sur 11.2.3
  • Browser n/a
  • Version [e.g. 22]

Additional context

My next step was to try installing globally with: npm -i -g aws-sdk with same result.

I noticed this npm warning: npm WARN saveError ENOENT: no such file or directory, open '/Users/john/package.json' so I tried the following:

cp .terraform/modules/landing_zone/package.json ~/

to place the package.json into my $HOME directory and finally the apply worked.

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