github.ActionsVariable
Explore with Pulumi AI
This resource allows you to create and manage GitHub Actions variables within your GitHub repositories. You must have write access to a repository to use this resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const exampleVariable = new github.ActionsVariable("example_variable", {
repository: "example_repository",
variableName: "example_variable_name",
value: "example_variable_value",
});
import pulumi
import pulumi_github as github
example_variable = github.ActionsVariable("example_variable",
repository="example_repository",
variable_name="example_variable_name",
value="example_variable_value")
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.NewActionsVariable(ctx, "example_variable", &github.ActionsVariableArgs{
Repository: pulumi.String("example_repository"),
VariableName: pulumi.String("example_variable_name"),
Value: pulumi.String("example_variable_value"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var exampleVariable = new Github.ActionsVariable("example_variable", new()
{
Repository = "example_repository",
VariableName = "example_variable_name",
Value = "example_variable_value",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.ActionsVariable;
import com.pulumi.github.ActionsVariableArgs;
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 exampleVariable = new ActionsVariable("exampleVariable", ActionsVariableArgs.builder()
.repository("example_repository")
.variableName("example_variable_name")
.value("example_variable_value")
.build());
}
}
resources:
exampleVariable:
type: github:ActionsVariable
name: example_variable
properties:
repository: example_repository
variableName: example_variable_name
value: example_variable_value
Create ActionsVariable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ActionsVariable(name: string, args: ActionsVariableArgs, opts?: CustomResourceOptions);
@overload
def ActionsVariable(resource_name: str,
args: ActionsVariableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ActionsVariable(resource_name: str,
opts: Optional[ResourceOptions] = None,
repository: Optional[str] = None,
value: Optional[str] = None,
variable_name: Optional[str] = None)
func NewActionsVariable(ctx *Context, name string, args ActionsVariableArgs, opts ...ResourceOption) (*ActionsVariable, error)
public ActionsVariable(string name, ActionsVariableArgs args, CustomResourceOptions? opts = null)
public ActionsVariable(String name, ActionsVariableArgs args)
public ActionsVariable(String name, ActionsVariableArgs args, CustomResourceOptions options)
type: github:ActionsVariable
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 ActionsVariableArgs
- 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 ActionsVariableArgs
- 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 ActionsVariableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ActionsVariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ActionsVariableArgs
- 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 actionsVariableResource = new Github.ActionsVariable("actionsVariableResource", new()
{
Repository = "string",
Value = "string",
VariableName = "string",
});
example, err := github.NewActionsVariable(ctx, "actionsVariableResource", &github.ActionsVariableArgs{
Repository: pulumi.String("string"),
Value: pulumi.String("string"),
VariableName: pulumi.String("string"),
})
var actionsVariableResource = new ActionsVariable("actionsVariableResource", ActionsVariableArgs.builder()
.repository("string")
.value("string")
.variableName("string")
.build());
actions_variable_resource = github.ActionsVariable("actionsVariableResource",
repository="string",
value="string",
variable_name="string")
const actionsVariableResource = new github.ActionsVariable("actionsVariableResource", {
repository: "string",
value: "string",
variableName: "string",
});
type: github:ActionsVariable
properties:
repository: string
value: string
variableName: string
ActionsVariable 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 ActionsVariable resource accepts the following input properties:
- Repository string
- Name of the repository
- Value string
- Value of the variable
- Variable
Name string - Name of the variable
- Repository string
- Name of the repository
- Value string
- Value of the variable
- Variable
Name string - Name of the variable
- repository String
- Name of the repository
- value String
- Value of the variable
- variable
Name String - Name of the variable
- repository string
- Name of the repository
- value string
- Value of the variable
- variable
Name string - Name of the variable
- repository str
- Name of the repository
- value str
- Value of the variable
- variable_
name str - Name of the variable
- repository String
- Name of the repository
- value String
- Value of the variable
- variable
Name String - Name of the variable
Outputs
All input properties are implicitly available as output properties. Additionally, the ActionsVariable resource produces the following output properties:
- created_
at str - Date of actions_variable creation.
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
at str - Date of actions_variable update.
Look up Existing ActionsVariable Resource
Get an existing ActionsVariable 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?: ActionsVariableState, opts?: CustomResourceOptions): ActionsVariable
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
repository: Optional[str] = None,
updated_at: Optional[str] = None,
value: Optional[str] = None,
variable_name: Optional[str] = None) -> ActionsVariable
func GetActionsVariable(ctx *Context, name string, id IDInput, state *ActionsVariableState, opts ...ResourceOption) (*ActionsVariable, error)
public static ActionsVariable Get(string name, Input<string> id, ActionsVariableState? state, CustomResourceOptions? opts = null)
public static ActionsVariable get(String name, Output<String> id, ActionsVariableState 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.
- Created
At string - Date of actions_variable creation.
- Repository string
- Name of the repository
- Updated
At string - Date of actions_variable update.
- Value string
- Value of the variable
- Variable
Name string - Name of the variable
- Created
At string - Date of actions_variable creation.
- Repository string
- Name of the repository
- Updated
At string - Date of actions_variable update.
- Value string
- Value of the variable
- Variable
Name string - Name of the variable
- created
At String - Date of actions_variable creation.
- repository String
- Name of the repository
- updated
At String - Date of actions_variable update.
- value String
- Value of the variable
- variable
Name String - Name of the variable
- created
At string - Date of actions_variable creation.
- repository string
- Name of the repository
- updated
At string - Date of actions_variable update.
- value string
- Value of the variable
- variable
Name string - Name of the variable
- created_
at str - Date of actions_variable creation.
- repository str
- Name of the repository
- updated_
at str - Date of actions_variable update.
- value str
- Value of the variable
- variable_
name str - Name of the variable
- created
At String - Date of actions_variable creation.
- repository String
- Name of the repository
- updated
At String - Date of actions_variable update.
- value String
- Value of the variable
- variable
Name String - Name of the variable
Import
GitHub Actions variables can be imported using an ID made up of repository:variable_name
, e.g.
$ pulumi import github:index/actionsVariable:ActionsVariable myvariable myrepo:myvariable
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
github
Terraform Provider.