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

Too easy to format var.aws_ami_filter incorrectly in CLI prompt #13

Open
codecudi opened this issue Sep 29, 2023 · 2 comments
Open

Too easy to format var.aws_ami_filter incorrectly in CLI prompt #13

codecudi opened this issue Sep 29, 2023 · 2 comments

Comments

@codecudi
Copy link
Contributor

codecudi commented Sep 29, 2023

Expected Behavior

terraform plan (or destroy) initiates a CLI prompt for inputs like aws_ami_filter. This input should write to var.aws_ami_filter.

Current Behavior

It's too easy to input a value for aws_ami_filter that isn't formatted correctly. This results in the following error.

Failure Information (for bugs)

│ Error: Missing expression
│ 
│   on <value for var.aws_ami_filter> line 1:
│   (source code not available)
│ 
│ Expected the start of an expression, but found the end of the file.

│ Error: No value for required variable
│ 
│   on variables.tf line 43:
│   43: variable "aws_ami_filter" {
│ 
│ The root module input variable "aws_ami_filter" is not set, and has no default value. Use a -var or -var-file command line argument to provide a value for this variable.

Steps to Reproduce

  1. terrform init
  2. terraform plan (or terraform destroy)
  3. enter CLI prompt inputs. For aws_ami_filter input rubrik-mp-cc-7* (See comment below)
  4. this error is observed

Context

  • Version of project: v1.3.0
  • Version of dependencies: Cf. terraform.lock.hcl below
  • operating system: MacOS Ventura: Version 13.6

terraform.lock.hcl

# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.

provider "registry.terraform.io/hashicorp/aws" {
  version     = "5.18.1"
  constraints = ">= 3.29.0, >= 4.21.0"
  hashes = [
    "h1:UnRmJovm3pvTBTX8LLMMYmSwlKRglKWOE7BNefrSdBE=",
    "zh:0e4ff0c26ebf7de4068aabcfecbf554d02455a31310aa52ac78ac34a6d361317",
    "zh:0eb9babaf34e622745d7bc677536b6703e8c82097e21ce0bccaf4e7c8d9cdf9f",
    "zh:1bab72da64d11f602604d0c41b41b1c582d1d3a83aef12e2c1e3dfebe5f6ad25",
    "zh:3277b809b262d11c112166dfc7347e030a52c25eddbf76a0990a559875ce59c1",
    "zh:385870d91450c8471cfeb79ac9bf7b1ac7a38b017bd9b8914865021a722cfaba",
    "zh:56f5497b6c77e41675eeb36e3ef9a6e529ebf2c9c38d2dfc4ecdba50728a2152",
    "zh:5fa032c0936fb218da1f92bef06b1dc227a1fea9b5aeb4af7bd40413f9a60339",
    "zh:7875e3d9f9c2b0ab809e71cae3523b03322330989bd43738848fa12b8250ff1b",
    "zh:90b5a5385d32558549cd374bd1c83d11d5f33221569d5ac3377650e73ffb40e9",
    "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
    "zh:9fc95889eb4d54694d46eb36522a73b55813a82b8eb899bb0c7fa23b209353be",
    "zh:c3da85af9a91b3d4cded0af72498fee48e2261154b09838c1c056f6bfe19a232",
    "zh:edf11baf4d6bcaae9100ae1fa3b0d6f6dee5d8f9be10840c5fa85284fa871362",
    "zh:edf9f745580e65f28b3fef529b75a672ec008cfe98604704160f151224673729",
    "zh:f8d2d2bba1b8b3c7885e743e67beddf7045ee4d14048d50c5769574db4b25680",
  ]
}

provider "registry.terraform.io/hashicorp/time" {
  version = "0.9.1"
  hashes = [
    "h1:UHcDnIYFZ00uoou0TwPGMwOrE8gTkoRephIvdwDAK70=",
    "zh:00a1476ecf18c735cc08e27bfa835c33f8ac8fa6fa746b01cd3bcbad8ca84f7f",
    "zh:3007f8fc4a4f8614c43e8ef1d4b0c773a5de1dcac50e701d8abc9fdc8fcb6bf5",
    "zh:5f79d0730fdec8cb148b277de3f00485eff3e9cf1ff47fb715b1c969e5bbd9d4",
    "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
    "zh:8c8094689a2bed4bb597d24a418bbbf846e15507f08be447d0a5acea67c2265a",
    "zh:a6d9206e95d5681229429b406bc7a9ba4b2d9b67470bda7df88fa161508ace57",
    "zh:aa299ec058f23ebe68976c7581017de50da6204883950de228ed9246f309e7f1",
    "zh:b129f00f45fba1991db0aa954a6ba48d90f64a738629119bfb8e9a844b66e80b",
    "zh:ef6cecf5f50cda971c1b215847938ced4cb4a30a18095509c068643b14030b00",
    "zh:f1f46a4f6c65886d2dd27b66d92632232adc64f92145bf8403fe64d5ffa5caea",
    "zh:f79d6155cda7d559c60d74883a24879a01c4d5f6fd7e8d1e3250f3cd215fb904",
    "zh:fd59fa73074805c3575f08cd627eef7acda14ab6dac2c135a66e7a38d262201c",
  ]
}

provider "registry.terraform.io/hashicorp/tls" {
  version     = "4.0.4"
  constraints = ">= 3.4.0"
  hashes = [
    "h1:Wd3RqmQW60k2QWPN4sK5CtjGuO1d+CRNXgC+D4rKtXc=",
    "zh:23671ed83e1fcf79745534841e10291bbf34046b27d6e68a5d0aab77206f4a55",
    "zh:45292421211ffd9e8e3eb3655677700e3c5047f71d8f7650d2ce30242335f848",
    "zh:59fedb519f4433c0fdb1d58b27c210b27415fddd0cd73c5312530b4309c088be",
    "zh:5a8eec2409a9ff7cd0758a9d818c74bcba92a240e6c5e54b99df68fff312bbd5",
    "zh:5e6a4b39f3171f53292ab88058a59e64825f2b842760a4869e64dc1dc093d1fe",
    "zh:810547d0bf9311d21c81cc306126d3547e7bd3f194fc295836acf164b9f8424e",
    "zh:824a5f3617624243bed0259d7dd37d76017097dc3193dac669be342b90b2ab48",
    "zh:9361ccc7048be5dcbc2fafe2d8216939765b3160bd52734f7a9fd917a39ecbd8",
    "zh:aa02ea625aaf672e649296bce7580f62d724268189fe9ad7c1b36bb0fa12fa60",
    "zh:c71b4cd40d6ec7815dfeefd57d88bc592c0c42f5e5858dcc88245d371b4b8b1e",
    "zh:dabcd52f36b43d250a3d71ad7abfa07b5622c69068d989e60b79b2bb4f220316",
    "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c",
  ]
}

provider "rubrikinc/rubrik/rubrik" {
  version = "2.3.0"
  hashes = [
    "h1:x/02eC30tDDfFGrkBT9vmLPih/3cB8WstGE3o0vV+B8=",
  ]
}

@codecudi codecudi changed the title Unable to read/write var.aws_ami_filter Ambiguous CLI prompt for var.aws_ami_filter Sep 29, 2023
@codecudi codecudi changed the title Ambiguous CLI prompt for var.aws_ami_filter Unable to write var.aws_ami_filter in CLI prompt Sep 29, 2023
@codecudi
Copy link
Contributor Author

codecudi commented Sep 29, 2023

This is caused by a bad input for var.aws_ami_filter, e.g.

  • rubrik-mp-cc-7*
  • 'rubrik-mp-cc-7*'
  • "rubrik-mp-cc-7*"
  • ['rubrik-mp-cc-7*']
  • [rubrik-mp-cc-7*]

will all throw, because an input like ["rubrik-mp-cc-7*"] is expected.

Solution:

  • I'll update the description in variables.tf to reflect this format
  • I'll also see what I can do to format inputs correctly to accommodate this range of inputs

@codecudi codecudi changed the title Unable to write var.aws_ami_filter in CLI prompt Too easy to mis-format var.aws_ami_filter in CLI prompt Sep 29, 2023
@codecudi codecudi changed the title Too easy to mis-format var.aws_ami_filter in CLI prompt Too easy to format var.aws_ami_filter incorrectly in CLI prompt Sep 29, 2023
@DamaniN
Copy link
Collaborator

DamaniN commented Sep 29, 2023

I've updated the examples in the README.md file under dcf7b87 and the quick-start.md file under 97ae037 as part of the fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants