adamant-father-26302
03/03/2023, 5:07 PMIntPtrOutput
to StringPtrInput
?
trying:
Value: config.ReadinessProbe.ToProbePtrOutput().PeriodSeconds().ApplyT(func(v int) string {
return strconv.Itoa(v)
}).(pulumi.StringPtrInput),
but getting: panic: applier must have 1 input parameter assignable from *int
adamant-father-26302
03/03/2023, 5:08 PMdelightful-monkey-90700
03/03/2023, 5:25 PMnice-rain-32013
03/03/2023, 10:01 PMpanic: runtime error: index out of range [4] with length 1
goroutine 123 [running]:
<http://github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.parseRoleGrantsID({0x14000b98cc0|github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.parseRoleGrantsID({0x14000b98cc0>, 0x7})
/home/runner/go/pkg/mod/github.com/!snowflake-!labs/terraform-provider-snowflake@v0.56.5/pkg/resources/role_grants.go:324 +0x2bc
<http://github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.ReadRoleGrants(0x140005a6f00|github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.ReadRoleGrants(0x140005a6f00>, {0x101adcc00?, 0x140009a09c0})
/home/runner/go/pkg/mod/github.com/!snowflake-!labs/terraform-provider-snowflake@v0.56.5/pkg/resources/role_grants.go:110 +0xd8
...
<http://google.golang.org/grpc.(*Server).handleStream(0x14000972000|google.golang.org/grpc.(*Server).handleStream(0x14000972000>, {0x101b1ca80, 0x140006024e0}, 0x14000a79e60, 0x0)
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.51.0/server.go:1713 +0x82c
<http://google.golang.org/grpc.(*Server).serveStreams.func1.2()|google.golang.org/grpc.(*Server).serveStreams.func1.2()>
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.51.0/server.go:965 +0x84
created by <http://google.golang.org/grpc.(*Server).serveStreams.func1|google.golang.org/grpc.(*Server).serveStreams.func1>
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.51.0/server.go:963 +0x290
error: error reading from server: EOF
error: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:58122: connect: connection refused"
error: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:58122: connect: connection refused"
is that something that rings a bell with anyone?breezy-lawyer-65638
03/03/2023, 11:27 PMpreview
. is this expected? I took a trace and it has a lot of stuff like thisgifted-solstice-53259
03/04/2023, 3:07 AMerr
Now my question is how do I handle errors here. Lets say the func returns an error, how do I handle that outside, seems like all that gets returned by pulumi.All is connectionString
Which would be empty because the func inside errored. Any help would be appreciated
connectionString := pulumi.All(sqlServer.Name, database.Name).ApplyT(
func (args []interface{}) (string, error) {
server := args[0].(string)
db := args[1].(string)
return "", errors.New("Some error")
},
)
great-sunset-355
03/04/2023, 7:46 PM3.55.0
image tag -debian
has not been released.
https://github.com/pulumi/pulumi-docker-containers/issues/129 šflat-kangaroo-13810
03/04/2023, 7:50 PMerror: an unhandled error occurred: program failed:
1 error occurred:
* decoding YAML: rpc error: code = Unknown desc = invocation of kubernetes:yaml:decode returned an error: failed to initialize discovery client: The gcp auth plugin has been removed.
Please use the "gke-gcloud-auth-plugin" kubectl/client-go credential plugin instead.
See <https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke> for further details
I figured out this is caused because during "pulumi preview" the kubeconfig does not exist on the server it returns a empty string.
So the provider cannot create with an empty kubeconfig.
I have used DependsOn with all the previous commands required for it to work, but it seems that it always executes the command and tries to build the provider off an empty string.
If I bypass preview with "pulumi up -f", everything works without issue.
Sample Code:
func (k *K3sCluster) exportKubeProvider(node K3sClusterNode, dependsOn ...pulumi.Resource) (*remote.Command, *kubernetes.Provider, error) {
t := remote.ConnectionArgs{}
t.Host = pulumi.String(node.IP)
t.Password = pulumi.String(nodePassword)
t.User = pulumi.String(nodeUsername)
c := remote.CommandArgs{
Connection: t.ToConnectionOutput(),
Create: pulumi.String("sudo cat /etc/rancher/k3s/k3s.yaml").ToStringPtrOutput(),
}
a, err := remote.NewCommand(k.ctx, fmt.Sprintf("get-k3s-kubeconfig-%s", node.Name), &c, pulumi.DependsOn(dependsOn))
if err != nil {
return nil, nil, err
}
dependsOn = append(dependsOn, a)
provider, err := kubernetes.NewProvider(k.ctx, "k3s-provider", &kubernetes.ProviderArgs{
Kubeconfig: a.Stdout.ApplyT(func(config string) string {
config = strings.Replace(config, "<https://127.0.0.1:6443>", fmt.Sprintf("<https://%s:6443>", node.IP), -1)
return config
}).(pulumi.StringOutput).ToStringPtrOutput(),
}, pulumi.DependsOn(dependsOn))
if err != nil {
return nil, nil, err
}
//k.ctx.Export("kubeconfig", config)
dependsOn = append(dependsOn, provider)
ingress, err := yaml.NewConfigFile(k.ctx, "k8s-ingress-nginx", &yaml.ConfigFileArgs{
File: "pkg/kube/yaml/ingress-nginx.yaml",
}, pulumi.Providers(provider), pulumi.DependsOn(dependsOn))
if err != nil {
return nil, nil, err
}
dependsOn = append(dependsOn, ingress)
_, err = yaml.NewConfigFile(k.ctx, "k8s-ingress-nginx-load-balancer", &yaml.ConfigFileArgs{
File: "pkg/kube/yaml/loadbalancer-nginx.yaml",
}, pulumi.Providers(provider), pulumi.DependsOn(dependsOn))
if err != nil {
return nil, nil, err
}
return a, provider, nil
}
echoing-address-44214
03/06/2023, 3:35 AMpulumi import "random:index/randomPassword:RandomPassword" my-name "the-password"
but I got as a result:
Diagnostics:
random:index:RandomPassword (sch-dev-syd-ruwentest-redisredis-password):
error: Preview failed: Cannot extract ID from "random_password" resource state: ID cannot be empty
Any ideas how to do it?rapid-receptionist-28528
03/06/2023, 10:29 AMpulumi
dynamic resource using typescript
and Implemented all the needed functions (like and update and diff)
and then I put an a breakpoint on those functions - but the running application context did not stop on my breakpoints although passing those functions.
Any idea ?
https://www.pulumi.com/docs/intro/concepts/resources/dynamic-providers/fancy-artist-45287
03/06/2023, 10:36 AMchilly-cricket-96227
03/06/2023, 3:17 PMaloof-leather-66267
03/06/2023, 10:07 PMOutput<Resource[]>
to create child resources based on each Resource
, without creating resources inside a .apply()
?
https://github.com/pulumi/pulumi/issues/5392#issuecomment-1203668256millions-addition-49065
03/06/2023, 10:52 PMComponent
unit tests to behave correctly in a python/pytest project that has other async-based unit tests (FastAPI). The pulumi-specific tests behave fine by themselves, but introducing my other tests into the same pytest session causes problems. Everything is using asyncio/anyio. I end up getting the dreaded attached to a different loop exception after some hanging. I have tried forcing a single event loop with various pytest fixtures. Sometimes Iāve been able to get to work, but without consistency. I understand pulumi is doing some āinterestingā things behind the scene with python async and event loops, but is there any hope in making it play nicely with other async pytests? Hoping someone has some secret sauce that I havenāt thought of yet. Iād like to be able to keep the tests together if possible.
Some exception examples:
Exception ignored in: <coroutine object Output.apply.<locals>.run at 0xffff7c22c460>
Traceback (most recent call last):
File "/.pyenv/versions/3.11.2/lib/python3.11/site-packages/pulumi/output.py", line 228, in run
result_resources.set_result(resources)
File "/.pyenv/versions/3.11.2/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
self._check_closed()
File "/.pyenv/versions/3.11.2/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
raise RuntimeError('Event loop is closed')
Traceback (most recent call last):
File "/.pyenv/versions/3.11.2/lib/python3.11/site-packages/pulumi/runtime/rpc_manager.py", line 71, in rpc_wrapper
result = await rpc
^^^^^^^^^
File "/.pyenv/versions/3.11.2/lib/python3.11/site-packages/pulumi/runtime/resource.py", line 811, in do_register
resolver = await prepare_resource(res, ty, custom, remote, props, opts, typ)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.pyenv/versions/3.11.2/lib/python3.11/site-packages/pulumi/runtime/resource.py", line 187, in prepare_resource
parent_urn = await opts.parent.urn.future()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.pyenv/versions/3.11.2/lib/python3.11/site-packages/pulumi/output.py", line 128, in get_value
val = await self._future
^^^^^^^^^^^^^^^^^^
RuntimeError: await wasn't used with future
RuntimeError: Task <Task pending name='Task-116' coro=<Output.future.<locals>.get_value() running at /.pyenv/versions/3.11.2/lib/python3.11/site-packages/pulumi/output.py:128> cb=[Task.task_wakeup()]> got Future <Future pending> attached to a different loop
few-postman-20852
03/07/2023, 9:17 AM@pulumi/azure-native
library? Looks like the library is too heavy for intellisense to load it in enough time.adamant-apartment-27628
03/07/2023, 11:04 AMerror reading from server: EOF
here's a more detailed output:
+ kubernetes:<http://rbac.authorization.k8s.io/v1:Role|rbac.authorization.k8s.io/v1:Role> snig-besu-001-92c8-firefly **creating failed** error: error reading from server: EOF
pulumi:pulumi:Stack bpaas-snig-besu-001-92c8 running error: update failed
pulumi:pulumi:Stack bpaas-snig-besu-001-92c8 **failed** 1 error
Diagnostics:
kubernetes:core/v1:Secret (snig-besu-001-92c8-auth):
error: error reading from server: EOF
kubernetes:<http://rbac.authorization.k8s.io/v1:Role|rbac.authorization.k8s.io/v1:Role> (snig-besu-001-92c8):
error: error reading from server: EOF
kubernetes:core/v1:ServiceAccount (snig-besu-001-92c8-firefly):
error: error reading from server: EOF
kubernetes:core/v1:Secret (snig-besu-001-92c8-firefly-auth):
error: error reading from server: EOF
kubernetes:<http://rbac.authorization.k8s.io/v1:Role|rbac.authorization.k8s.io/v1:Role> (snig-besu-001-92c8-firefly):
error: error reading from server: EOF
kubernetes:core/v1:ConfigMap (snig-besu-001-92c8):
error: error reading from server: EOF
kubernetes:core/v1:ConfigMap (snig-besu-001-92c8-auth):
error: error reading from server: EOF
kubernetes:core/v1:PersistentVolumeClaim (snig-besu-001-92c8):
error: error reading from server: EOF
kubernetes:core/v1:ConfigMap (snig-besu-001-92c8-firefly):
error: error reading from server: EOF
kubernetes:core/v1:PersistentVolumeClaim (snig-besu-001-92c8-firefly):
error: error reading from server: EOF
pulumi:pulumi:Stack (bpaas-snig-besu-001-92c8):
error: update failed
kubernetes:core/v1:ServiceAccount (snig-besu-001-92c8):
error: error reading from server: EOF
kubernetes:core/v1:ConfigMap (snig-besu-001-92c8-firefly-auth):
error: error reading from server: EOF
kubernetes:core/v1:Secret (snig-besu-001-92c8-firefly):
error: error reading from server: EOF
kubernetes:core/v1:Secret (snig-besu-001-92c8):
error: error reading from server: EOF
⢠The resources are created successfully when I create them one at a time, but when I create 3+ resources at the same time, the resource creation errors out with EOF.
⢠The same setup used to work 2 weeks ago with creating 3+ resources at the same time, this is a new issue
⢠I see some logs like this:
GET:<https://172.21.0.1:443/apis/apps/v1/namespaces/beta/deployments?limit=500&resourceVersion=0>
I0306 10:57:51.036174 2119 request.go:682] Waited for 1.081675482s due to client-side throttling, not priority and fairness, request: PATCH:<https://172.21.0.1:443/apis/rbac.authorization.k8s.io/v1/namespaces/beta/roles/snig-besu-node-11-0e68?fieldManager=pulumi-kubernetes-83f162bd&fieldValidation=Warn&force=true>
Here are my versions:
"@pulumi/aws": "5.30.0",
"@pulumi/awsx": "1.0.2",
"@pulumi/azure": "5.35.0",
"@pulumi/cloudflare": "4.15.0",
"@pulumi/eks": "1.0.1",
"@pulumi/gcp": "6.50.0",
"@pulumi/keycloak": "5.0.0",
"@pulumi/kubernetes": "3.24.1",
"@pulumi/kubernetesx": "0.1.6",
"@pulumi/postgresql": "3.6.0",
"@pulumi/pulumi": "3.55.0",
"@pulumi/random": "4.11.2",
"@pulumi/vault": "5.8.0",
Any ideas? If any more information is needed I'd be happy to add itrapid-receptionist-28528
03/07/2023, 12:06 PMPreview
and Refresh
operations does not return the outputs from a stack like Update
do.
Any Idea why ?billions-xylophone-85957
03/07/2023, 1:46 PMup
of the stack if the provisioning of one of resources failed?fancy-shoe-18611
03/07/2023, 3:46 PMerror: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
I know it isn't my env variables because I get the same error when I hard code. Also, the equivalent in terraform works so im positive it isn't my keys.magnificent-city-85763
03/07/2023, 3:46 PMmagnificent-city-85763
03/07/2023, 3:47 PMbillowy-vase-98939
03/07/2023, 5:29 PMcool-dress-96114
03/07/2023, 5:31 PMup
and refresh
states on resources that have additional configuration as separate resources, and was wondering if anyone had any advice.
Pulumi code snippet:
secGroup, err := ec2.NewSecurityGroup(ctx, "secgroup", &ec2.SecurityGroupArgs{
NamePrefix: namePrefix,
Ingress: &ec2.SecurityGroupIngressArray{
&ec2.SecurityGroupIngressArgs{
CidrBlocks: pulumi.StringArray{pulumi.String("10.0.0.0/8")},
Description: pulumi.String("description"),
FromPort: <http://pulumi.Int|pulumi.Int>(0),
Protocol: pulumi.String("-1"),
ToPort: <http://pulumi.Int|pulumi.Int>(0),
},
},
VpcId: vpcId,
}, []pulumi.ResourceOption{awsPulumiProvider}...)
if err != nil {
return err
}
_, err = ec2.NewSecurityGroupRule(ctx, "rule", &ec2.SecurityGroupRuleArgs{
CidrBlocks: pulumi.StringArray{pulumi.String("11.0.0.0/8")},
Description: pulumi.String("description"),
FromPort: <http://pulumi.Int|pulumi.Int>(0),
Protocol: pulumi.String("-1"),
SecurityGroupId: secGroup.ID(),
ToPort: <http://pulumi.Int|pulumi.Int>(0),
Type: pulumi.String("ingress"),
}, awsPulumiProvider)
if err != nil {
return err
}
So what weāve done is create a security group with an ingress rule defined inline, and then later on add another ingress rule.
⢠When running refresh
the security group resource notices it has an extra rule, and updates.
⢠Then after running up
, the security group resource diffs the state with the expected state, and notices it needs to delete the rule (from the inline state, not the separate rule).
⢠Then after running refresh
again, the security group rule is deleted because it doesnāt exist.
⢠Then after running up
again, the separate security group rule is recreated, and we do it all over again.
This happens with a lot of different types of resources, anything where weāre defining additional configuration out of line (another example being defining an AWS VPC Route Table, and adding a routing rule later), and basically means that we cannot use `refresh`⦠ever, which obviously is not desirable.colossal-vr-62639
03/07/2023, 6:20 PMelegant-sundown-11861
03/07/2023, 7:36 PMupdate
even if nothing in code is changed: [diff: ~__provider]
Could you tell me please what is a possible reason of that?
More details:
⢠Python
⢠Pulumi 3.56.0
⢠__provider
in _news
and _olds
are not the same (why?) š¬
Similar issues: 1, 2quick-garden-9190
03/07/2023, 10:34 PMechoing-address-44214
03/08/2023, 2:05 AMnew aws.ec2.SecurityGroup(
"ruwentest",
{
description: "ruwentest",
vpcId: "vpc-123",
ingress: []
}
);
I can use pulumi import ...
to bring it into pulumi. But pulumi shows immediately a drift since the autogenerated name from pulumi doesn't match the current security group name. I know I can set the name explicitly, but I want to avoid that since that breaks deployments when I need to recreate the resource.
What I want is that if pulumi generates a name for something which I am importing right now, then it should take the existing name instead of generating a new one. Is there way to do that?prehistoric-sandwich-7272
03/08/2023, 10:10 AMpulumi/action-install-pulumi-cli
- and since yesterday, been getting this error:
Error: Unable to resolve action. Repository not found: pulumi/action-install-pulumi-cli
Anyone can help with how can I solve this?freezing-greece-82130
03/08/2023, 3:01 PMapplication
referencing via js varshigh-hamburger-69207
03/08/2023, 8:02 PMimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import express ...
app.get(/make-ec2, (req,res)=> {
const ubuntu = aws.ec2.getAmi({
mostRecent: true,
filters: [
{
name: "name",
values: ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"],
},
{
name: "virtualization-type",
values: ["hvm"],
},
],
owners: ["099720109477"],
});
const web = new aws.ec2.Instance("web", {
ami: ubuntu.then(ubuntu => ubuntu.id),
instanceType: "t3.micro",
tags: {
Name: "HelloWorld",
}
});
res.send(web)
})
I am already doing this with AWS SDK, just wanted to know if I can do this by pulumi?