Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed terraform array parameters serialization #219

Merged

Conversation

edgarpoce
Copy link
Contributor

Fixed Runway array parameter serialization for terraform

Summary

Runway is serializing arrays as invalid json strings using single quotes. As a result parameters are not properly recognized by terraform

Why This Is Needed

To avoid errors when passing array parameters to terraform.

What Changed

json array parameters serialization

Fixed

json array parameters serialization

How to reproduce

runway.yml

deployments:
  - modules:
      - name: module1.tf
        path: module1.tf
        parameters:
          region: us-east-1
          array:
            - foo-01
            - bar-0243
    regions:
      - us-east-1

main.tf

# Variable definitions
variable "region" {}

variable "array" {
  type = list(string)
}

# Provider and access setup
provider "aws" {
  version = "~> 2.0"
  region = var.region
}

# Data and resources
resource "aws_ssm_parameter" "foo" {
  name  = "/test/tf/array"
  type  = "StringList"
  value = join(",", var.array)
}

error

Error: Variables not allowed

  on <value for var.array> line 1:
  (source code not available)

@ITProKyle ITProKyle added the bug Something isn't working label Apr 6, 2020
@troyready troyready merged commit 8f0ee9f into rackspace:master Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants