Skip to content

make aws_ecs_service name configurable #184

Open
@mfroembgen

Description

@mfroembgen

Describe the Feature

It would be a benefit if you cloud change the label_order for all aws_ecs_service resources.

Expected Behavior

ECS service name should be independent.

Use Case

If you parse a lot of context down to your module it will bloat your service name very quickly and make it unfriendly to read (especially inside the AWS console). Modifying the whole context isn't a solution because it would change the other resource names and tags as well which is not ideal or even not possible if you have for example multiple environments with the same service name.

Describe Ideal Solution

I would like to have a variable that allows me to modify only the name of the ecs service name.

Alternatives Considered

Alternatives to #183 could be to just introduce a variable only for the aws_ecs_service name.

Additional Context

Scenario: You have one AWS account for your SDLC(software development life cycle) in which you have an ECS cluster for each stage or environment. Your cluster name would be something like namespace-environment or namespace-environment-stage.

Current implementation

Input:

  namespace   = "test"
  environment = "sandbox1"
  stage       = "stage1"
  name        = "myservice1"
  attributes  = ["consumer"]

Result:

name = test-sandbox1-stage1-myservice1-consumer

In that case, you will have a lot of bloated prefixes that don't provide any value.

Recommended implementation

Input:

  namespace   = "test"
  environment = "sandbox1"
  stage       = "stage1"
  name        = "myservice1"
  attributes  = ["consumer"]
  ecs_service_label_order = ["name", "attributes"]

Result:

name = myservice1-consumer

In that case, you would modify the id without losing out on the tags but have a much more useful and easy-to-view name

Important
You don't want to modify the inputs in general because you will need them for other resources like aws_iam_role with there full name (id) on a multi environment or stage account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions