This resource allows you to manage the repositories allowed to access an actions variable within your GitHub organization. You must have write access to an organization variable to use this resource.
This resource is only applicable when visibility of the existing organization variable has been set to selected.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const example = new github.ActionsOrganizationVariable("example", {
variableName: "myvariable",
plaintextValue: "foo",
visibility: "selected",
});
const exampleRepository = new github.Repository("example", {
name: "myrepo",
visibility: "public",
});
const exampleActionsOrganizationVariableRepositories = new github.ActionsOrganizationVariableRepositories("example", {
variableName: example.name,
selectedRepositoryIds: [exampleRepository.repoId],
});
import pulumi
import pulumi_github as github
example = github.ActionsOrganizationVariable("example",
variable_name="myvariable",
plaintext_value="foo",
visibility="selected")
example_repository = github.Repository("example",
name="myrepo",
visibility="public")
example_actions_organization_variable_repositories = github.ActionsOrganizationVariableRepositories("example",
variable_name=example.name,
selected_repository_ids=[example_repository.repo_id])
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 {
example, err := github.NewActionsOrganizationVariable(ctx, "example", &github.ActionsOrganizationVariableArgs{
VariableName: pulumi.String("myvariable"),
PlaintextValue: "foo",
Visibility: pulumi.String("selected"),
})
if err != nil {
return err
}
exampleRepository, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{
Name: pulumi.String("myrepo"),
Visibility: pulumi.String("public"),
})
if err != nil {
return err
}
_, err = github.NewActionsOrganizationVariableRepositories(ctx, "example", &github.ActionsOrganizationVariableRepositoriesArgs{
VariableName: example.Name,
SelectedRepositoryIds: pulumi.IntArray{
exampleRepository.RepoId,
},
})
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 example = new Github.ActionsOrganizationVariable("example", new()
{
VariableName = "myvariable",
PlaintextValue = "foo",
Visibility = "selected",
});
var exampleRepository = new Github.Repository("example", new()
{
Name = "myrepo",
Visibility = "public",
});
var exampleActionsOrganizationVariableRepositories = new Github.ActionsOrganizationVariableRepositories("example", new()
{
VariableName = example.Name,
SelectedRepositoryIds = new[]
{
exampleRepository.RepoId,
},
});
});
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 com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.ActionsOrganizationVariableRepositories;
import com.pulumi.github.ActionsOrganizationVariableRepositoriesArgs;
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 ActionsOrganizationVariable("example", ActionsOrganizationVariableArgs.builder()
.variableName("myvariable")
.plaintextValue("foo")
.visibility("selected")
.build());
var exampleRepository = new Repository("exampleRepository", RepositoryArgs.builder()
.name("myrepo")
.visibility("public")
.build());
var exampleActionsOrganizationVariableRepositories = new ActionsOrganizationVariableRepositories("exampleActionsOrganizationVariableRepositories", ActionsOrganizationVariableRepositoriesArgs.builder()
.variableName(example.name())
.selectedRepositoryIds(exampleRepository.repoId())
.build());
}
}
resources:
example:
type: github:ActionsOrganizationVariable
properties:
variableName: myvariable
plaintextValue: foo
visibility: selected
exampleRepository:
type: github:Repository
name: example
properties:
name: myrepo
visibility: public
exampleActionsOrganizationVariableRepositories:
type: github:ActionsOrganizationVariableRepositories
name: example
properties:
variableName: ${example.name}
selectedRepositoryIds:
- ${exampleRepository.repoId}
Create ActionsOrganizationVariableRepositories Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ActionsOrganizationVariableRepositories(name: string, args: ActionsOrganizationVariableRepositoriesArgs, opts?: CustomResourceOptions);@overload
def ActionsOrganizationVariableRepositories(resource_name: str,
args: ActionsOrganizationVariableRepositoriesArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ActionsOrganizationVariableRepositories(resource_name: str,
opts: Optional[ResourceOptions] = None,
selected_repository_ids: Optional[Sequence[int]] = None,
variable_name: Optional[str] = None)func NewActionsOrganizationVariableRepositories(ctx *Context, name string, args ActionsOrganizationVariableRepositoriesArgs, opts ...ResourceOption) (*ActionsOrganizationVariableRepositories, error)public ActionsOrganizationVariableRepositories(string name, ActionsOrganizationVariableRepositoriesArgs args, CustomResourceOptions? opts = null)
public ActionsOrganizationVariableRepositories(String name, ActionsOrganizationVariableRepositoriesArgs args)
public ActionsOrganizationVariableRepositories(String name, ActionsOrganizationVariableRepositoriesArgs args, CustomResourceOptions options)
type: github:ActionsOrganizationVariableRepositories
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 ActionsOrganizationVariableRepositoriesArgs
- 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 ActionsOrganizationVariableRepositoriesArgs
- 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 ActionsOrganizationVariableRepositoriesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ActionsOrganizationVariableRepositoriesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ActionsOrganizationVariableRepositoriesArgs
- 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 actionsOrganizationVariableRepositoriesResource = new Github.ActionsOrganizationVariableRepositories("actionsOrganizationVariableRepositoriesResource", new()
{
SelectedRepositoryIds = new[]
{
0,
},
VariableName = "string",
});
example, err := github.NewActionsOrganizationVariableRepositories(ctx, "actionsOrganizationVariableRepositoriesResource", &github.ActionsOrganizationVariableRepositoriesArgs{
SelectedRepositoryIds: pulumi.IntArray{
pulumi.Int(0),
},
VariableName: pulumi.String("string"),
})
var actionsOrganizationVariableRepositoriesResource = new ActionsOrganizationVariableRepositories("actionsOrganizationVariableRepositoriesResource", ActionsOrganizationVariableRepositoriesArgs.builder()
.selectedRepositoryIds(0)
.variableName("string")
.build());
actions_organization_variable_repositories_resource = github.ActionsOrganizationVariableRepositories("actionsOrganizationVariableRepositoriesResource",
selected_repository_ids=[0],
variable_name="string")
const actionsOrganizationVariableRepositoriesResource = new github.ActionsOrganizationVariableRepositories("actionsOrganizationVariableRepositoriesResource", {
selectedRepositoryIds: [0],
variableName: "string",
});
type: github:ActionsOrganizationVariableRepositories
properties:
selectedRepositoryIds:
- 0
variableName: string
ActionsOrganizationVariableRepositories 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 ActionsOrganizationVariableRepositories resource accepts the following input properties:
- Selected
Repository List<int>Ids - List of IDs for the repositories that should be able to access the variable.
- Variable
Name string - Name of the actions organization variable.
- Selected
Repository []intIds - List of IDs for the repositories that should be able to access the variable.
- Variable
Name string - Name of the actions organization variable.
- selected
Repository List<Integer>Ids - List of IDs for the repositories that should be able to access the variable.
- variable
Name String - Name of the actions organization variable.
- selected
Repository number[]Ids - List of IDs for the repositories that should be able to access the variable.
- variable
Name string - Name of the actions organization variable.
- selected_
repository_ Sequence[int]ids - List of IDs for the repositories that should be able to access the variable.
- variable_
name str - Name of the actions organization variable.
- selected
Repository List<Number>Ids - List of IDs for the repositories that should be able to access the variable.
- variable
Name String - Name of the actions organization variable.
Outputs
All input properties are implicitly available as output properties. Additionally, the ActionsOrganizationVariableRepositories 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 ActionsOrganizationVariableRepositories Resource
Get an existing ActionsOrganizationVariableRepositories 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?: ActionsOrganizationVariableRepositoriesState, opts?: CustomResourceOptions): ActionsOrganizationVariableRepositories@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
selected_repository_ids: Optional[Sequence[int]] = None,
variable_name: Optional[str] = None) -> ActionsOrganizationVariableRepositoriesfunc GetActionsOrganizationVariableRepositories(ctx *Context, name string, id IDInput, state *ActionsOrganizationVariableRepositoriesState, opts ...ResourceOption) (*ActionsOrganizationVariableRepositories, error)public static ActionsOrganizationVariableRepositories Get(string name, Input<string> id, ActionsOrganizationVariableRepositoriesState? state, CustomResourceOptions? opts = null)public static ActionsOrganizationVariableRepositories get(String name, Output<String> id, ActionsOrganizationVariableRepositoriesState state, CustomResourceOptions options)resources: _: type: github:ActionsOrganizationVariableRepositories 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.
- Selected
Repository List<int>Ids - List of IDs for the repositories that should be able to access the variable.
- Variable
Name string - Name of the actions organization variable.
- Selected
Repository []intIds - List of IDs for the repositories that should be able to access the variable.
- Variable
Name string - Name of the actions organization variable.
- selected
Repository List<Integer>Ids - List of IDs for the repositories that should be able to access the variable.
- variable
Name String - Name of the actions organization variable.
- selected
Repository number[]Ids - List of IDs for the repositories that should be able to access the variable.
- variable
Name string - Name of the actions organization variable.
- selected_
repository_ Sequence[int]ids - List of IDs for the repositories that should be able to access the variable.
- variable_
name str - Name of the actions organization variable.
- selected
Repository List<Number>Ids - List of IDs for the repositories that should be able to access the variable.
- variable
Name String - Name of the actions organization variable.
Import
Import Command
The following command imports the repositories able to access the actions organization variable named myvariable to a github_actions_organization_variable_repositories resource named example.
$ pulumi import github:index/actionsOrganizationVariableRepositories:ActionsOrganizationVariableRepositories example 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
githubTerraform Provider.
