pulumi / pulumi-aws-iam

A Pulumi Multi Language Component for working with AWS IAM resources.
Apache License 2.0
6 stars 5 forks source link

Change EKS service account args to object to support inputs/outputs #5

Closed zchase closed 1 year ago

zchase commented 1 year ago

This PR changes the shape of the EKS Service Account Inputs from a map to an array of objects. This is so that we can support inputs/outputs in the cluster name. In turn, this also fixes up the dependency issue outlined in the issue below. Notably, this does change the code from the linked issue from:

import pulumi_eks as eks
import pulumi_aws_iam as iam

cluster = eks.Cluster("example")
iam.EKSRole(
    "app-role",
    role=iam.RoleArgs(
        name=f"app-eks-role",
        policy_arns=["something-valid"],
    ),
    cluster_service_accounts={
        cluster.name: ["default:example-app"],
    },
)

To something like (note I am not a python person):

import pulumi_eks as eks
import pulumi_aws_iam as iam

cluster = eks.Cluster("example")
iam.EKSRole(
    "app-role",
    role=iam.RoleArgs(
        name=f"app-eks-role",
        policy_arns=["something-valid"],
    ),
    cluster_service_accounts=[{
        name: cluster.name,
        serviceAccounts: ["default:example-app"],
    }],
)

Fixes: https://github.com/pulumi/pulumi-aws-iam/issues/3