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

Unable to create an ec2 code-deploy #6

Closed
StephenTan-TW opened this issue Oct 7, 2021 · 1 comment · Fixed by #7
Closed

Unable to create an ec2 code-deploy #6

StephenTan-TW opened this issue Oct 7, 2021 · 1 comment · Fixed by #7
Labels
bug 🐛 An issue with the system

Comments

@StephenTan-TW
Copy link
Contributor

StephenTan-TW commented Oct 7, 2021

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

I am trying to use your module for the following EC2 deployment. I get an issue when I try to use the ec2_tag_filter variable. When I run the plan, I get:

│ Error: Invalid function argument
│
│   on .terraform/modules/code-deploy-stargate-frontend/main.tf line 179, in resource "aws_codedeploy_deployment_group" "default":
│  179:         key   = lookup(ec2_tag_set.value, "key", null)
│     ├────────────────
│     │ ec2_tag_set.value is list of object with 1 element
│
│ Invalid value for "inputMap" parameter: lookup() requires a map as the first argument.
╵
╷
│ Error: Invalid function argument
│
│   on .terraform/modules/code-deploy-stargate-frontend/main.tf line 180, in resource "aws_codedeploy_deployment_group" "default":
│  180:         type  = lookup(ec2_tag_set.value, "type", null)
│     ├────────────────
│     │ ec2_tag_set.value is list of object with 1 element
│
│ Invalid value for "inputMap" parameter: lookup() requires a map as the first argument.
╵
╷
│ Error: Invalid function argument
│
│   on .terraform/modules/code-deploy-stargate-frontend/main.tf line 181, in resource "aws_codedeploy_deployment_group" "default":
│  181:         value = lookup(ec2_tag_set.value, "value", null)
│     ├────────────────
│     │ ec2_tag_set.value is list of object with 1 element
│
│ Invalid value for "inputMap" parameter: lookup() requires a map as the first argument.
╵

Expected Behavior

I expect the Plan to run!

Steps to Reproduce

Code:

module "code-deploy-stargate-frontend" {
  source    = "cloudposse/code-deploy/aws"
  version   = "0.1.1"
  delimiter = "-"
  deployment_style = {
    deployment_option = "WITHOUT_TRAFFIC_CONTROL"
    deployment_type   = "IN_PLACE"
  }
  ec2_tag_filter = [
    {
      key   = "Service"
      type  = "KEY_AND_VALUE"
      value = "test"
    },
  ]
  enabled          = true
  label_value_case = "upper"
  name             = "test"
  minimum_healthy_hosts = {
    type  = "HOST_COUNT"
    value = "1"
  }
  compute_platform            = "Server"
  service_role_arn            = "code-deploy-test"
  create_default_service_role = true
}

Screenshots

If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: OSX
  • Version Terraform 1.0.8

Additional Context

Add any other context about the problem here.

@StephenTan-TW StephenTan-TW added the bug 🐛 An issue with the system label Oct 7, 2021
@StephenTan-TW
Copy link
Contributor Author

I have created a PR which fixes this issue here: #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
1 participant