Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling compute service in project before using getZones. #120

Closed
apichick opened this issue Apr 1, 2019 · 1 comment
Closed

Enabling compute service in project before using getZones. #120

apichick opened this issue Apr 1, 2019 · 1 comment

Comments

@apichick
Copy link

apichick commented Apr 1, 2019

I need to get the available zones in a region provided that the compute service has already being enabled in the project.

const services = new gcp.projects.Services('services', {
    services: ['compute.googleapis.com'],
});

const available = pulumi.output(gcp.compute.getZones({}));

How can I make sure that getZones runs once the service has been enabled. I don't see a way of handling the dependency.

Thx

@lukehoban
Copy link
Member

I expect the following should work:

const services = new gcp.projects.Services('services', {
    services: ['compute.googleapis.com'],
});

const available = services.id.apply(_ => gcp.compute.getZones({}));

The apply will only run after the services have been registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants