https://pulumi.com logo
#general
Title
# general
b

better-actor-92669

11/05/2019, 4:08 PM
Hello Pulumi community! Is there a way to enable
Kubernetes Engine API has not been used in project
from pulumi itself?
b

broad-helmet-79436

11/05/2019, 4:13 PM
use the
gcp.project.Service
resource:
Copy code
new gcp.project.Service('container_service', {
  service: '<http://container.googleapis.com|container.googleapis.com>'
})
b

better-actor-92669

11/07/2019, 9:20 AM
For someone who uses Python and wants to enable GCP Service API:
Copy code
from pulumi_gcp.projects import Service as API_Service

# Enable Cloud Resource Manager API
cloud_resource_manager_api = API_Service(
    'cloud_resource_manager_api',
    service='<http://cloudresourcemanager.googleapis.com|cloudresourcemanager.googleapis.com>')

# Enable Kubernetes Engine API
kubernetes_service_api = API_Service(
    'kubernetes_engine_api',
    service='<http://container.googleapis.com|container.googleapis.com>',
    opts=ResourceOptions(
        depends_on=[cloud_resource_manager_api]))
🎉 1
4 Views