You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating an efs and assigning a security group, the modules throws exception
# ===================================================== ## - - EFS and allow access from Instances - - - ## ===================================================== #module"efs" {
source="cloudposse/efs/aws"version="~> 0.32"region=var.efs_regionvpc_id=module.fetch_existing_infra.vpc_base_idsubnets=module.fetch_existing_infra.target_private_subnetsencrypted=trueefs_backup_policy_enabled=trueassociated_security_group_ids=[module.efs_security_group.id]
create_security_group=false
}
module"efs_security_group" {
source="cloudposse/security-group/aws"name="${var.system_tag}_efs_security_group"security_group_name=["${var.system_tag}_efs_security_group"]
security_group_description="Security Group for EFS for ${var.system_tag} hosts"vpc_id=module.fetch_existing_infra.vpc_base_idrules=[
{
type ="ingress"
from_port = var.efs_port
to_port = var.efs_port
protocol ="TCP"
source_security_group_id = module.ec2_security_group.security_group_id
description ="Allow EC2 instances to get access on EFS over port ${var.efs_port}"
}
]
}
The exception:
╷
│ Error: Error in function call
│
│ on .terraform/modules/efs/main.tf line 44, in resource "aws_efs_mount_target""default":
│ 44:sort(concat(
│ 45: [module.security_group.id],
│ 46: var.associated_security_group_ids
│ 47: ))
│ ├────────────────
│ │ module.security_group.id is null
│ │ var.associated_security_group_ids is empty list of string
│
│ Call to function "sort" failed: given list element 0 is null; a nullstring cannot be sorted.
╵
╷
│ Error: Error in function call
│
│ on .terraform/modules/efs/main.tf line 44, in resource "aws_efs_mount_target""default":
│ 44:sort(concat(
│ 45: [module.security_group.id],
│ 46: var.associated_security_group_ids
│ 47: ))
│ ├────────────────
│ │ module.security_group.id is null
│ │ var.associated_security_group_ids is empty list of string
│
│ Call to function "sort" failed: given list element 0 is null; a nullstring cannot be sorted.
The text was updated successfully, but these errors were encountered:
* fix security group issue when security_group is null
* fix security group issue when security_group is null
* return back the initial example
Co-authored-by: Dragan Dragicevic <dragan.dragicevic@gls-itservices.com>
Found a bug? Maybe our Slack Community can help.
Describe the Bug
Creating an efs and assigning a security group, the modules throws exception
The exception:
The text was updated successfully, but these errors were encountered: