Giter Club home page Giter Club logo

Comments (4)

lukehoban avatar lukehoban commented on July 22, 2024

Thanks @geekflyer for the detailed write up. This is indeed unfortunate. It looks like this is related to the underlying behavior of the Google Terraform provider. Though we’ll need to figure out a way to make the .get experience simpler here.

from pulumi-gcp.

joeduffy avatar joeduffy commented on July 22, 2024

I believe @jen20 is actively looking into this, so reassigning.

from pulumi-gcp.

jen20 avatar jen20 commented on July 22, 2024

This is covered in the work I am doing to resolve #55. I have a prototype working which allows the following Pulumi program to import a node pool:

import * as gcp from "@pulumi/gcp";

const defaultPool = gcp.container.NodePool.get("default-pool", "us-central1-a/test-ci/default-pool", {
    project: "pulumi-development",
});

// Export the DNS name of the bucket
export const nodePoolVersion = defaultPool.version;

I think it is possible to remove the dependency on project being specified such that resources in the project associated with the default provider instance can be imported solely by ID without redundancy, which I think will resolve this issue.

There is still some work to do to move all the changes from my scratch copy into the correct places in the Pulumi repo structure - most of the changes are in pulumi/pulumi-terraform rather than GCP provider directly. I'm hoping to land this either later tonight or tomorrow evening.

from pulumi-gcp.

jen20 avatar jen20 commented on July 22, 2024

OK, I had misread and mis-recalled the Terraform provider requirement for the gcp:project configuration item to be the project id and not the project name. With the following configuration:

$ pulumi config
KEY                                              VALUE
gcp:project                                      pulumi-development

The following program:

import * as gcp from "@pulumi/gcp";

const defaultPool = gcp.container.NodePool.get("default-pool", "us-central1-a/test-ci/default-pool");

export const nodePoolVersion = defaultPool.version;

Executes as one would hope:

$ pulumi up
Previewing update (gcp-55-dev):

     Type                       Name               Plan
 +   pulumi:pulumi:Stack        gcp-55-gcp-55-dev  create
 >-  └─ gcp:container:NodePool  default-pool       read

Resources:
    2 changes
    + 1 to create
    >-1 to read

Do you want to perform this update? yes
Updating (gcp-55-dev):

     Type                       Name               Status
 +   pulumi:pulumi:Stack        gcp-55-gcp-55-dev  created
 >-  └─ gcp:container:NodePool  default-pool       read

Outputs:
    nodePoolVersion: "1.9.7-gke.3"

Resources:
    2 changes
    + 1 created
    >-1 read

Duration: 9.798929989s

I'll land a series of pull requests to make this work over the next day or so.

from pulumi-gcp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.