gitlab.PipelineScheduleVariable
Explore with Pulumi AI
The gitlab.PipelineScheduleVariable
resource allows to manage the lifecycle of a variable for a pipeline schedule.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = new gitlab.PipelineSchedule("example", {
project: "12345",
description: "Used to schedule builds",
ref: "master",
cron: "0 1 * * *",
});
const examplePipelineScheduleVariable = new gitlab.PipelineScheduleVariable("example", {
project: example.project,
pipelineScheduleId: example.pipelineScheduleId,
key: "EXAMPLE_KEY",
value: "example",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.PipelineSchedule("example",
project="12345",
description="Used to schedule builds",
ref="master",
cron="0 1 * * *")
example_pipeline_schedule_variable = gitlab.PipelineScheduleVariable("example",
project=example.project,
pipeline_schedule_id=example.pipeline_schedule_id,
key="EXAMPLE_KEY",
value="example")
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 {
example, err := gitlab.NewPipelineSchedule(ctx, "example", &gitlab.PipelineScheduleArgs{
Project: pulumi.String("12345"),
Description: pulumi.String("Used to schedule builds"),
Ref: pulumi.String("master"),
Cron: pulumi.String("0 1 * * *"),
})
if err != nil {
return err
}
_, err = gitlab.NewPipelineScheduleVariable(ctx, "example", &gitlab.PipelineScheduleVariableArgs{
Project: example.Project,
PipelineScheduleId: example.PipelineScheduleId,
Key: pulumi.String("EXAMPLE_KEY"),
Value: pulumi.String("example"),
})
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 example = new GitLab.PipelineSchedule("example", new()
{
Project = "12345",
Description = "Used to schedule builds",
Ref = "master",
Cron = "0 1 * * *",
});
var examplePipelineScheduleVariable = new GitLab.PipelineScheduleVariable("example", new()
{
Project = example.Project,
PipelineScheduleId = example.PipelineScheduleId,
Key = "EXAMPLE_KEY",
Value = "example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.PipelineSchedule;
import com.pulumi.gitlab.PipelineScheduleArgs;
import com.pulumi.gitlab.PipelineScheduleVariable;
import com.pulumi.gitlab.PipelineScheduleVariableArgs;
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 example = new PipelineSchedule("example", PipelineScheduleArgs.builder()
.project("12345")
.description("Used to schedule builds")
.ref("master")
.cron("0 1 * * *")
.build());
var examplePipelineScheduleVariable = new PipelineScheduleVariable("examplePipelineScheduleVariable", PipelineScheduleVariableArgs.builder()
.project(example.project())
.pipelineScheduleId(example.pipelineScheduleId())
.key("EXAMPLE_KEY")
.value("example")
.build());
}
}
resources:
example:
type: gitlab:PipelineSchedule
properties:
project: '12345'
description: Used to schedule builds
ref: master
cron: 0 1 * * *
examplePipelineScheduleVariable:
type: gitlab:PipelineScheduleVariable
name: example
properties:
project: ${example.project}
pipelineScheduleId: ${example.pipelineScheduleId}
key: EXAMPLE_KEY
value: example
Create PipelineScheduleVariable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PipelineScheduleVariable(name: string, args: PipelineScheduleVariableArgs, opts?: CustomResourceOptions);
@overload
def PipelineScheduleVariable(resource_name: str,
args: PipelineScheduleVariableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PipelineScheduleVariable(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
pipeline_schedule_id: Optional[int] = None,
project: Optional[str] = None,
value: Optional[str] = None,
variable_type: Optional[str] = None)
func NewPipelineScheduleVariable(ctx *Context, name string, args PipelineScheduleVariableArgs, opts ...ResourceOption) (*PipelineScheduleVariable, error)
public PipelineScheduleVariable(string name, PipelineScheduleVariableArgs args, CustomResourceOptions? opts = null)
public PipelineScheduleVariable(String name, PipelineScheduleVariableArgs args)
public PipelineScheduleVariable(String name, PipelineScheduleVariableArgs args, CustomResourceOptions options)
type: gitlab:PipelineScheduleVariable
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 PipelineScheduleVariableArgs
- 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 PipelineScheduleVariableArgs
- 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 PipelineScheduleVariableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PipelineScheduleVariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PipelineScheduleVariableArgs
- 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 pipelineScheduleVariableResource = new GitLab.PipelineScheduleVariable("pipelineScheduleVariableResource", new()
{
Key = "string",
PipelineScheduleId = 0,
Project = "string",
Value = "string",
VariableType = "string",
});
example, err := gitlab.NewPipelineScheduleVariable(ctx, "pipelineScheduleVariableResource", &gitlab.PipelineScheduleVariableArgs{
Key: pulumi.String("string"),
PipelineScheduleId: pulumi.Int(0),
Project: pulumi.String("string"),
Value: pulumi.String("string"),
VariableType: pulumi.String("string"),
})
var pipelineScheduleVariableResource = new PipelineScheduleVariable("pipelineScheduleVariableResource", PipelineScheduleVariableArgs.builder()
.key("string")
.pipelineScheduleId(0)
.project("string")
.value("string")
.variableType("string")
.build());
pipeline_schedule_variable_resource = gitlab.PipelineScheduleVariable("pipelineScheduleVariableResource",
key="string",
pipeline_schedule_id=0,
project="string",
value="string",
variable_type="string")
const pipelineScheduleVariableResource = new gitlab.PipelineScheduleVariable("pipelineScheduleVariableResource", {
key: "string",
pipelineScheduleId: 0,
project: "string",
value: "string",
variableType: "string",
});
type: gitlab:PipelineScheduleVariable
properties:
key: string
pipelineScheduleId: 0
project: string
value: string
variableType: string
PipelineScheduleVariable Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The PipelineScheduleVariable resource accepts the following input properties:
- Key string
- Name of the variable.
- Pipeline
Schedule intId - The id of the pipeline schedule.
- Project string
- The id of the project to add the schedule to.
- Value string
- Value of the variable.
- Variable
Type string - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- Key string
- Name of the variable.
- Pipeline
Schedule intId - The id of the pipeline schedule.
- Project string
- The id of the project to add the schedule to.
- Value string
- Value of the variable.
- Variable
Type string - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key String
- Name of the variable.
- pipeline
Schedule IntegerId - The id of the pipeline schedule.
- project String
- The id of the project to add the schedule to.
- value String
- Value of the variable.
- variable
Type String - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key string
- Name of the variable.
- pipeline
Schedule numberId - The id of the pipeline schedule.
- project string
- The id of the project to add the schedule to.
- value string
- Value of the variable.
- variable
Type string - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key str
- Name of the variable.
- pipeline_
schedule_ intid - The id of the pipeline schedule.
- project str
- The id of the project to add the schedule to.
- value str
- Value of the variable.
- variable_
type str - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key String
- Name of the variable.
- pipeline
Schedule NumberId - The id of the pipeline schedule.
- project String
- The id of the project to add the schedule to.
- value String
- Value of the variable.
- variable
Type String - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
Outputs
All input properties are implicitly available as output properties. Additionally, the PipelineScheduleVariable 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 PipelineScheduleVariable Resource
Get an existing PipelineScheduleVariable 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?: PipelineScheduleVariableState, opts?: CustomResourceOptions): PipelineScheduleVariable
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
pipeline_schedule_id: Optional[int] = None,
project: Optional[str] = None,
value: Optional[str] = None,
variable_type: Optional[str] = None) -> PipelineScheduleVariable
func GetPipelineScheduleVariable(ctx *Context, name string, id IDInput, state *PipelineScheduleVariableState, opts ...ResourceOption) (*PipelineScheduleVariable, error)
public static PipelineScheduleVariable Get(string name, Input<string> id, PipelineScheduleVariableState? state, CustomResourceOptions? opts = null)
public static PipelineScheduleVariable get(String name, Output<String> id, PipelineScheduleVariableState 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.
- Key string
- Name of the variable.
- Pipeline
Schedule intId - The id of the pipeline schedule.
- Project string
- The id of the project to add the schedule to.
- Value string
- Value of the variable.
- Variable
Type string - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- Key string
- Name of the variable.
- Pipeline
Schedule intId - The id of the pipeline schedule.
- Project string
- The id of the project to add the schedule to.
- Value string
- Value of the variable.
- Variable
Type string - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key String
- Name of the variable.
- pipeline
Schedule IntegerId - The id of the pipeline schedule.
- project String
- The id of the project to add the schedule to.
- value String
- Value of the variable.
- variable
Type String - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key string
- Name of the variable.
- pipeline
Schedule numberId - The id of the pipeline schedule.
- project string
- The id of the project to add the schedule to.
- value string
- Value of the variable.
- variable
Type string - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key str
- Name of the variable.
- pipeline_
schedule_ intid - The id of the pipeline schedule.
- project str
- The id of the project to add the schedule to.
- value str
- Value of the variable.
- variable_
type str - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
- key String
- Name of the variable.
- pipeline
Schedule NumberId - The id of the pipeline schedule.
- project String
- The id of the project to add the schedule to.
- value String
- Value of the variable.
- variable
Type String - The type of a variable. Available types are:
env_var
,file
. Default isenv_var
.
Import
Pipeline schedule variables can be imported using an id made up of project_id:pipeline_schedule_id:key
, e.g.
$ pulumi import gitlab:index/pipelineScheduleVariable:PipelineScheduleVariable example 123456789:13:mykey
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.