limited-rainbow-51650
11/14/2022, 6:23 AMsome-cartoon-66940
11/14/2022, 7:43 PMsome-cartoon-66940
11/14/2022, 7:44 PMaloof-tiger-61862
11/15/2022, 1:29 PMjolly-church-88521
11/15/2022, 4:51 PMnamespace, err := corev1.NewNamespace(ctx, name, ...)
if err != nil {
return nil, nil
}
to create them. But there are some exceptions, like kube-system
, which is already in EKS. Pulumi is failing with:
namespaces "kube-system" already exists
because obviously this namespace is already there. I tried to catch error message like if err.Error() == "…"
or/and return nil, nil
. But it’s still the same error message. Is there any way to workaround this?some-cartoon-66940
11/17/2022, 10:17 AMsome-cartoon-66940
11/17/2022, 10:34 AMgreat-mouse-52242
11/22/2022, 5:25 PMsome-cartoon-66940
11/24/2022, 5:14 PMbrash-gigabyte-81569
12/01/2022, 3:15 PMlittle-soccer-5693
12/01/2022, 5:02 PMbored-spoon-83710
12/02/2022, 6:11 PMpulumi up
after that, I got the following error:
# <http://github.com/pjbgf/sha1cd/cgo|github.com/pjbgf/sha1cd/cgo>
vendor/github.com/pjbgf/sha1cd/cgo/sha1.go:3:11: fatal error: lib/sha1.h: No such file or directory
3 | // #include <lib/sha1.h>
| ^~~~~~~~~~~~
compilation terminated.
error: error in compiling Go: unable to run `go build`: exit status 2
The concerned package is an indirect dependency of the Go Pulumi SDK:
❯ go mod why <http://github.com/pjbgf/sha1cd/cgo|github.com/pjbgf/sha1cd/cgo>
# <http://github.com/pjbgf/sha1cd/cgo|github.com/pjbgf/sha1cd/cgo>
<my-pulumi-go-project>
<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>
<http://github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin|github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin>
<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>
<http://github.com/go-git/go-git/v5/plumbing|github.com/go-git/go-git/v5/plumbing>
<http://github.com/go-git/go-git/v5/plumbing/hash|github.com/go-git/go-git/v5/plumbing/hash>
<http://github.com/pjbgf/sha1cd/cgo|github.com/pjbgf/sha1cd/cgo>
I did some search and I came across this pull request which should have solved the problem: https://github.com/pjbgf/sha1cd/pull/5.
However, this is not the case because Pulumi doesn’t seem to build Go programs using CGO_ENABLED=0
.
What’s the reason why CGO_ENABLED=0
is not used?bored-spoon-83710
12/04/2022, 10:25 AMpulumi.<Type>PtrIntput
is expected, one can pass a pulumi.<Type>
without error most of the time and I’d like to know if this is an intended and supported behaviour? Indeed, I use it a lot, but it recently broke here: https://github.com/pulumi/pulumi-aws/blob/c984ddfba812c33e5ebf7267cdf9c1498174f3d4/sdk/go/aws/rds/instance.go#L362.gifted-fall-44000
12/04/2022, 11:11 PMthousands-train-46386
12/06/2022, 3:29 PMApplyT
method on previously created resources. Am I headed in the right direction or is there a simpler way?thousands-train-46386
12/08/2022, 12:10 PMiam.GetPolicyDocument
resource. In the policy statement, I need to provide a federated principle with an identifier value of an ARN provided by resource created earlier in the stack:
myPolicy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Sid: pulumi.StringRef(""),
Effect: pulumi.StringRef("Allow"),
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "Federated",
Identifiers: <ARN>, // <----- this input
},
},
.......
})
The field Identifiers
takes in a slice of strings but I’m needing to provide an ARN value which is not known until earlier stack resources are created and presented in type pulumi.StringOutput
. Is this possible?gifted-fall-44000
12/11/2022, 10:35 PMquaint-salesclerk-22166
12/12/2022, 11:37 AMgifted-fall-44000
12/12/2022, 5:53 PM&ec2.SubnetArgs{
AvailabilityZone: pulumi.String(azResult.Azs[i]),
CidrBlock: cidr,
VpcId: infra.Vpc.ID(),
Tags: &ec2.SubnetTagArray{},
}
flaky-school-70251
12/12/2022, 8:59 PMpulumi.StringInput
that I need to convert into a regular golang string
so I can fmt.Printf
it, can anyone help me out?quaint-salesclerk-22166
12/13/2022, 1:30 PMres, err = globalStack.Up(globalCtx, stdoutStreamer)
and let Pulumi service run independently. Now it runs for a while but then it fails since the golang cli from where I am running stack updates is no longer running.gifted-fall-44000
12/14/2022, 9:21 PMflaky-arm-38472
12/20/2022, 9:15 AMTags: pulumi.StringMap{
string(exampleResource.ApplyT(func(tagKey string) string {
return "chained-name-" + tagKey
}).(pulumi.StringOutput))[:]: pulumi.String("test"),
}
busy-room-61756
12/20/2022, 3:24 PMpulumi-random
. For now I plan to create two separate providers for my resources and components, but I'm fairly sure I've just missed something obvious and it's easy for them to co-exist. Any pointers gratefully received.billions-accountant-89861
12/26/2022, 7:18 AMrefined-pilot-45584
12/27/2022, 9:57 AMvar denyPorts pulumi.StringArray
for _, denyPort := range local.DenyPorts {
append(denyPorts, pulumi.String(denyPort))
}
I basically receive the following error:
append(denyPorts, pulumi.String(denyPort)) (value of type pulumi.StringArray) is not used
I assume there must be a way to combine pulumi.String and pulumi.StringArray
If not what would be the suggested approach? Is there a different way to convert a []string object in go to pulumi.StringArray?
Thanks in advance.refined-pilot-45584
12/27/2022, 10:04 AMcannot use fwDenyArray (variable of type *compute.FirewallDenyArgs) as type compute.FirewallDenyArrayInput in struct literal:
*compute.FirewallDenyArgs does not implement compute.FirewallDenyArrayInput (missing ToFirewallDenyArrayOutput method)
How I am trying to achieve this is as follows:
firewallArgs := &compute.FirewallArgs{
Network: gcpVPC.SelfLink,
Allows: fwAllowArray,
}
Where fwAllowArray is defined as :
fwAllowArray := &compute.FirewallAllowArgs{}
for _, allowArgument := range firewallRule.Allow {
fwAllowArgs := &compute.FirewallAllowArgs{}
fwAllowArgs.Protocol = pulumi.String(allowArgument.Protocol)
var allowPorts pulumi.StringArray
for _, allowPort := range allowArgument.Ports {
append(allowPorts, pulumi.String(allowPort))
}
fwAllowArgs.Ports = allowPorts
}
I would appreciate any feedback. I would really like to resolve these two issues but simultaneously understand where any I have gone wrong… I am not quite sure whats happening under the hood between the types and maybe I am just abusing a process I am not aware of. Thanks.adventurous-apartment-93389
12/30/2022, 10:49 AMfmt.Sprintf("%s-%s", projectID, args.Name)
but I need to get the projectId from the output of a previous run that creates the project Id (which is a pulumi.StringOutput). I've tried everything with the ApplyT but it doesn't seem to work....
These pulumi types are killing me here, any ideas?
my programme:
var project project.Project
var vpc vpc.Vpc
pulumi.Run(func(ctx *pulumi.Context) error {
project.Args.Name = "b1-services"
project.Args.FolderId = "folders/415061719873"
project.Args.BillingAccount = "01504C-A2522F-2110FA"
project.Args.AutoCreateNetwork = false
project.Args.Services = []string{"<http://compute.googleapis.com|compute.googleapis.com>", "<http://container.googleapis.com|container.googleapis.com>"}
prj, err := project.Create(ctx)
if err != nil {
log.Println(err)
}
vpc.Args.Name = "vpc-1"
vpc.Args.ProjectId = prj.ProjectId
//vpc.Args.Project = pulumi.Sprintf("%s", prj.ProjectId)
vpcNetwork, err := vpc.Create(ctx)
if err != nil {
log.Println(err)
}
my package:
package vpc
import (
"<http://github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute|github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute>"
"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
"fmt"
)
type VpcArgs struct {
Name string
Description string
ProjectId pulumi.StringOutput
RoutingMode string
AutoCreateSubnetworks bool
DeleteDefaultRoutesOnCreate bool
EnableUIaInternalIpv6 bool
InternalIpv6Range bool
}
type Vpc struct {
Args VpcArgs
Name string
}
func (vpc *Vpc) Create(ctx *pulumi.Context) (vpcNetwork *compute.Network, err error) {
args := &compute.NetworkArgs{}
args.Name = pulumi.String(vpc.Args.Name)
args.Project = vpc.Args.ProjectId
args.AutoCreateSubnetworks = pulumi.Bool(vpc.Args.AutoCreateSubnetworks)
var projectId string
vpc.Args.ProjectId.ApplyT(func(p string) error {
projectId = fmt.Sprintf("%s", p)
return nil
})
fmt.Println(projectId)
vpcNetwork, err = compute.NewNetwork(ctx, fmt.Sprintf("%s-%s",projectId,args.Name), args)
ctx.Export("vpc", vpcNetwork)
return vpcNetwork, err
}
gorgeous-architect-28903
01/09/2023, 10:51 AMcontext.Context
of a pulumi.Context
but I guess it isn’t possible unless I create my own pulumi.Context
which would mean I have to more or less duplicate the code for setting up the pulumi.RunInfo
from the environment. Anyone else run into this?gorgeous-vegetable-57900
01/09/2023, 8:03 PMaws/secretsmanager
to do a LookupSecret
followed by a GetSecretVersion
reference, _ := pulumi.NewStackReference(ctx, fmt.Sprintf("prefix/%v", stackName), nil)
secretArn := reference.GetStringOutput(pulumi.String("SecretARN"))
secret := secretArn.ApplyT(func(arn string) string {
// I'm disappointed that I seem to have to do this within an Apply
secret, _ := secretsmanager.LookupSecret(ctx,
&secretsmanager.LookupSecretArgs{
Arn: &arn,
},
nil,
)
// Error: cannot use secret.Id (variable of type string) as type pulumi.IDInput in argument to secretsmanager.GetSecretVersion
secretVersion, _ := secretsmanager.GetSecretVersion(ctx, secret.Name, secret.Id, nil, nil)
return secretVersion.SecretString
})
How can I convert secret.Id
from a string
to a pulumi.IDInput
for use with GetSecretVersion
?