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 EFS volume #231

Open
vanilla-lake opened this issue Jun 2, 2023 · 0 comments
Open

Unable to create EFS volume #231

vanilla-lake opened this issue Jun 2, 2023 · 0 comments
Labels
bug 🐛 An issue with the system

Comments

@vanilla-lake
Copy link
Contributor

Describe the Bug

When following the steps in Steps to Reproduce, we get the following output:

...
# module.app.module.ecs_alb_service_task.aws_ecs_task_definition.default[0] will be created
  + resource "aws_ecs_task_definition" "default" {
      ...
      + volume {
          + name = "test"
        }
    }
    ...

Expected Behavior

The module should add an efs_volume_configuration block to the volume block. terraform plan should output the following:

...
# module.app.module.ecs_alb_service_task.aws_ecs_task_definition.default[0] will be created
  + resource "aws_ecs_task_definition" "default" {
      ...
      + volume {
          + name = "test"

          + efs_volume_configuration {
              + file_system_id     = (known after apply)
              + root_directory     = "/"
              + transit_encryption = "ENABLED"
            }
        }
    }
    ...

Steps to Reproduce

Run terraform plan in a directory containing a main.tf file with the following content:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

variable "region" {
  type = string
}

variable "vpc_id" {
  type = string
}

data "aws_subnets" "vpc" {
  filter {
    name   = "vpc-id"
    values = [var.vpc_id]
  }
}

resource "aws_ecs_cluster" "app" {
  name = "app"
}

module "alb" {
  source  = "cloudposse/alb/aws"
  version = "1.7.0"

  name       = "alb"
  namespace  = "ecs-web-app-bug"
  subnet_ids = data.aws_subnets.vpc.ids
  vpc_id     = var.vpc_id
}

module "efs" {
  source  = "cloudposse/efs/aws"
  version = "0.34.0"

  name      = "efs"
  namespace = "ecs-web-app-bug"
  region    = var.region
  subnets   = data.aws_subnets.vpc.ids
  vpc_id    = var.vpc_id
}

module "app" {
  source  = "cloudposse/ecs-web-app/aws"
  version = "1.8.1"

  alb_security_group     = module.alb.security_group_id
  ecs_cluster_arn        = aws_ecs_cluster.app.arn
  ecs_private_subnet_ids = data.aws_subnets.vpc.ids
  name                   = "app"
  namespace              = "ecs-web-app-bug"
  vpc_id                 = var.vpc_id

  volumes = [{
    host_path = null
    name      = "test"

    docker_volume_configuration = []

    efs_volume_configuration = [{
      file_system_id          = module.efs.id
      root_directory          = null
      transit_encryption      = "ENABLED"
      transit_encryption_port = null

      authorization_config = []
    }]
  }]
}

Screenshots

No response

Environment

No response

Additional Context

No response

@vanilla-lake vanilla-lake added the bug 🐛 An issue with the system label Jun 2, 2023
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
Development

Successfully merging a pull request may close this issue.

1 participant