pulumi / pulumi-ai

226 stars 16 forks source link

Using go and AWS gives wrong SDK version #29

Closed pierskarsenbarg closed 1 year ago

pierskarsenbarg commented 1 year ago

What happened?

When asking the chatbot to create an s3 in golang, it references the AWS SDK as version 6, which doesn't exist.

Expected Behavior

The SDK version would be v5

Steps to reproduce

Prompt: make me an s3 bucket

Resulting code:

package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        // Create an AWS S3 bucket
        bucket, err := s3.NewBucketV2(ctx, "my-bucket", nil)
        if err != nil {
            return err
        }

        // Export the bucket name
        ctx.Export("bucketName", bucket.ID())

        return nil
    })
}

Output of pulumi about

n/a

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

ringods commented 1 year ago

Similar case for Azure Native. When generating sample code in Go, the imports for Azure Native Go SDK are incorrect.

https://www.pulumi.com/ai/conversations/03f3e612-065d-4d55-89c0-b0fdd9b25b27