CodespacesOrganizationSecretRepositoriesArgs

data class CodespacesOrganizationSecretRepositoriesArgs(val secretName: Output<String>? = null, val selectedRepositoryIds: Output<List<Int>>? = null) : ConvertibleToJava<CodespacesOrganizationSecretRepositoriesArgs>

This resource allows you to manage repository allow list for existing GitHub Codespaces secrets within your GitHub organization. You must have write access to an organization secret to use this resource. This resource is only applicable when visibility of the existing organization secret has been set to selected.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const repo = github.getRepository({
fullName: "my-org/repo",
});
const orgSecretRepos = new github.CodespacesOrganizationSecretRepositories("org_secret_repos", {
secretName: "existing_secret_name",
selectedRepositoryIds: [repo&#46;then(repo => repo&#46;repoId)],
});
import pulumi
import pulumi_github as github
repo = github.get_repository(full_name="my-org/repo")
org_secret_repos = github.CodespacesOrganizationSecretRepositories("org_secret_repos",
secret_name="existing_secret_name",
selected_repository_ids=[repo&#46;repo_id])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var repo = Github.GetRepository.Invoke(new()
{
FullName = "my-org/repo",
});
var orgSecretRepos = new Github.CodespacesOrganizationSecretRepositories("org_secret_repos", new()
{
SecretName = "existing_secret_name",
SelectedRepositoryIds = new[]
{
repo.Apply(getRepositoryResult => getRepositoryResult.RepoId),
},
});
});
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 {
repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{
FullName: pulumi.StringRef("my-org/repo"),
}, nil)
if err != nil {
return err
}
_, err = github.NewCodespacesOrganizationSecretRepositories(ctx, "org_secret_repos", &github.CodespacesOrganizationSecretRepositoriesArgs{
SecretName: pulumi.String("existing_secret_name"),
SelectedRepositoryIds: pulumi.IntArray{
pulumi.Int(repo.RepoId),
},
})
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.GithubFunctions;
import com.pulumi.github.inputs.GetRepositoryArgs;
import com.pulumi.github.CodespacesOrganizationSecretRepositories;
import com.pulumi.github.CodespacesOrganizationSecretRepositoriesArgs;
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 orgSecretRepos = new CodespacesOrganizationSecretRepositories("orgSecretRepos", CodespacesOrganizationSecretRepositoriesArgs.builder()
.secretName("existing_secret_name")
.selectedRepositoryIds(repo.applyValue(getRepositoryResult -> getRepositoryResult.repoId()))
.build());
}
}
resources:
orgSecretRepos:
type: github:CodespacesOrganizationSecretRepositories
name: org_secret_repos
properties:
secretName: existing_secret_name
selectedRepositoryIds:
- ${repo.repoId}
variables:
repo:
fn::invoke:
function: github:getRepository
arguments:
fullName: my-org/repo

Import

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

$ pulumi import github:index/codespacesOrganizationSecretRepositories:CodespacesOrganizationSecretRepositories org_secret_repos existing_secret_name

Constructors

constructor(secretName: Output<String>? = null, selectedRepositoryIds: Output<List<Int>>? = null)

Properties

Link copied to clipboard
val secretName: Output<String>? = null

Name of the existing secret

Link copied to clipboard
val selectedRepositoryIds: Output<List<Int>>? = null

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

Functions

Link copied to clipboard
open override fun toJava(): CodespacesOrganizationSecretRepositoriesArgs