gitlab.ProjectCustomAttribute
Explore with Pulumi AI
The gitlab.ProjectCustomAttribute
resource allows to manage custom attributes for a project.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const attr = new gitlab.ProjectCustomAttribute("attr", {
project: 42,
key: "location",
value: "Greenland",
});
import pulumi
import pulumi_gitlab as gitlab
attr = gitlab.ProjectCustomAttribute("attr",
project=42,
key="location",
value="Greenland")
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.NewProjectCustomAttribute(ctx, "attr", &gitlab.ProjectCustomAttributeArgs{
Project: pulumi.Int(42),
Key: pulumi.String("location"),
Value: pulumi.String("Greenland"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var attr = new GitLab.ProjectCustomAttribute("attr", new()
{
Project = 42,
Key = "location",
Value = "Greenland",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.ProjectCustomAttribute;
import com.pulumi.gitlab.ProjectCustomAttributeArgs;
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 attr = new ProjectCustomAttribute("attr", ProjectCustomAttributeArgs.builder()
.project("42")
.key("location")
.value("Greenland")
.build());
}
}
resources:
attr:
type: gitlab:ProjectCustomAttribute
properties:
project: '42'
key: location
value: Greenland
Create ProjectCustomAttribute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectCustomAttribute(name: string, args: ProjectCustomAttributeArgs, opts?: CustomResourceOptions);
@overload
def ProjectCustomAttribute(resource_name: str,
args: ProjectCustomAttributeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectCustomAttribute(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
project: Optional[int] = None,
value: Optional[str] = None)
func NewProjectCustomAttribute(ctx *Context, name string, args ProjectCustomAttributeArgs, opts ...ResourceOption) (*ProjectCustomAttribute, error)
public ProjectCustomAttribute(string name, ProjectCustomAttributeArgs args, CustomResourceOptions? opts = null)
public ProjectCustomAttribute(String name, ProjectCustomAttributeArgs args)
public ProjectCustomAttribute(String name, ProjectCustomAttributeArgs args, CustomResourceOptions options)
type: gitlab:ProjectCustomAttribute
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 ProjectCustomAttributeArgs
- 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 ProjectCustomAttributeArgs
- 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 ProjectCustomAttributeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectCustomAttributeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectCustomAttributeArgs
- 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 projectCustomAttributeResource = new GitLab.ProjectCustomAttribute("projectCustomAttributeResource", new()
{
Key = "string",
Project = 0,
Value = "string",
});
example, err := gitlab.NewProjectCustomAttribute(ctx, "projectCustomAttributeResource", &gitlab.ProjectCustomAttributeArgs{
Key: pulumi.String("string"),
Project: pulumi.Int(0),
Value: pulumi.String("string"),
})
var projectCustomAttributeResource = new ProjectCustomAttribute("projectCustomAttributeResource", ProjectCustomAttributeArgs.builder()
.key("string")
.project(0)
.value("string")
.build());
project_custom_attribute_resource = gitlab.ProjectCustomAttribute("projectCustomAttributeResource",
key="string",
project=0,
value="string")
const projectCustomAttributeResource = new gitlab.ProjectCustomAttribute("projectCustomAttributeResource", {
key: "string",
project: 0,
value: "string",
});
type: gitlab:ProjectCustomAttribute
properties:
key: string
project: 0
value: string
ProjectCustomAttribute 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 ProjectCustomAttribute resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectCustomAttribute 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 ProjectCustomAttribute Resource
Get an existing ProjectCustomAttribute 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?: ProjectCustomAttributeState, opts?: CustomResourceOptions): ProjectCustomAttribute
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
project: Optional[int] = None,
value: Optional[str] = None) -> ProjectCustomAttribute
func GetProjectCustomAttribute(ctx *Context, name string, id IDInput, state *ProjectCustomAttributeState, opts ...ResourceOption) (*ProjectCustomAttribute, error)
public static ProjectCustomAttribute Get(string name, Input<string> id, ProjectCustomAttributeState? state, CustomResourceOptions? opts = null)
public static ProjectCustomAttribute get(String name, Output<String> id, ProjectCustomAttributeState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
Import
You can import a project custom attribute using an id made up of {project-id}:{key}
, e.g.
$ pulumi import gitlab:index/projectCustomAttribute:ProjectCustomAttribute attr 42:location
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlab
Terraform Provider.