Hey Folks, how are you? I’m creating an automation...
# getting-started
g
Hey Folks, how are you? I’m creating an automation API in Go and to test local, I’m trying to use LocalStack S3, but it’s not working. Can anyone help me? Endpoint handler function:
Copy code
func CreateHandler(w http.ResponseWriter, req *http.Request) {
	w.Header().Set("Content-Type", "application/json")
	var createReq CreatePolicyReq
	err := json.NewDecoder(req.Body).Decode(&createReq)
	if err != nil {
		w.WriteHeader(400)
		fmt.Fprintf(w, "failed to parse create request")
		return
	}

	ctx := context.Background()

	stackName := createReq.Name
	program := services.CreateStack("gaia-test-policy", "gaia-test-role")

	opts := []auto.LocalWorkspaceOption{
		auto.Project(workspace.Project{
			Name:    tokens.PackageName(stackName),
			Runtime: workspace.NewProjectRuntimeInfo("go", nil),
			Backend: &workspace.ProjectBackend{
				URL: "<http://0.0.0.0:4566/project-gaia>",
			},
		}),
	}
Error Message:
b
can you show me the output of
pulumi whoami
?
g
Hi @billowy-army-68599, sorry for the question, I’m new to Pulumi, do you want it to run directly from the terminal or via API? If it’s local, it shows my username
b
yes from the terminal
you need to login, i know you've set the backend, but do a login first
g
Sure, I tried login but doesn’t work --’, is that correct?