https://pulumi.com logo
Title
m

most-mouse-38002

02/16/2023, 3:48 PM
Every time I try to update a stack with https://www.pulumi.com/registry/packages/aws/api-docs/iam/openidconnectprovider/ it tells me there is a diff, and then it attempt to replace it and tells me a provider with the same name already exists. I have not updated the clientIdLists at all.
├─ aws:iam:OpenIdConnectProvider  githubProvider   replace     [diff: ~clientIdLists]
b

billowy-army-68599

02/16/2023, 4:52 PM
if you check the diff, it expects them to be in a specific order
m

most-mouse-38002

02/16/2023, 4:53 PM
Oh. That explains it. Thanks 👍🏻
I have tried with
sort.Strings(clientList)
now, and the same thing happens with the diff. As expected “http” is first on the sorted list, but the state is the opposite.
~ clientIdLists: [
          ~ [0]: "<http://sts.amazonaws.com|sts.amazonaws.com>" => "<https://github.com/re>"
          ~ [1]: "<https://github.com/re>" => "<http://sts.amazonaws.com|sts.amazonaws.com>"
        ]
Also manually assigning to indexes does not appear to work, unless I sort it manually by the order Pulumi returns it from the state the second time I run the stack.
Are there any general recommendations regarding this I have missed?
I just manually ordered them for now, since Sort did the opposite of the output from state. It’ll work for now.
ClientIdLists: pulumi.StringArray{
			pulumi.String(c.ClientIdLists[1]),
			pulumi.String(c.ClientIdLists[0]),
		},