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

Update EFS & ECS components to allow using EFS in ECS #979

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

Benbentwo
Copy link
Member

@Benbentwo Benbentwo commented Feb 12, 2024

what

  • ECS
    • Fix Logging Name (all containers use their own name, not the component name)
    • Expose task_exec_policy_arns_map to allow mapping a policy onto the task role
  • EFS
    • Update module
    • expose additional_security_group_rules to allow a block to define extra security groups
      - key: "fargate_efs"
        type: "ingress"
        from_port: 2049
        to_port: 2049
        protocol: "tcp"
        description: "Allow Fargate EFS Volume mounts ingress"
        cidr_blocks: ["0.0.0.0/0"]

why

ECS can use

...
        task:
          efs_component_volumes:
            - name: "acme-my-service-efs-mount"
              host_path: null
              efs_volume_configuration:
                - component: efs/my-service
                  root_directory: "/"
                  transit_encryption: "ENABLED"
                  transit_encryption_port: 2999
                  authorization_config: []
        task_exec_policy_arns_map:
          efs: arn:aws:iam::01234567890:policy/acme-plat-use2-dev-my-service

to lookup an efs Volume, and add a policy onto the task which allows EFS permissions required see bottom of step 5

Your EFS can have the allowed required ports for Fargate tasks

    efs/my-service:
      metadata:
        component: efs
      vars:
        enabled: true
        name: my-service
        hostname_template: "my-service.%[3]v"
        additional_security_group_rules:
        - key: "fargate_efs"
          type: "ingress"
          from_port: 2049
          to_port: 2049
          protocol: "tcp"
          description: "Allow Fargate EFS Volume mounts ingress"
          cidr_blocks: ["0.0.0.0/0"]

references

@Benbentwo Benbentwo requested review from a team as code owners February 12, 2024 16:45
@Benbentwo Benbentwo merged commit 807aa1d into main Feb 20, 2024
4 checks passed
@Benbentwo Benbentwo deleted the efs-ecs/update-both branch February 20, 2024 17:40
goruha pushed a commit to cloudposse-terraform-components/aws-ecs-service that referenced this pull request Nov 27, 2024
goruha pushed a commit to cloudposse-terraform-components/aws-efs that referenced this pull request Nov 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants