Skip to content

Add the ability to optionally create the role in iam.tf #26

@meundies-automation

Description

@meundies-automation

Describe the Feature

The role created in iam.tf is needed when ECS has self-managed hosts, but it is not needed when all containers are running on fargate. It is not currently possible to disable creation of the role as the creation is tied to the creation of the cluster, with local.enabled = true. I think the simplest way to do it, and maintain backward compatability is to add a new variable

varaible "create_role" { type = bool default = true }

and then in iam.tf, change the creation check to be
count = local.enabled && create_role ? 1 : 0

Expected Behavior

Role for EC2 hosts is NOT created when no EC2 hosts are expected to be provisioned for the cluster, because all containers are running on fargate.

Use Case

I would like to not create iam roles and instance profiles that will never be used.

Describe Ideal Solution

Iam roles and instance profiles are only created for use by the ECS cluster when EC2 hosts are provisioned

Alternatives Considered

No response

Additional Context

No response

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