Chase Denecke
Chase Denecke

Reputation: 327

Tflocal: unsupported argument meteringmarketplace

I'm trying to run terraform-local to test out my modules before deployment. I've run into an error when trying to run my stack locally:

Error: Unsupported argument

on localstack_providers_override.tf line 67, in provider "aws": 67: meteringmarketplace = "http://localhost:4566"

An argument named "meteringmarketplace" is not expected here.

For context, my terraform templates specify the following resources

I'm also running terraform v1.2.7 and terraform-local v1.2.7

Any idea how I might fix this error?

Upvotes: 0

Views: 648

Answers (2)

Sachin
Sachin

Reputation: 136

I was getting a similar error. Apparently my local Terraform and Terraform Local were not symlinked correctly. I installed via homebrew. So I had to run brew link --overwrite terraform-local

After that I was able to successfully run tflocal apply

Upvotes: 0

Rob
Rob

Reputation: 11

i get exactly the same error. I assume the terraform-local configurations are setting that "meteringmarketplace" which is not actually there anymore (I think it was renamed?).

A possibility is to do the local configuration directly yourself and not use terraform-local but terraform with your overwrites and let it run against localstack (https://github.com/localstack/localstack).

For an example i used the code from the terraform page:

main.tf:

provider "aws" {
  access_key                  = "mock_access_key"
  region                      = "us-east-1"
  s3_force_path_style         = true
  secret_key                  = "mock_secret_key"
  skip_credentials_validation = true
  skip_metadata_api_check     = true
  skip_requesting_account_id  = true

  endpoints {
    apigateway     = "http://localhost:4566"
    cloudformation = "http://localhost:4566"
    cloudwatch     = "http://localhost:4566"
    dynamodb       = "http://localhost:4566"
    es             = "http://localhost:4566"
    firehose       = "http://localhost:4566"
    iam            = "http://localhost:4566"
    kinesis        = "http://localhost:4566"
    lambda         = "http://localhost:4566"
    route53        = "http://localhost:4566"
    redshift       = "http://localhost:4566"
    s3             = "http://localhost:4566"
    secretsmanager = "http://localhost:4566"
    ses            = "http://localhost:4566"
    sns            = "http://localhost:4566"
    sqs            = "http://localhost:4566"
    ssm            = "http://localhost:4566"
    stepfunctions  = "http://localhost:4566"
    sts            = "http://localhost:4566"
  }
}

resource "aws_s3_bucket" "test-bucket" {
  bucket = "my-bucket"
}

If you have your localstack running with the default settings you should be able to run "terraform plan" against it.

Maybe that helps you as a workaround.

Upvotes: 1

Related Questions