Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Support for localstack AWS testing #519

Closed
meltingturret opened this issue Apr 12, 2023 · 1 comment
Closed

Support for localstack AWS testing #519

meltingturret opened this issue Apr 12, 2023 · 1 comment
Labels
question ruby gem unresolved Issues that were not resolved before the project was archived.

Comments

@meltingturret
Copy link

meltingturret commented Apr 12, 2023

Any thoughts on an easy way for configure terraform kitchen to converge against localstack? For verification I am using awsspec and the verifier does respond to http_proxy configuration fine but the provisioner does not.

driver:
  name: "terraform"
  variable_files:
    - testing.tfvars

provisioner:
  name: "terraform"

platforms:
  - name: "aws"

verifier:
  name: "awspec"

suites:
  - name: default
    verifier:
      #default_pattern: true
      patterns:
        - spec/**/*_spec.rb

When I run bundle exec kitchen converge aws is updated and not localstack running on http://localhost:4566.

I want to avoid adding this in the aws provider:

provider "aws" {
  endpoints {
    ec2            = "http://localhost:4566"
    s3             = "http://s3.localhost.localstack.cloud: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"
  }
}
@aaron-lane
Copy link
Collaborator

Hi @meltingturret 👋🏼

Based on the AWS provider documentation, it does not appear that there is any alternative to specifying the custom endpoints within the provider configuration. If you would like to avoid hard-coding that configuration in your main module then I suggest you create a separate test module which invokes your main module and includes the necessary provider configuration. You can override which module Kitchen-Terraform tests using the transport.root_module_directory configuration.

@aaron-lane aaron-lane added the unresolved Issues that were not resolved before the project was archived. label Oct 22, 2024
@aaron-lane aaron-lane closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question ruby gem unresolved Issues that were not resolved before the project was archived.
Projects
None yet
Development

No branches or pull requests

2 participants