Skip to content

Commit aa533cb

Browse files
authored
fix: improve backwards compatibility (#4541)
1 parent 7b99710 commit aa533cb

File tree

1 file changed

+9
-4
lines changed
  • packages/pulumi-aws/src/apps/core/cognitoIdentityProviders

1 file changed

+9
-4
lines changed

packages/pulumi-aws/src/apps/core/cognitoIdentityProviders/configure.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,15 @@ export const configureAdminCognitoFederation = (
7474
for (const idp of config.identityProviders) {
7575
const config = getIdpConfig(idp.type, userPool.output.id, idp);
7676

77-
app.addResource(aws.cognito.IdentityProvider, {
78-
name: config.providerName.toString(),
79-
config
80-
});
77+
// The idea to lowercase the provider name emerged while working on backwards compatibility issue.
78+
// Basically, in cases where a user used the OIDC provider and did not specify a name, instead of
79+
// using `OIDC` as the name, we wanted to ensure `oidc` is used. But, what I soon realized is that
80+
// by simply lowercasing the name, we can avoid the need to check for the provider type and name.
81+
// And although this will now happen for all providers, it's not a problem since Pulumi requires
82+
// names to be all lowercase anyway.
83+
const name = config.providerName.toString().toLowerCase();
84+
85+
app.addResource(aws.cognito.IdentityProvider, { name, config });
8186

8287
idpConfigs.push(config);
8388
}

0 commit comments

Comments
 (0)