gcp.resourcemanager.Capability
Explore with Pulumi AI
Example Usage
Resource Manager Capability
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as time from "@pulumi/time";
const folder = new gcp.organizations.Folder("folder", {
displayName: "my-folder",
parent: "organizations/123456789",
deletionProtection: false,
});
const wait60s = new time.index.Sleep("wait_60s", {createDuration: "60s"}, {
dependsOn: [folder],
});
const capability = new gcp.resourcemanager.Capability("capability", {
value: true,
parent: folder.name,
capabilityName: "app-management",
}, {
dependsOn: [wait60s],
});
import pulumi
import pulumi_gcp as gcp
import pulumi_time as time
folder = gcp.organizations.Folder("folder",
display_name="my-folder",
parent="organizations/123456789",
deletion_protection=False)
wait60s = time.index.Sleep("wait_60s", create_duration=60s,
opts = pulumi.ResourceOptions(depends_on=[folder]))
capability = gcp.resourcemanager.Capability("capability",
value=True,
parent=folder.name,
capability_name="app-management",
opts = pulumi.ResourceOptions(depends_on=[wait60s]))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/resourcemanager"
"github.com/pulumi/pulumi-time/sdk/go/time"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
folder, err := organizations.NewFolder(ctx, "folder", &organizations.FolderArgs{
DisplayName: pulumi.String("my-folder"),
Parent: pulumi.String("organizations/123456789"),
DeletionProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
wait60s, err := time.NewSleep(ctx, "wait_60s", &time.SleepArgs{
CreateDuration: "60s",
}, pulumi.DependsOn([]pulumi.Resource{
folder,
}))
if err != nil {
return err
}
_, err = resourcemanager.NewCapability(ctx, "capability", &resourcemanager.CapabilityArgs{
Value: pulumi.Bool(true),
Parent: folder.Name,
CapabilityName: pulumi.String("app-management"),
}, pulumi.DependsOn([]pulumi.Resource{
wait60s,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Time = Pulumi.Time;
return await Deployment.RunAsync(() =>
{
var folder = new Gcp.Organizations.Folder("folder", new()
{
DisplayName = "my-folder",
Parent = "organizations/123456789",
DeletionProtection = false,
});
var wait60s = new Time.Index.Sleep("wait_60s", new()
{
CreateDuration = "60s",
}, new CustomResourceOptions
{
DependsOn =
{
folder,
},
});
var capability = new Gcp.ResourceManager.Capability("capability", new()
{
Value = true,
Parent = folder.Name,
CapabilityName = "app-management",
}, new CustomResourceOptions
{
DependsOn =
{
wait60s,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Folder;
import com.pulumi.gcp.organizations.FolderArgs;
import com.pulumi.time.sleep;
import com.pulumi.time.sleepArgs;
import com.pulumi.gcp.resourcemanager.Capability;
import com.pulumi.gcp.resourcemanager.CapabilityArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var folder = new Folder("folder", FolderArgs.builder()
.displayName("my-folder")
.parent("organizations/123456789")
.deletionProtection(false)
.build());
var wait60s = new Sleep("wait60s", SleepArgs.builder()
.createDuration("60s")
.build(), CustomResourceOptions.builder()
.dependsOn(List.of(folder))
.build());
var capability = new Capability("capability", CapabilityArgs.builder()
.value(true)
.parent(folder.name())
.capabilityName("app-management")
.build(), CustomResourceOptions.builder()
.dependsOn(wait60s)
.build());
}
}
resources:
folder:
type: gcp:organizations:Folder
properties:
displayName: my-folder
parent: organizations/123456789
deletionProtection: false
wait60s:
type: time:sleep
name: wait_60s
properties:
createDuration: 60s
options:
dependsOn:
- ${folder}
capability:
type: gcp:resourcemanager:Capability
properties:
value: true
parent: ${folder.name}
capabilityName: app-management
options:
dependsOn:
- ${wait60s}
Create Capability Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Capability(name: string, args: CapabilityArgs, opts?: CustomResourceOptions);
@overload
def Capability(resource_name: str,
args: CapabilityArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Capability(resource_name: str,
opts: Optional[ResourceOptions] = None,
capability_name: Optional[str] = None,
parent: Optional[str] = None,
value: Optional[bool] = None)
func NewCapability(ctx *Context, name string, args CapabilityArgs, opts ...ResourceOption) (*Capability, error)
public Capability(string name, CapabilityArgs args, CustomResourceOptions? opts = null)
public Capability(String name, CapabilityArgs args)
public Capability(String name, CapabilityArgs args, CustomResourceOptions options)
type: gcp:resourcemanager:Capability
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CapabilityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CapabilityArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CapabilityArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CapabilityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CapabilityArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var capabilityResource = new Gcp.ResourceManager.Capability("capabilityResource", new()
{
CapabilityName = "string",
Parent = "string",
Value = false,
});
example, err := resourcemanager.NewCapability(ctx, "capabilityResource", &resourcemanager.CapabilityArgs{
CapabilityName: pulumi.String("string"),
Parent: pulumi.String("string"),
Value: pulumi.Bool(false),
})
var capabilityResource = new Capability("capabilityResource", CapabilityArgs.builder()
.capabilityName("string")
.parent("string")
.value(false)
.build());
capability_resource = gcp.resourcemanager.Capability("capabilityResource",
capability_name="string",
parent="string",
value=False)
const capabilityResource = new gcp.resourcemanager.Capability("capabilityResource", {
capabilityName: "string",
parent: "string",
value: false,
});
type: gcp:resourcemanager:Capability
properties:
capabilityName: string
parent: string
value: false
Capability Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Capability resource accepts the following input properties:
- Capability
Name string - Capability name that should be updated on the folder.
- Parent string
- Folder on which Capability needs to be updated in the format folders/folder_id.
- Value bool
- Capability Value.
- Capability
Name string - Capability name that should be updated on the folder.
- Parent string
- Folder on which Capability needs to be updated in the format folders/folder_id.
- Value bool
- Capability Value.
- capability
Name String - Capability name that should be updated on the folder.
- parent String
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value Boolean
- Capability Value.
- capability
Name string - Capability name that should be updated on the folder.
- parent string
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value boolean
- Capability Value.
- capability_
name str - Capability name that should be updated on the folder.
- parent str
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value bool
- Capability Value.
- capability
Name String - Capability name that should be updated on the folder.
- parent String
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value Boolean
- Capability Value.
Outputs
All input properties are implicitly available as output properties. Additionally, the Capability resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Capability Resource
Get an existing Capability resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CapabilityState, opts?: CustomResourceOptions): Capability
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
capability_name: Optional[str] = None,
parent: Optional[str] = None,
value: Optional[bool] = None) -> Capability
func GetCapability(ctx *Context, name string, id IDInput, state *CapabilityState, opts ...ResourceOption) (*Capability, error)
public static Capability Get(string name, Input<string> id, CapabilityState? state, CustomResourceOptions? opts = null)
public static Capability get(String name, Output<String> id, CapabilityState state, CustomResourceOptions options)
resources: _: type: gcp:resourcemanager:Capability get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Capability
Name string - Capability name that should be updated on the folder.
- Parent string
- Folder on which Capability needs to be updated in the format folders/folder_id.
- Value bool
- Capability Value.
- Capability
Name string - Capability name that should be updated on the folder.
- Parent string
- Folder on which Capability needs to be updated in the format folders/folder_id.
- Value bool
- Capability Value.
- capability
Name String - Capability name that should be updated on the folder.
- parent String
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value Boolean
- Capability Value.
- capability
Name string - Capability name that should be updated on the folder.
- parent string
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value boolean
- Capability Value.
- capability_
name str - Capability name that should be updated on the folder.
- parent str
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value bool
- Capability Value.
- capability
Name String - Capability name that should be updated on the folder.
- parent String
- Folder on which Capability needs to be updated in the format folders/folder_id.
- value Boolean
- Capability Value.
Import
Capability can be imported using any of these accepted formats:
{{parent}}/capabilities/{{capability_name}}
{{parent}}/{{capability_name}}
When using the pulumi import
command, Capability can be imported using one of the formats above. For example:
$ pulumi import gcp:resourcemanager/capability:Capability default {{parent}}/capabilities/{{capability_name}}
$ pulumi import gcp:resourcemanager/capability:Capability default {{parent}}/{{capability_name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.