Skip to content

Option create_security_group can't be false currently #216

@stefanstaykov

Description

@stefanstaykov

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Setting create_security_group to false will not work as the module currently expects module.aws_security_group.id every time.

Expected Behavior

Setting create_security_group to false and associated_security_group_ids to a list of string should associate the eb environment with the selected security groups but it fails because module.aws_security_group.id can't be null.

Steps to Reproduce

Steps to reproduce the behavior:
Set:
create_security_group = false
associated_security_group_ids = ['some-string']
Run:
terraform plan

Screenshots

Error: Error in function call

│ on .terraform/modules/elastic_beanstalk_environment/main.tf line 645, in resource "aws_elastic_beanstalk_environment" "default":
│ 645: value = join(",", compact(sort(concat([module.aws_security_group.id], var.associated_security_group_ids))))
│ ├────────────────
│ │ while calling sort(list)
│ │ module.aws_security_group.id is null
│ │ var.associated_security_group_ids is list of string with 1 element

│ Call to function "sort" failed: given list element 0 is null; a null string cannot be sorted.

Environment (please complete the following information):

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

  • OS: OSX
  • Version 12.6
  • cloudposse/elastic-beanstalk-environment/aws - version 0.47.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions