Skip to content

Cognito DeleteUser (cognitoidentityprovider) for Go/Golang #1860

Discussion options

You must be logged in to vote

I'm not sure how your project is structured, but you should not make any changes to the source files just to use the SDK.

Here is a code example:

func main() {
	cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"))
	if err != nil {
		log.Fatalf("unable to load SDK config, %v", err)
	}

	client := cognito.NewFromConfig(cfg)

	deleteUserInput := &cognito.DeleteUserInput{
		AccessToken: aws.String("AccessTokenGoesHere"),
	}
	
	_, err = client.DeleteUser(context.Background(), deleteUserInput)
	if err != nil {
		fmt.Errorf("could not create cognito user: %v", err.Error())
	}
}

If you want me to take a look at your code please paste it here in the thread

add three…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RanVaknin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants