https://pulumi.com logo
Docs
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
golang
  • r

    ripe-shampoo-80285

    01/14/2022, 11:35 PM
    I believe this should be an easy fix. All it needs is to allow the API to accept BucketOwnerEnforced.
  • b

    boundless-telephone-98269

    01/16/2022, 10:53 PM
    What's the recommended pattern for getting the certificate out of
    certificates.NewCertificateSigningRequest(
    ?
    DependsOn
    doesn't wait for the CSR to be approved or denied. I can think of two patterns to use: 1. Poll the status of the CSR until it has been manually approved or denied. Then return the certificate if approved. 2. Use kubernetes SDK to automatically approve CSR and then return the certificate.
  • h

    hundreds-article-77945

    01/18/2022, 1:48 PM
    Is it possible to check if a resource exists? I’m attempting to default a field to its current value if not explicitly provided.
    • 1
    • 1
  • r

    ripe-shampoo-80285

    01/23/2022, 1:53 AM
    Cross post from aws channel: https://pulumi-community.slack.com/archives/CRH5ENVDX/p1642893139149700
  • r

    ripe-shampoo-80285

    01/23/2022, 2:32 AM
    The issue here is (I think) that clusterSg & nodeSg are type of Output of Output. Is here anyway that we can flat the nested Output?
    s
    • 2
    • 1
  • m

    most-portugal-2672

    02/03/2022, 2:12 PM
    Hi there, I'm trying out this piece of code from https://www.pulumi.com/registry/packages/azure-native/api-docs/network/virtualnetwork/#create-virtual-network-with-subnet:
    _, err := network.NewVirtualNetwork(ctx, "virtualNetwork", &network.VirtualNetworkArgs{
    			AddressSpace: &network.AddressSpaceArgs{
    				AddressPrefixes: pulumi.StringArray{
    					pulumi.String("10.0.0.0/16"),
    				},
    			},
    			Location:          pulumi.String("eastus"),
    			ResourceGroupName: pulumi.String("rg1"),
    			Subnets: []network.SubnetArgs{
    				&network.SubnetArgs{
    					AddressPrefix: pulumi.String("10.0.0.0/24"),
    					Name:          pulumi.String("test-1"),
    				},
    			},
    			VirtualNetworkName: pulumi.String("test-vnet"),
    		})
    For the "Subnets" field, however, the
    network.SubnetArgs
    type doesn't seem qualify as a
    network.SubnetTypeArrayInput
    because it does implement a method called `ToSubnetTypeArrayOutput`:
    b
    i
    a
    • 4
    • 11
  • m

    most-portugal-2672

    02/03/2022, 2:13 PM
    Any pointers in the right direction would be much appreciated - thanks !
  • c

    curved-morning-41391

    02/03/2022, 11:04 PM
    Anyone know the reason for needing
    pulumi.String
    instead of just a Go string?
    b
    • 2
    • 3
  • p

    proud-angle-89904

    02/03/2022, 11:13 PM
    hi folks, i’m following along with kubernetes the hard way, and just got to the point where they provision a certificate authority… i’m trying to figure out whether i can do that in pulumi-- i came across the [tls provider][], but i’m not quite sure where to go from there… [tls provider]: https://www.pulumi.com/registry/packages/tls
    q
    • 2
    • 5
  • p

    proud-angle-89904

    02/03/2022, 11:14 PM
    specifically here https://github.com/lpmi-13/kubernetes-the-hard-way-linode/blob/main/docs/04-certificate-authority.md#certificate-authority
  • p

    proud-angle-89904

    02/03/2022, 11:14 PM
    i guess i can just dip out to the command line to generate those files, and then pass their location as config variables
  • p

    proud-angle-89904

    02/03/2022, 11:14 PM
    i had kind of hoped to do the whole thing in pulumi code
  • q

    quiet-laptop-13439

    02/04/2022, 10:29 AM
    Hi, I'm pretty sure this should be a standard use pattern, but I cannot find any examples anywhere. I have an
    []*ec2.Subnet
    array, and want to write a simple filter based on tags. The problem is, that filtering needs to happen inside of unwrapped
    ApplyT
    on tags in the subnet for loop, but the best I can get out of apply outside
    pulumi.BoolOutput
    to see if tag is present, and I don't see how can I use this on the subnet. What am I missing?
  • p

    prehistoric-area-95664

    02/04/2022, 3:41 PM
    Is there a recommended way of doing this? I want to make sure I'm not overlooking anything, but essentially I want to take values from the config and unmarshal them into a args struct (i.e. containerinstance.ContainerPortArgs).
  • b

    boundless-telephone-98269

    02/06/2022, 8:37 PM
    Any ETA on go support for dynamic providers?
  • b

    boundless-telephone-98269

    02/06/2022, 8:37 PM
    https://github.com/pulumi/pulumi/issues/3825
  • b

    busy-island-31180

    02/08/2022, 3:38 AM
    I literally was just looking for the same answer, and just came here to ask. I looked at the automation API and it appears to be quite heavy weight for what I actually need.
  • o

    orange-policeman-59119

    02/08/2022, 6:51 AM
    You can write a native resource provider in Go, which while requiring more steps, is going to be the path forward right now. I have an example I'm working on here: https://github.com/aaronfriel/pulumi-wordle. Some other folks on the team are maintaining similar native providers that are arguably more useful 🙂
    😂 2
    f
    • 2
    • 1
  • b

    bored-table-20691

    02/08/2022, 8:13 AM
    @orange-policeman-59119 what's the best example of a native package that's simple but not trivial, ideally something that manages a REST API style resource, and implements all the core functionality (create update delete and diff)? The typical xyz example is a bit too simple to help beyond the boilerplate imo.
    b
    o
    • 3
    • 6
  • l

    late-energy-66663

    02/08/2022, 2:33 PM
    Hi Team, Wonder if you can advise , I am new to golang and Pulumi, creating multiple EC2 multiple instances with following Code . I would like to export , publicip, ec2name , hostname for each ec2 machine in a separate record . I am creating a ec2.Instance slice and then exporting their value . What would be the best way to get the output in the following format, desired output:
    Machine 1
    hostname: <http://ec2-15-161-152-141.eu-south-1.compute.amazonaws.com|ec2-15-161-152-141.eu-south-1.compute.amazonaws.com>
    Public ip : 15.161.152.141
    Machine2
    hostname: <http://ec2-15-160-154-234.eu-south-1.compute.amazonaws.com|ec2-15-160-154-234.eu-south-1.compute.amazonaws.com>
    Public ip : 15.160.154.234
    Current Code :
    var nodeList []*ec2.Instance
    
    for i := 1; i <= args.NumberOfNodes; i++ {
       vm.Instance, err = ec2.NewInstance(ctx, fmt.Sprintf("machine-%d", i), &ec2.InstanceArgs{
          Tags: pulumi.StringMap{"Name": pulumi.String(fmt.Sprintf("kafka-%d", i))},
          //InstanceType:        pulumi.String("t3.large"),
          InstanceType:        args.InstanceType,
          VpcSecurityGroupIds: pulumi.StringArray{vm.SecurityGroup.ID()},
          Ami:                 pulumi.String("ami-0f8ce9c417115413d"),
          UserData:            userData,
          KeyName:             deployer.KeyName,
       })
       if err != nil {
          panic("error creating ec2 instance")
       }
       nodeList = append(nodeList, vm.Instance)
    }
    
    for k, v := range nodeList {
       ctx.Export("publicIp"+strconv.Itoa(k), v.PublicIp)
       ctx.Export("publicHostName"+strconv.Itoa(k), v.PublicDns)
    
    
    }
    Current Outputs:
    publicHostName0: "<http://ec2-15-161-152-141.eu-south-1.compute.amazonaws.com|ec2-15-161-152-141.eu-south-1.compute.amazonaws.com>"
    publicHostName1: "<http://ec2-15-160-154-234.eu-south-1.compute.amazonaws.com|ec2-15-160-154-234.eu-south-1.compute.amazonaws.com>"
    
        publicIp0      : "15.161.152.141"
        publicIp1      : "15.160.154.234"
    b
    • 2
    • 67
  • b

    billions-judge-9412

    02/08/2022, 6:59 PM
    When trying to assign a userassignedidentity to AKS following this example: https://www.pulumi.com/registry/packages/azure-native/api-docs/containerservice/managedcluster/#createupdate-managed-cluster-with-enableahub I get the error that "pulumi.AnyMap" isnt declared by package pulumi Anyone know what gives? Second question: I've created an identity - is it identity.ID() that i have to pass in? - How do i convert that ID to a string?
    b
    • 2
    • 69
  • b

    billions-judge-9412

    02/08/2022, 7:00 PM
    pulumi.string(identity.ID()) incidentally didn't work haha
  • b

    billions-judge-9412

    02/09/2022, 2:35 AM
    Is there any way to turn a pulumi.StringOutput into a string? I just need a resourcegroup.Name (a pulumi.StringOutput) to be a string ....
    b
    • 2
    • 2
  • b

    billions-judge-9412

    02/09/2022, 1:58 PM
    Seriously this can't be for real. Is this a bug? Is it actually not possible to add userassignedidentities in Go for an AKS???
  • q

    quiet-wolf-18467

    02/09/2022, 2:26 PM
    Can you share your whole code?
  • b

    billions-judge-9412

    02/09/2022, 2:37 PM
    Honestly i've spent the better part of two days on this, and the solution was to pass in: pulumi.ToStringMap(map[string]string{}) instead of nil clusterArgs.UserAssignedIdentityId: pulumi.ToStringMap(map[string]string{}) Still can't get the ID directly unfortunately, i have to construct the string myself... But its the next best thing i guess Would have been real awesome if the example here https://www.pulumi.com/registry/packages/azure-native/api-docs/containerservice/managedcluster/#createupdate-managed-cluster-with-enableahub was even remotely correct
  • q

    quiet-wolf-18467

    02/09/2022, 2:40 PM
    Alright. Have a nice day 😀
    ♥️ 1
  • r

    ripe-shampoo-80285

    02/09/2022, 7:44 PM
    What is the best way to convert a StringOutput or StringPtrOutput to StringArrayOutput. I have tried the following, but it doesn't seem to work. Any help will be appreciated. vpcSgId := cluster.EksCluster.ApplyT(func(eksCluster *awseks.Cluster) pulumi.StringArrayOutput { return eksCluster.VpcConfig.ClusterSecurityGroupId().ApplyT(func(sgId *string) pulumi.StringArray { return pulumi.StringArray{pulumi.String(*sgId)} }).(pulumi.StringArrayOutput) })
    • 1
    • 2
  • b

    billions-judge-9412

    02/10/2022, 9:03 AM
    Hi Trying to assign a new role to anything in Azure using Authorization.NewRoleAssignment() gives me this error: error: cannot check existence of resource '/%2Fsubscriptions/ssss/FresourceGroups%2Fxxxx%2FprovidersMicrosoft.Network%2FvirtualNetworks%2Fxxxx%2Fsubnets%2Fyyyy/providers/Microsoft.Authorization/roleAssignments/4d97b98b-1d4f-4787-a291-c67834d212e7': status code 400, {"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2020-08-01-preview' is invalid. The supported versions are '2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."}} I've tried the other versions in the Go SDK but the problem is that many of them don't have the NewRoleAssignment func at all and the ones that do, don't work either roleAssign, err := authorization.NewRoleAssignment(m.ctx, name, &authorization.RoleAssignmentArgs{     PrincipalId:                        m.Identity.PrincipalId,     DelegatedManagedIdentityResourceId: pulumi.String(m.Id),     RoleAssignmentName:                 pulumi.String(networkContributorRole.RoleAssignmentName),     RoleDefinitionId:                   pulumi.String(networkContributorRole.RoleDefinitionId),     Scope:                              pulumi.String(scope),   })
  • b

    billions-judge-9412

    02/10/2022, 10:07 AM
    Nevermind. I'm going back to Terraform. Waaaay to many bugs, oddities, weird restrictions and things that should work but doesn't. GL.
Powered by Linen
Title
b

billions-judge-9412

02/10/2022, 10:07 AM
Nevermind. I'm going back to Terraform. Waaaay to many bugs, oddities, weird restrictions and things that should work but doesn't. GL.
View count: 3