pulumi-awsx icon indicating copy to clipboard operation
pulumi-awsx copied to clipboard

Change policyArns in RoleWithPolicyArgs to accept eventual types

Open flostadler opened this issue 1 year ago • 5 comments

Previously the policyArns attribute in RoleWithPolicyArgs only accepted plain types as inputs. This forced users to use workarounds like using apply in order to configure policies created in the same pulumi program. This PR changes the policyArns attribute from a plain string array to an nested Input array (Input<Input<string>[]>) to allow users to pass the whole list as well as individual elements as eventual types.

Fixes https://github.com/pulumi/pulumi-awsx/issues/1197

flostadler avatar Apr 24 '24 13:04 flostadler

@t0yv0 You're absolutely correct about the breaking changes. I had started a thread about this on the original issue after I noticed it (sorry for not updating the PR yet!): https://github.com/pulumi/pulumi-awsx/issues/1197#issuecomment-2075380330

I'm thinking about adding a new parameter and deprecating the old one, do you have any other ideas to add this quality of life improvement without causing pain for other users?

flostadler avatar Apr 24 '24 16:04 flostadler

Since examples/tests aren't changing looks like this may not be under test yet, would it be possible to add a quick end-to-end example using this?

t0yv0 avatar Apr 24 '24 16:04 t0yv0

Re: slightly breaking changes like this, I need a reminder CC @mjeffryes on what our breaking change policy is here. It sounds like change is not breaking for TypeScript which may account for most of the user base. I agree with you that if we're strict on breaking changes then a new added property is a good alternative.

t0yv0 avatar Apr 24 '24 16:04 t0yv0

Since examples/tests aren't changing looks like this may not be under test yet, would it be possible to add a quick end-to-end example using this?

Yes for sure!

flostadler avatar Apr 24 '24 17:04 flostadler

We're planning this for the next major version upgrade. Closing the PR for now, we can pick it up again once we're working on the next major version

flostadler avatar May 08 '24 09:05 flostadler