I tried to write an automation api with revel fram...
# golang
I tried to write an automation api with revel framework but when I declare the variable S for new stackinlinestack, I get S as invalid type. Am i missing anything?
package controllers
import (
type ResourceNames struct {
    `RgName      string `json:"rgname"``     `StorageName string `json:"storage_name"``
type CreateReq struct {
    `StackName   string `json:"stackname"``     `ProjectName string `json:"project_name"``     
Resources   []ResourceNames
func (c App) CreateResourceGroup() revel.Result {
ctx := context.Background()
program := createRgProgram(c.rn.RgName)
s, err := auto.NewStackInlineSource(ctx, <http://c.cr|c.cr>.StackName, <http://c.cr|c.cr>.ProjectName, program)
if err != nil {
if auto.IsSelectStack404Error(err) {
return c.RenderText("stack already exists")
return c.RenderText(err.Error())
s.SetConfig(ctx, "azure.clientId", auto.ConfigValue{Value: ""})
return c.Render()
func createRgProgram(Name string) pulumi.RunFunc {
return func(ctx *pulumi.Context) error {
// our program defines a s3 website.
// here we create the bucket
resourceGroup, err := core.NewResourceGroup(ctx, "testpulumi", &core.ResourceGroupArgs{
Location: pulumi.String("westindia"),
Name:     pulumi.String(Name),
Tags: pulumi.StringMap{
"Created_By": pulumi.String(""),
"Purpose":    pulumi.String("test pulumi"),
"Start_Date": pulumi.String("16-Nov-2020"),
"End_Date":   pulumi.String("16-Jan-2020"),
if err != nil {
return err
// export the website URL
ctx.Export("resourceGroupName", resourceGroup.Name)
return nil