github.ActionsOrganizationVariable

This resource allows you to create and manage GitHub Actions variables within your GitHub organization. You must have write access to a repository to use this resource.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Github = Pulumi.Github;

return await Deployment.RunAsync(() => 
{
    var exampleVariable = new Github.ActionsOrganizationVariable("exampleVariable", new()
    {
        Value = "example_variable_value",
        VariableName = "example_variable_name",
        Visibility = "private",
    });

});
package main

import (
	"github.com/pulumi/pulumi-github/sdk/v5/go/github"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := github.NewActionsOrganizationVariable(ctx, "exampleVariable", &github.ActionsOrganizationVariableArgs{
			Value:        pulumi.String("example_variable_value"),
			VariableName: pulumi.String("example_variable_name"),
			Visibility:   pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.ActionsOrganizationVariable;
import com.pulumi.github.ActionsOrganizationVariableArgs;
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 ActionsOrganizationVariable("exampleVariable", ActionsOrganizationVariableArgs.builder()        
            .value("example_variable_value")
            .variableName("example_variable_name")
            .visibility("private")
            .build());

    }
}
import pulumi
import pulumi_github as github

example_variable = github.ActionsOrganizationVariable("exampleVariable",
    value="example_variable_value",
    variable_name="example_variable_name",
    visibility="private")
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const exampleVariable = new github.ActionsOrganizationVariable("exampleVariable", {
    value: "example_variable_value",
    variableName: "example_variable_name",
    visibility: "private",
});
resources:
  exampleVariable:
    type: github:ActionsOrganizationVariable
    properties:
      value: example_variable_value
      variableName: example_variable_name
      visibility: private

Coming soon!

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.GithubFunctions;
import com.pulumi.github.inputs.GetRepositoryArgs;
import com.pulumi.github.ActionsOrganizationVariable;
import com.pulumi.github.ActionsOrganizationVariableArgs;
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) {
        final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder()
            .fullName("my-org/repo")
            .build());

        var exampleVariable = new ActionsOrganizationVariable("exampleVariable", ActionsOrganizationVariableArgs.builder()        
            .secretName("example_variable_name")
            .visibility("selected")
            .plaintextValue("example_variable_value")
            .selectedRepositoryIds(repo.applyValue(getRepositoryResult -> getRepositoryResult.repoId()))
            .build());

    }
}

Coming soon!

Coming soon!

resources:
  exampleVariable:
    type: github:ActionsOrganizationVariable
    properties:
      secretName: example_variable_name
      visibility: selected
      plaintextValue: example_variable_value
      selectedRepositoryIds:
        - ${repo.repoId}
variables:
  repo:
    fn::invoke:
      Function: github:getRepository
      Arguments:
        fullName: my-org/repo

Create ActionsOrganizationVariable Resource

new ActionsOrganizationVariable(name: string, args: ActionsOrganizationVariableArgs, opts?: CustomResourceOptions);
@overload
def ActionsOrganizationVariable(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                selected_repository_ids: Optional[Sequence[int]] = None,
                                value: Optional[str] = None,
                                variable_name: Optional[str] = None,
                                visibility: Optional[str] = None)
@overload
def ActionsOrganizationVariable(resource_name: str,
                                args: ActionsOrganizationVariableArgs,
                                opts: Optional[ResourceOptions] = None)
func NewActionsOrganizationVariable(ctx *Context, name string, args ActionsOrganizationVariableArgs, opts ...ResourceOption) (*ActionsOrganizationVariable, error)
public ActionsOrganizationVariable(string name, ActionsOrganizationVariableArgs args, CustomResourceOptions? opts = null)
public ActionsOrganizationVariable(String name, ActionsOrganizationVariableArgs args)
public ActionsOrganizationVariable(String name, ActionsOrganizationVariableArgs args, CustomResourceOptions options)
type: github:ActionsOrganizationVariable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ActionsOrganizationVariableArgs
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 ActionsOrganizationVariableArgs
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 ActionsOrganizationVariableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ActionsOrganizationVariableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ActionsOrganizationVariableArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ActionsOrganizationVariable 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 ActionsOrganizationVariable resource accepts the following input properties:

Value string

Value of the variable

VariableName string

Name of the variable

Visibility string

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

SelectedRepositoryIds List<int>

An array of repository ids that can access the organization variable.

Value string

Value of the variable

VariableName string

Name of the variable

Visibility string

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

SelectedRepositoryIds []int

An array of repository ids that can access the organization variable.

value String

Value of the variable

variableName String

Name of the variable

visibility String

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

selectedRepositoryIds List<Integer>

An array of repository ids that can access the organization variable.

value string

Value of the variable

variableName string

Name of the variable

visibility string

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

selectedRepositoryIds number[]

An array of repository ids that can access the organization variable.

value str

Value of the variable

variable_name str

Name of the variable

visibility str

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

selected_repository_ids Sequence[int]

An array of repository ids that can access the organization variable.

value String

Value of the variable

variableName String

Name of the variable

visibility String

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

selectedRepositoryIds List<Number>

An array of repository ids that can access the organization variable.

Outputs

All input properties are implicitly available as output properties. Additionally, the ActionsOrganizationVariable resource produces the following output properties:

CreatedAt string

Date of actions_variable creation.

Id string

The provider-assigned unique ID for this managed resource.

UpdatedAt string

Date of actions_variable update.

CreatedAt string

Date of actions_variable creation.

Id string

The provider-assigned unique ID for this managed resource.

UpdatedAt string

Date of actions_variable update.

createdAt String

Date of actions_variable creation.

id String

The provider-assigned unique ID for this managed resource.

updatedAt String

Date of actions_variable update.

createdAt string

Date of actions_variable creation.

id string

The provider-assigned unique ID for this managed resource.

updatedAt string

Date of actions_variable update.

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.

createdAt String

Date of actions_variable creation.

id String

The provider-assigned unique ID for this managed resource.

updatedAt String

Date of actions_variable update.

Look up Existing ActionsOrganizationVariable Resource

Get an existing ActionsOrganizationVariable 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?: ActionsOrganizationVariableState, opts?: CustomResourceOptions): ActionsOrganizationVariable
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        selected_repository_ids: Optional[Sequence[int]] = None,
        updated_at: Optional[str] = None,
        value: Optional[str] = None,
        variable_name: Optional[str] = None,
        visibility: Optional[str] = None) -> ActionsOrganizationVariable
func GetActionsOrganizationVariable(ctx *Context, name string, id IDInput, state *ActionsOrganizationVariableState, opts ...ResourceOption) (*ActionsOrganizationVariable, error)
public static ActionsOrganizationVariable Get(string name, Input<string> id, ActionsOrganizationVariableState? state, CustomResourceOptions? opts = null)
public static ActionsOrganizationVariable get(String name, Output<String> id, ActionsOrganizationVariableState 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.
The following state arguments are supported:
CreatedAt string

Date of actions_variable creation.

SelectedRepositoryIds List<int>

An array of repository ids that can access the organization variable.

UpdatedAt string

Date of actions_variable update.

Value string

Value of the variable

VariableName string

Name of the variable

Visibility string

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

CreatedAt string

Date of actions_variable creation.

SelectedRepositoryIds []int

An array of repository ids that can access the organization variable.

UpdatedAt string

Date of actions_variable update.

Value string

Value of the variable

VariableName string

Name of the variable

Visibility string

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

createdAt String

Date of actions_variable creation.

selectedRepositoryIds List<Integer>

An array of repository ids that can access the organization variable.

updatedAt String

Date of actions_variable update.

value String

Value of the variable

variableName String

Name of the variable

visibility String

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

createdAt string

Date of actions_variable creation.

selectedRepositoryIds number[]

An array of repository ids that can access the organization variable.

updatedAt string

Date of actions_variable update.

value string

Value of the variable

variableName string

Name of the variable

visibility string

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

created_at str

Date of actions_variable creation.

selected_repository_ids Sequence[int]

An array of repository ids that can access the organization variable.

updated_at str

Date of actions_variable update.

value str

Value of the variable

variable_name str

Name of the variable

visibility str

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

createdAt String

Date of actions_variable creation.

selectedRepositoryIds List<Number>

An array of repository ids that can access the organization variable.

updatedAt String

Date of actions_variable update.

value String

Value of the variable

variableName String

Name of the variable

visibility String

Configures the access that repositories have to the organization variable. Must be one of all, private, selected. selected_repository_ids is required if set to selected.

Import

This resource can be imported using an ID made up of the variable name

 $ pulumi import github:index/actionsOrganizationVariable:ActionsOrganizationVariable test_variable test_variable_name

Package Details

Repository
GitHub pulumi/pulumi-github
License
Apache-2.0
Notes

This Pulumi package is based on the github Terraform Provider.