https://pulumi.com logo
#golang
Title
# golang
i

important-appointment-55126

08/28/2020, 2:08 PM
The basic structure for how to create a secret seems covered in the reference docs at least https://www.pulumi.com/docs/reference/pkg/kubernetes/core/v1/secret/
r

red-area-47037

08/28/2020, 4:11 PM
thanks, as I am not too familiar with Golang so far I struggle a bit with the syntax. e.g. how to provide SecretArgs / Data for the
Copy code
NewSecret(...)
call.
i

important-appointment-55126

08/28/2020, 4:29 PM
i haven’t used pulumi with kubernetes, so there may be more arguments required here, but something like
Copy code
secret, err := core.NewSecret(ctx, "my-secret", &core.SecretArgs{
                        Data: pulumi.StringMap{
                                "key1": pulumi.String("Secret i want to store"),
                        },
                })
assuming you’ve imported the packages as
Copy code
import (
        core "<http://github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/core/v1|github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/core/v1>"
        "<http://github.com/pulumi/pulumi/sdk/v2/go/pulumi|github.com/pulumi/pulumi/sdk/v2/go/pulumi>"
)
r

red-area-47037

08/28/2020, 4:42 PM
👍
worked my way through to the same point, but I think I am getting more familiar 😉
thx Gareth
Are errors in Pulumi typed so I can work with
<http://errors.Is|errors.Is>()
 &
<http://errors.As|errors.As>()
i

important-appointment-55126

08/28/2020, 4:54 PM
not for the most part, no 😞
3 Views