polite-napkin-90098
09/30/2025, 6:14 PMlittle-cartoon-10569
09/30/2025, 6:16 PMpolite-napkin-90098
09/30/2025, 6:16 PMDiagnostics:
aws:cognito:UserPoolClient (test-cognito-client):
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `aws` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
warning: aws:cognito/userPoolClient:UserPoolClient resource 'test-cognito-client' has a problem: Missing required property 'userPoolId'
Resources:
= 1 to importlittle-cartoon-10569
09/30/2025, 6:16 PMbut you will need to edit the generated code after copying it into your program.
polite-napkin-90098
09/30/2025, 6:17 PM{
"urn": "urn:pulumi:test-cognito::infra-cognito::aws:cognito/userPoolClient:UserPoolClient::test-cognito-client",
"custom": true,
"id": "us-east-2_M8CtVEMCW5/5vkag2eve0jed2vq64r35gk7nt",
"type": "aws:cognito/userPoolClient:UserPoolClient",
"parent": "urn:pulumi:test-cognito::infra-cognito::pulumi:pulumi:Stack::infra-cognito-test-cognito",
"protect": true,
"provider": "urn:pulumi:test-cognito::infra-cognito::pulumi:providers:aws::AWSprovider::82869575-27a3-4ec1-8ee6-f75ec7092a8b",
"created": "2025-09-30T17:46:22.247602892Z",
"modified": "2025-09-30T17:46:22.247602892Z"
}polite-napkin-90098
09/30/2025, 6:17 PMlittle-cartoon-10569
09/30/2025, 6:17 PMlittle-cartoon-10569
09/30/2025, 6:17 PMimport opt? Or did you use pulumi import?polite-napkin-90098
09/30/2025, 6:18 PMpulumi import -s test-cognito --provider urn:pulumi:test-cognito::infra-cognito::pulumi:providers:aws::AWSprovider aws:cognito/userPoolClient:UserPoolClient test-cognito-client us-east-2_M8ABCDEF/5vkag2eabcdefghij64r35gk7ntpolite-napkin-90098
09/30/2025, 6:18 PMpolite-napkin-90098
09/30/2025, 6:19 PMlittle-cartoon-10569
09/30/2025, 6:19 PMpulumi import does two things: creates the code, and creates the state that links the code with the resource in AWS. But if you already have the code, then you don't want that. Instead, you want just the import opt, which creates the state without the code.polite-napkin-90098
09/30/2025, 6:19 PMpolite-napkin-90098
09/30/2025, 6:19 PMpolite-napkin-90098
09/30/2025, 6:19 PMlittle-cartoon-10569
09/30/2025, 6:19 PMpulumi import created into your code?polite-napkin-90098
09/30/2025, 6:19 PMlittle-cartoon-10569
09/30/2025, 6:20 PMlittle-cartoon-10569
09/30/2025, 6:20 PMpulumi preview diff tells youlittle-cartoon-10569
09/30/2025, 6:20 PMlittle-cartoon-10569
09/30/2025, 6:20 PMimport opt, or don't write the code and use pulumi import.little-cartoon-10569
09/30/2025, 6:21 PMpolite-napkin-90098
09/30/2025, 6:22 PMlittle-cartoon-10569
09/30/2025, 6:22 PMOnce a resource is successfully imported, remove the import option because Pulumi is now managing the resource.
polite-napkin-90098
09/30/2025, 6:22 PMlittle-cartoon-10569
09/30/2025, 6:22 PMpolite-napkin-90098
09/30/2025, 6:24 PMpulumi refresh -s test-cognito --target urn:pulumi:test-cognito::infra-cognito::aws:cognito/userPoolClient:UserPoolClient::test-cognito-client
is says:
Previewing refresh (test-cognito):
Type Name Plan
pulumi:pulumi:Stack infra-cognito-test-cognito
- āā aws:cognito:UserPoolClient test-cognito-client delete
Resources:
- 1 to delete
i.e. the resource in the stack isn't really linked to any real infra so it wants to delete the resource from the stackpolite-napkin-90098
09/30/2025, 6:25 PMlittle-cartoon-10569
09/30/2025, 7:21 PMpulumi refresh. Then everything is sorted.little-cartoon-10569
09/30/2025, 7:22 PMpolite-napkin-90098
10/08/2025, 8:16 PM}, {provider: provider, import: "us-east-2_M8CtVEMCW5/5vkagabcdefgh2vq64r35gk7nt"});
for the user pool client but it still gives me a warning:
warning: previously-imported resources that still specify an ID may not be replaced; please remove the `import` declaration from your program
and the preview says it will replace the UserPoolClient.
When I look at the --diff it says that it will add parameters to the client such as:
+ refreshTokenValidity : 30
+ region : "us-east-2"
+ supportedIdentityProviders : [
+ [0]: "COGNITO"
+ [1]: "Google"
]
+ tokenValidityUnits : {
+ accessToken : "days"
+ idToken : "days"
+ refreshToken: "days"
}
but when I look in AWS those parameters are already set to those values in the existing client, the one it says it will replace.
I do not wish to break my currently working user pool so I am not going to run the up.
Can someone please fix this bug?little-cartoon-10569
10/08/2025, 8:21 PMpulumi up say that this is a delete and create, or a delete-replace? If it is a delete-replace, does it say which property is causing the replacement?
You may need to inspect the state file closely to figure out why Pulumi isn't detecting that the two resources aren't in fact the same resource. If you have a paid Pulumi subscription with support, I recommend contacting them and asking for help.polite-napkin-90098
10/08/2025, 8:36 PM+- āā aws:cognito:UserPoolClient test-cognito-client replace [diff: +accessTokenValidity,allowedOauthFlows,allowedOauthFlowsUserPoolClient,allowedOauthScopes,callbackUrls,enablePropagateAdditionalUserContextData,enableTokenRevocation,explicitAuthFlows,idTokenValidity,name,preventUserExistenceErrors,readAttributes,refreshTokenValidity,region,supportedIdentityProviders,tokenValidityUnits,userPoolId,writeAttributes]; 1 warning
the replace is purple and the diff elements are all green. I think that is a delete replace, but I'm not sure which of the elements causes the replacement.little-cartoon-10569
10/08/2025, 8:40 PMpolite-napkin-90098
10/08/2025, 8:41 PMpolite-napkin-90098
10/08/2025, 8:41 PMpolite-napkin-90098
10/08/2025, 8:43 PMlittle-cartoon-10569
10/08/2025, 8:44 PMpulumi state delete.
⢠Run pulumi up again to re-import with everything.little-cartoon-10569
10/08/2025, 8:44 PMpolite-napkin-90098
10/08/2025, 8:45 PMlittle-cartoon-10569
10/08/2025, 8:45 PMpolite-napkin-90098
10/08/2025, 8:45 PMpolite-napkin-90098
10/10/2025, 3:53 PMaws:cognito:UserPoolClient (test-cognito-client):
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `aws` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
warning: aws:cognito/userPoolClient:UserPoolClient resource 'test-cognito-client' has a problem: Missing required property 'userPoolId'
pulumi:pulumi:Stack (infra-cognito-test-cognito):
warning: refresh operation is using an older version of package 'aws' than the specified program version: 7.7.0 < 7.8.0
Resources:
= 1 imported
7 unchanged
Duration: 4spolite-napkin-90098
10/10/2025, 3:53 PMimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test_cognito_client = new aws.cognito.UserPoolClient("test-cognito-client", {userPoolId: ""}, {
provider: provider,
protect: true,
});
Which doesn't look like it will make the fully featured client which exists in AWS.polite-napkin-90098
10/10/2025, 3:54 PM{
"urn": "urn:pulumi:test-cognito::infra-cognito::aws:cognito/userPoolClient:UserPoolClient::test-cognito-client",
"custom": true,
"id": "us-east-2_M8CtVEMCW5/5vkag2eve0jed2vq64r35gk7nt",
"type": "aws:cognito/userPoolClient:UserPoolClient",
"parent": "urn:pulumi:test-cognito::infra-cognito::pulumi:pulumi:Stack::infra-cognito-test-cognito",
"protect": true,
"provider": "urn:pulumi:test-cognito::infra-cognito::pulumi:providers:aws::AWSprovider::82869575-27a3-4ec1-8ee6-f75ec7092a8b",
"created": "2025-10-10T15:51:19.084168089Z",
"modified": "2025-10-10T15:51:19.084168089Z"
}polite-napkin-90098
10/10/2025, 3:56 PMpolite-napkin-90098
10/10/2025, 5:17 PMpolite-napkin-90098
10/10/2025, 5:19 PMpolite-napkin-90098
10/10/2025, 5:20 PM+ writeAttributes : [
+ [0]: "address"
+ [1]: "birthdate"
+ [2]: "email"
+ [3]: "family_name"
+ [4]: "gender"
+ [5]: "given_name"
+ [6]: "locale"
+ [7]: "middle_name"
+ [8]: "name"
+ [9]: "nickname"
+ [10]: "phone_number"
+ [11]: "picture"
+ [12]: "preferred_username"
+ [13]: "profile"
+ [14]: "updated_at"
+ [15]: "website"
+ [16]: "zoneinfo"
]polite-napkin-90098
10/10/2025, 5:21 PMlittle-cartoon-10569
10/12/2025, 8:09 PMup and/or refresh until Pulumi untwists its knickers. But sometimes a manual edit is required, unfortunately.