polite-sandwich-68547
04/20/2023, 9:00 AMpolite-sandwich-68547
04/20/2023, 9:11 AMpolite-sandwich-68547
04/20/2023, 9:11 AMpolite-sandwich-68547
04/20/2023, 9:38 AMrefined-pilot-45584
04/24/2023, 1:34 PMrefined-pilot-45584
04/24/2023, 1:34 PMalert-autumn-36186
04/25/2023, 3:04 AMcrooked-lunch-29479
04/25/2023, 6:19 PMcrooked-lunch-29479
04/25/2023, 6:20 PMfunc main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := eks.LookupCluster(ctx, &eks.LookupClusterArgs{
Name: "example",
}, nil)
if err != nil {
return err
}
ctx.Export("endpoint", example.Endpoint)
ctx.Export("kubeconfig-certificate-authority-data", example.CertificateAuthorities[0].Data)
ctx.Export("identity-oidc-issuer", example.Identities[0].Oidcs[0].Issuer)
return nil
})
}
quick-king-51158
04/25/2023, 6:25 PMpolite-sandwich-68547
04/26/2023, 8:22 AMcrtArn := config.Get(ctx, "certificate:arn")
if crtArn == "" {
return fmt.Errorf("certificate: config not found")
}
var vpcID = config.Get(ctx, "vpc:id")
if vpcID == "" {
return fmt.Errorf("vpc: config not found")
}
careful-bird-79707
04/26/2023, 11:15 AMpulumi.Input
, but the related structs defined in the package (e.g. this one) do not implement the interface.
For this reason, the example in the docs just errs.
Is there some simple way to implement pulumi.Input
for a general struct? Should I do this myself? Is this a bug?polite-sandwich-68547
04/26/2023, 3:39 PMvar doneRecords = map[pulumi.StringOutput]pulumi.StringOutput{}
for _, record := range records {
_record, err := cloudflare.NewRecord(ctx, record, &cloudflare.RecordArgs{
Name: pulumi.String(record),
ZoneId: pulumi.String("redacted"),
Type: pulumi.String("CNAME"),
Value: dnsName,
Ttl: <http://pulumi.Int|pulumi.Int>(3600),
})
if err != nil {
return err
}
doneRecords[_record.Hostname] = _record.Value
}
for k, v := range doneRecords {
pulumi.Printf("record: %v -> %v\n", k, v)
}
gifted-fall-44000
04/26/2023, 4:04 PMquick-king-51158
04/27/2023, 7:22 AMquick-king-51158
04/27/2023, 7:23 AMpolite-sandwich-68547
04/27/2023, 12:58 PMpolite-sandwich-68547
04/27/2023, 12:58 PMsalmon-account-74572
04/27/2023, 3:55 PMdefaultTags
section of https://www.pulumi.com/registry/packages/aws/installation-configuration/).delightful-camera-97029
04/28/2023, 4:41 AMbrash-painting-89833
04/28/2023, 8:41 PMbrash-painting-89833
04/29/2023, 9:36 PMpulumi.StringOutput
to base64?bitter-energy-6777
04/30/2023, 3:12 PMUp()
function, but when I call it in a test with go test
, the output isn't streamed to stdout. I'd like to be able to see live output streams as the tests run. My assumption was that the optup.ProgressStreams(os.Stdout)
would handle this, but there must be some sort of extra wiring to get this to work. Any ideas?
// Up provisions AWS infrastructure
func Up(region, instanceType string) error {
pulumiStack, ctx := configurePulumi(region, instanceType)
// Wire up our update to stream progress to stdout
stdoutStreamer := optup.ProgressStreams(os.Stdout)
// Run the update to deploy our infrastructure
if _, err := pulumiStack.Up(ctx, stdoutStreamer); err != nil {
return err
}
// Wait for ec2 instance to be ready
if err := WaitInstanceReady(region); err != nil {
return err
}
// Install k3s on ec2 instance
if err := InstallK3s(region); err != nil {
return err
}
// Copy kubeconfig from remote host to local machine
if err := GetKubeconfig(region); err != nil {
return err
}
return nil
}
bored-vr-79323
05/02/2023, 9:13 AMimport (
"<http://github.com/pulumi/pulumi-command/sdk/go/command/remote|github.com/pulumi/pulumi-command/sdk/go/command/remote>"
"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)
func InstallRke2(ctx *pulumi.Context, connection *remote.ConnectionArgs) {
...
res1, _ := remote.NewCommand(ctx, "is-rke2-server-active", &remote.CommandArgs{
Connection: connection,
Create: pulumi.String("systemctl is-active rke2-server.service"),
})
// How do I get the result of the `systemctl` command at this point?
// Do I use `ApplyT` on `res1.Stdout`?
// The command below should run only if the service is `active`
res2, _ := remote.NewCommand(ctx, "get-registration-token", &remote.CommandArgs{
Connection: connection,
Create: pulumi.String("cat /var/lib/rancher/rke2/server/node-token"),
Triggers: pulumi.All(res1.Create, res1.Stdin),
}, pulumi.DependsOn([]pulumi.Resource{res1}))
...
}
I could get the status with ApplyT
. But since it’s like a promise, should I use channels and waitgroups to get it out? I have a feeling this isn’t the way to go.
result := res1.Stdout.ApplyT(func(status string) string {
log.Println(status) // active
return status
})
log.Println(result) // {0xc0002de070}
I’ve read the command package docs and looked through all the examples but couldn’t find a solution.
How should I go about this?polite-sandwich-68547
05/04/2023, 12:47 PMpolite-sandwich-68547
05/05/2023, 8:10 AMfmt.Sprintf
and pass variables in it.
for example Pulumi creates a loggroup and I pass the log group name inside the taskdefintion.
although I find it cumbersome to maintain, is maybe a better way?polite-sandwich-68547
05/05/2023, 8:29 AMpolite-sandwich-68547
05/15/2023, 2:55 PMpulumi.StringArray
out of Pulumi.env.yaml?polite-sandwich-68547
05/15/2023, 3:15 PM[]pulumi.String
to a pulumi.StringArray
?hundreds-judge-64203
05/21/2023, 4:07 PMinfrastructure
and created a new pulumi project in that but that also creates a go.mod file and then I run into the issue of having a nested module. In my case, the go.mod file for my application code lives in the root of the project