bland-florist-27487
07/26/2022, 8:36 AM<http://github.com/pulumi/pulumi-awsx/sdk|github.com/pulumi/pulumi-awsx/sdk>
still shows v1.0.0-testplsignore.0
as latest
on pkg.go.dev (and via go get)
Any new releases on the way? 😅cold-orange-37453
07/27/2022, 11:00 AMResources
require a slice of string ([]string) , I wan to pass some values here that I am creating in the pulumi code as well. Is there any way to do this ? I can just put the string value there since resource arn format is pre determined, but is there any better way ?prehistoric-sandwich-7272
07/27/2022, 1:19 PMValues: pulumi.Map{
"controller": pulumi.Map{
"resources": pulumi.MapArray{pulumi.Map{
"limits": pulumi.MapArray{pulumi.Map{
"cpu": pulumi.String(values.Controller.Limits.CPU),
"memory": pulumi.String(values.Controller.Limits.Memory),
}},
"requests": pulumi.MapArray{pulumi.Map{
"cpu": pulumi.String(values.Controller.Requests.CPU),
"memory": pulumi.String(values.Controller.Requests.CPU),
}},
}},
"replicas": <http://pulumi.Int|pulumi.Int>(values.ReplicaCount),
},
},
and getting the error:
2022/07/27 16:14:41 warning: cannot overwrite table with non table for karpenter.controller.resources (map[limits:map[cpu:1 memory:1Gi] requests:map[cpu:1 memory:1Gi]])
lively-table-10226
07/29/2022, 1:11 PMhappy-football-3560
07/29/2022, 7:51 PMClusterInitScript: { S3: {
?
(also I'm very new to Pulumi - I feel like I might be missing something obvious)
_, err := databricks.NewCluster(ctx, "my-cluster", &databricks.ClusterArgs{
InitScripts: []databricks.ClusterInitScriptArgs{
{
S3: &databricks.ClusterInitScriptS3{
Destination: "<s3://path/to/script.sh>",
},
},
},
}
happy-football-3560
08/01/2022, 8:12 PMfunc main() {
pulumi.Run(func(ctx *pulumi.Context) error {
conf := config.New(ctx, "")
INIT_SCRIPT := config.Get("init_script_path")
cluster, err := databricks.NewCluster(ctx, "example", &databricks.ClusterArgs{
// logic here to only include if INIT_SCRIPT has content //
InitScripts: databricks.ClusterInitScriptArray{
databricks.ClusterInitScriptArgs{
S3: databricks.ClusterInitScriptS3Args{
Destination: pulumi.String("something"),
},
},
},
// END INCLUDE AREA //
})
if err != nil {
return fmt.Errorf("error creating cluster: %w", err)
}
ctx.Export("clusterName", cluster.ClusterName)
return nil
})
}
prehistoric-sandwich-7272
08/03/2022, 1:59 PMpanic: applier must have 1 input parameter assignable from []acm.CertificateDomainValidationOption
the code is:
route53Record, errRoute53 := route53.NewRecord(ctx, fmt.Sprintf("%s-%s-acm-dns-record-validation", values.Name, values.DomainName), &route53.RecordArgs{
Name: appCert.DomainValidationOptions.ApplyT(func(name acm.CertificateDomainValidationOptionOutput) pulumi.StringPtrOutput {
return name.ResourceRecordName()
}).(pulumi.StringOutput),
}
prehistoric-sandwich-7272
08/03/2022, 5:40 PMingress, errGetIngress := networkingv1.GetIngress(ctx, values.Name, pulumi.IDInput(grafana.Status.Namespace()), &state)
but I get the syntax error: Cannot convert an expression of the type 'pulumi.StringPtrOutput' to the type 'pulumi.IDInput'
fancy-library-39649
08/03/2022, 10:05 PMpulumi plugin install resource aws 5.10.0
and do a pulumi up
, Pulumi will download v5.4.0 of the plugin because of some existing resources that were created with that old version, even though the old version was uninstalled from the system. How do I get Pulumi to upgrade the resources to start using 5.10.0?sparse-intern-71089
08/04/2022, 7:14 AMcold-orange-37453
08/04/2022, 10:00 AMcold-orange-37453
08/05/2022, 11:50 AMbrainy-furniture-43093
08/05/2022, 6:07 PMGOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w" -tags lambda.norpc -o build/bootstrap
And then I zip it using Pulumi's NewAssetArchive
Code: pulumi.NewAssetArchive(map[string]interface{}{
"bootstrap": pulumi.NewFileAsset("../onboarding/cmd/onboarding/build/bootstrap"),
"Makefile": pulumi.NewFileAsset("../onboarding/cmd/onboarding/build/Makefile"),
}),
And my Makefile contains
build-Onboarding:
cp ./bootstrap $(ARTIFACTS_DIR)/.
But for some reason it's like my Makefile doesn't execute then the bootstrap file stays in some root folder.
Any ideas here? Thank youlively-table-10226
08/08/2022, 10:08 AMUS-EAST1+US-WEST1
, and i tried to reapply the code once again. Ideally it should not do anything. But it says location changed from US
to US-EAST1+US-WEST1
and trying to delete the bucket and recreate it. Can someone help me to resolve this.mammoth-country-64756
08/10/2022, 10:52 AMpulumi.IgnoreChanges([]string{"kube-system/aws-load-balancer-tls"}),
and
pulumi.IgnoreChanges([]string{"kubernetes:core/v1:Secret"})
Full code:
_, err = helm.NewChart(ctx, "load-balancer-controller", helm.ChartArgs{
Chart: pulumi.String("aws-load-balancer-controller"),
Version: pulumi.String("1.4.3"),
Namespace: pulumi.String(lbcNamespace),
FetchArgs: helm.FetchArgs{
Repo: pulumi.String("<https://aws.github.io/eks-charts>"),
},
Values: pulumi.Map{
"clusterName": eksCluster.Name,
"serviceAccount": pulumi.Map{
"create": pulumi.BoolPtr(false),
"name": lbcServiceAccount.Metadata.Name(),
},
},
}, pulumi.Provider(k8sProvider),
pulumi.IgnoreChanges([]string{"kubernetes:core/v1:Secret"}),
)
None worked. Any help welcome 🙇bored-spoon-83710
08/11/2022, 3:22 PMhappy-football-3560
08/11/2022, 3:49 PMAWS_INSTANCE_KEY := conf.RequireSecret("aws_key")
...
updatePythonCmd, err := remote.NewCommand(ctx, "updatePythonCmd", &remote.CommandArgs{
Connection: &remote.ConnectionArgs{
Host: instance.PrivateIp,
Port: pulumi.Float64(22),
User: pulumi.String("ubuntu"),
PrivateKey: AWS_INSTANCE_KEY,
},
Create: pulumi.String("(sudo apt -y update || true);" +
"(sudo apt-get -y upgrade);" +
"(sudo apt install -y python3-pip)\n"),
})
I tried setting the key in two ways
1. by just passing the key in - though I kept running into issues reading the multiple lines from the command line
2. with
pulumi config set --path --secret aws_key
/path/to/key
The error I get is error: ssh: no key found
The instance is created just before this remote command and I do have the correct key because I can ssh to the instance using it. I'm think I'm missing something with how to read the key into the remote command or?
Really appreciate any tips.elegant-zoo-39359
08/12/2022, 2:28 PMIntPtrOutput
? I've configured a helper function to take an IntPtrInput
and then want to use ApplyT
on this value to conditionally output a data structure if it is not nil, but the ApplyT
fails with a NPE if it is nil. e.g. the following will fail if size
is a IntPtrInput
that is nil (at ToIntPtrOutput()
). I could check for nil, but I don't think that would not work if size
is an IntPtrOutput
(because only its applied value would be nil).
res := size.ToIntPtrOutput().ApplyT(
func(size *int) *ec2.LaunchTemplateBlockDeviceMapping {
Is there a nice way to generically handle this? I can use pulumi.All
but that does not seem quite as elegant:
res := pulumi.All(size).ApplyT(
func(args []interface{}) []ec2.LaunchTemplateBlockDeviceMapping {
if args[0] != nil {
size := args[0].(*int)
chilly-jordan-84053
08/14/2022, 5:11 PMflaky-arm-38472
08/17/2022, 3:21 AM_, err = ec2.NewRoute(ctx, "my-route", &ec2.RouteArgs{
RouteTableId: routeTable.ID(),
DestinationCidrBlock: pulumi.String("0.0.0.0/0"),
GatewayId: pulumi.String("igw-xxxf0axxx"),
})
On the GatewayId field, to have the type T or accept a generic type?.
I am trying to don't repeat a lot of the same definitions to create routes. Some of my routes require TransitGatewayId or NatGatewayId instead. Do I have to create every single route repeating all the code and changing that field one by one?alert-autumn-36186
08/17/2022, 3:30 AMhelm install "$infra" --values inf.yaml
Can only use the "value" function?
package main
import (
"<http://github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/helm/v3|github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/helm/v3>"
"<http://github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/yaml|github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/yaml>"
"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err = helm.NewChart(ctx, "sql-data", helm.ChartArgs{
Chart: pulumi.String("sql-data"),
APIVersions: nil,
// The optional namespace to install chart resources into.
Namespace: pulumi.String("eshop"),
// Overrides for chart values.
Values: pulumi.Map{
".Values.inf.sql.host": pulumi.String("sql-data-eshop"),
},
}
most-mouse-38002
08/19/2022, 1:53 PMApplyT()
function for every time we need a value?bitter-kite-21926
08/21/2022, 12:50 PMmost-mouse-38002
08/22/2022, 1:42 PMfancy-spoon-7206
08/23/2022, 8:32 PMfancy-spoon-7206
08/24/2022, 1:23 PMpulumi up
would do the trick. I did not add any code to set the config.
Now with the automation API all I see in the examples is
// set stack configuration specifying the AWS region to deploy
s.SetConfig(ctx, "aws:region", auto.ConfigValue{Value: "us-west-2"})
Is there a way to consume config using a Pulumi.dev.yaml
file? instead of setting one config at a time.
Pulumi.dev.yaml
config:
aws:region: us-east-2
aws:profile: sandbox
aep:config:
bucket:
name: dinesh-test
clean-window-19746
08/24/2022, 8:31 PMpulumi-eks
to create a resource in the newly created cluster. Given it’s an output type, I figured I’d need to use an apply
(can’t pass it in directly as a pulumi ResourceOption), and though there have been many examples here in Slack and online, I am still having trouble using it. I have given an attempt, and know I am doing it wrong, but can’t seem to progress forward. if anyone has any suggestions, that would be much appreciated. Thanks in advance!
k8sProvider := eksCluster.Provider.ApplyT(
func(cluster kubernetes.Provider) kubernetes.Provider {
return cluster
}).(pulumi.ProviderResource)
creamy-advantage-17182
08/28/2022, 4:34 PMstocky-sundown-45608
08/29/2022, 8:34 AMprehistoric-sandwich-7272
08/29/2022, 3:19 PMbucketName = stackReference.GetStringOutput(pulumi.String("BucketName"))
appliedBucket := bucketName.ApplyT(func(name string) string {
return name
}).(pulumi.StringInput)
resourceName := fmt.Sprintf("%v/%s/", appliedBucket, "testFolder")
key := fmt.Sprintf("testFolder")
// Create S3 folder
bucket, err := s3.NewBucketObjectv2(ctx, resourceName, &s3.BucketObjectv2Args{
Key: pulumi.String(key),
Bucket: appliedBucket,
Tags: tags,
})
So when I do pulumi up I get this:
Type Name Plan Info
pulumi:pulumi:Stack audio-player-sdk-staging 1 message
+ └─ aws:s3:BucketObjectv2 {0xc000782d90}/testFodler/