https://pulumi.com logo
#getting-started
Title
# getting-started
g

great-arm-54759

04/29/2022, 5:21 PM
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

billowy-army-68599

04/29/2022, 5:23 PM
can you show me the output of
pulumi whoami
?
g

great-arm-54759

04/29/2022, 5:28 PM
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

billowy-army-68599

04/29/2022, 5:29 PM
yes from the terminal
you need to login, i know you've set the backend, but do a login first
g

great-arm-54759

04/29/2022, 5:31 PM
Sure, I tried login but doesn’t work --’, is that correct?
6 Views