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

azurerm_template_deployment fails to pass "array" type parameters properly #11085

Closed
rtyler opened this issue Jan 7, 2017 · 5 comments
Closed

Comments

@rtyler
Copy link

rtyler commented Jan 7, 2017

Terraform Version

v0.8.0

Affected Resource(s)

  • azurerm_template_deployment

Terraform Configuration Files

Consider the an ARM template with an "array" parameter, e.g.:

{
    "$schema": "http://schemas.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "documentDBs": {
            "type": "array"
        }
    },
resource "azurerm_template_deployment" "thing" {
    name                = "a-big-parameterized-arm-template"
    resource_group_name = "${azurerm_resource_group.things.name}"
    parameters          = {
        documentDBs = [
            "github-events",
        ],
    }
    deployment_mode     = "Incremental"
    template_body       = "${file("./arm_templates/the-template.json")}"
}

Output

Error running plan: 1 error(s) occurred:

* parameters: 1 error(s) decoding:

* '[documentDBs]' expected type 'string', got unconvertible type '[]interface {}'

Expected Behavior

I would have expected the array to be marshalled through to the template properly.
What should have happened?

@pearcec
Copy link
Contributor

pearcec commented Apr 21, 2017

Any possible workarounds? I am working on automating the Protection of a VM. Perhaps taking a string value from terraform and creating an array with it inside json?

@phekmat
Copy link
Contributor

phekmat commented Apr 21, 2017

Perhaps taking a string value from terraform and creating an array with it inside json?

I'm using vars with template_files in a few places to generate the ARM template with the array/object values baked in. Unfortunately, this doesn't work for more complex scenarios like referencing a Key Vault secret, since that has to be in the parameters file instead of the main template.

@jkalwar
Copy link

jkalwar commented Aug 24, 2018

I have a similar issue , unable to pass arrays as parameters in azurerm_template_deployment , do we have a solution for this issue ?

@aykay76
Copy link

aykay76 commented Dec 9, 2019

We also have a requirement for this.

@ghost
Copy link

ghost commented Dec 10, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Dec 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants