• f

    fast-easter-23401

    8 months ago
    Hello folks, I'm trying to import some databases grants created using Terraform. We have a MySQL instance running on GCP, to which I'm connecting using
    cloud_sql_proxy
    that handles TLS. My provider point to localhost:3307 where cloud_sql_proxy is listening.
    new mysql.Grant(
      'applications',
      {
        user: 'applications',
        host: '%',
        database: 'applications',
        privileges: ['ALL'],
      },
      {
        provider: new mysql.Provider(`import-applications-grant`, {
          username: 'root',
          endpoint: '127.0.0.1:3307',
          password: config.requireSecret('MY_SQL_APPLICATIONS_SECRET'),
        }),
        import: 'applications@%:applications',
        protect: true,
      }
    );
    But then I get the following error:
    Diagnostics:
      pulumi:pulumi:Stack (env-staging):
        error: preview failed
     
      mysql:index:Grant (applications@%:applications):
        error: Preview failed: refreshing urn:pulumi:staging::env::mysql:index/grant:Grant::applications@%:applications: user with host or a role is required
    Any ideas?
    f
    l
    4 replies
    Copy to Clipboard
  • b

    billions-judge-9412

    8 months ago
    Hello! We're currently in the process of evaluating Pulumi to see if it fits our use case and came upon an issue and i can't find anything in the documentation on this. Basically, we have a resource (On azure, if that matters) that we're trying to update. However this update requires the resource to be recreated. The output says to destroy the component first. But just like how you would 'Taint' something in terraform - Is there an equivelant in Pulumi? TL;DR - Is there any way to force 'pulumi up' to recreate/destroy a specific resource? - Similiar to Terraforms taint function
    b
    d
    5 replies
    Copy to Clipboard
  • d

    dazzling-author-49810

    8 months ago
    Hi, is there some sort of document/pattern etc about how Dependency Tracking works? @tall-librarian-49374
    d
    e
    21 replies
    Copy to Clipboard
  • s

    stale-vase-87890

    8 months ago
    Hello Pulumi friends! I am trying to move our AWS SecretManager values into Pulumi so we can manage them with code! The secrets would be encrypted using pulumi secret foo 'bar' in the config file. Since we are reading them in from the config file they become an Output<T> which makes things a bit of a pain. To do a key/pair with secrets manager you have to pass it as json however you can't JSON.stringify a type of Output<T>, and there doesn't seem any way to convert it into anything else example:
    interface appsecrets {
        auth0clientid: string,
    }
    const appsecrets = config.requireSecretObject<appsecrets>("appsecrets")
    const auth0client = appsecrets.auth0clientid
    const example1 = {
        auth0clientid1: auth0client
    }
    
    const exampleSecretVersion = new aws.secretsmanager.SecretVersion("exampleSecretVersion", {
        secretId: example.id,
        secretString: JSON.stringify(example1)
    })
    I have tried all sorts of things like
    appsecrets.auth0clientid.apply(v => JSON.stringify(v))
    but it still is going to be a type of Output<T> and it sets the value in secrets manager as Calling [toJSON] on an [Output<T>] is not supported. To get the value of an Output as a JSON value or JSON string consider either: 1: o.apply(v => v.toJSON()) 2: o.apply(v => JSON.stringify(v)) See https://pulumi.io/help/outputs for more details. This function may throw in a future version of @pulumi/pulumi.
    s
    b
    12 replies
    Copy to Clipboard
  • p

    polite-napkin-90098

    8 months ago
    I'm sure I'm missing something obvious, but I'm struggling with circular dependencies. I'm using the EKS package to make a kluster The cluster needs a security group. The security group needs to allow access from the node pool security group The node pool security is created by the cluster and is an output from it. So essentially I have
    sg, err := ec2.NewSecurityGroup(ctx, "EKS", &ec2.SecurityGroupArgs{
                            Description: pulumi.String("Group for the EKS cluster"),
                            VpcId: pulumi.String(vpcid),
                            Ingress: ec2.SecurityGroupIngressArray{
                                    &ec2.SecurityGroupIngressArgs{
                                          Description: pulumi.String("https in from the nodes"),
                                          FromPort: <http://pulumi.Int|pulumi.Int>(443),
                                          ToPort: <http://pulumi.Int|pulumi.Int>(443),
                                          Protocol: pulumi.String("tcp"),
                                          SecurityGroups: pulumi.StringArray{
                                                  pulumi.String(cluster.NodeSecurityGroup),
                                          },
                                    },
                            },
                            Egress:  ec2.SecurityGroupEgressArray{
                                    // allow https out to anywhere
                                    &ec2.SecurityGroupEgressArgs{
                                            FromPort: <http://pulumi.Int|pulumi.Int>(443),
                                            ToPort:   <http://pulumi.Int|pulumi.Int>(443),
                                            Protocol: pulumi.String("tcp"),
                                            CidrBlocks: pulumi.StringArray{
                                                    pulumi.String("0.0.0.0/0"),
                                            },
                                            Ipv6CidrBlocks: pulumi.StringArray{
                                                    pulumi.String("::/0"),
                                            },
                                    },
                            },
                    }, nil)
                    if err != nil {
                            return err
                    }
                    // Create an EKS cluster
                    cluster, err := eks.NewCluster(ctx, "Test", &eks.ClusterArgs{
                            VpcId: pulumi.String(vpcid),
                            PrivateSubnetIds: pulumi.StringArray{
                                    pulumi.String(private[0]),
                                    pulumi.String(private[1]),
                                    pulumi.String(private[2]),
                            },
                            PublicSubnetIds: pulumi.StringArray{
                                    pulumi.String(public[0]),
                                    pulumi.String(public[1]),
                                    pulumi.String(public[2]),
                            },
                            ClusterSecurityGroup: sg,
                            EndpointPrivateAccess: pulumi.Bool(true),
                            EndpointPublicAccess: pulumi.Bool(false),
                    })
                    if err != nil {
                            return err
                    }
    and if I put it that way round I get
    ./main.go:150:21: undefined: cluster
    and if I put the cluster before the sg I get
    undefined: sg
    p
    b
    4 replies
    Copy to Clipboard
  • f

    flat-kangaroo-13810

    8 months ago
    Hi All, What is the best way to use an Output<string> in the name of a new resource. Context: I am trying to use an output from a previous resource to create deterministic naming of pulumi resources down the chain.
    Team team = new Team("<name here built using an Output<string> from a previous resource>", new TeamArgs());
    f
    b
    4 replies
    Copy to Clipboard
  • a

    aloof-airport-42412

    8 months ago
    Hello! I am new to Pulumi and apologize if this might be a stupid question Just trying Pulumi out with aws and having trouble with getting nested configuration in the code So I have below in my stack yaml file
    autoscaling:environment:
      testEnv: testEnv
    and I want to get it in typescript code
    let config = new pulumi.Config();
    let test = config.get("environment.testEnv");
    
    console.log(`Environment Variable: ${test}`);
    When I run
    pulumi up
    I get
    Environment Variable: undefined
    rather than the environment variable
    a
    l
    10 replies
    Copy to Clipboard
  • l

    little-cartoon-10569

    8 months ago
    How does Pulumi decide which provider to use in the
    providers
    map (in the opt object)?
    l
    e
    8 replies
    Copy to Clipboard
  • w

    wet-soccer-72485

    8 months ago
    Feature request: allow users on the Resources page https://app.pulumi.com/org/project/stack/resources to refresh the Graph View without having to click back to it after refreshing.
    w
    g
    8 replies
    Copy to Clipboard
  • m

    miniature-photographer-46262

    8 months ago
    Hi! Has anyone used the Kong Pulumi Provider before? Having issues authentication with Kong, issue is detailed here:https://github.com/pulumi/pulumi-kong/issues/89
    m
    g
    2 replies
    Copy to Clipboard