This resource adds permission for a repository to use a Dependabot secret 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 example = new github.DependabotOrganizationSecret("example", {
secretName: "mysecret",
plaintextValue: "foo",
visibility: "selected",
});
const exampleRepository = new github.Repository("example", {
name: "myrepo",
visibility: "public",
});
const exampleDependabotOrganizationSecretRepository = new github.DependabotOrganizationSecretRepository("example", {
secretName: example.name,
repositoryId: exampleRepository.repoId,
});
import pulumi
import pulumi_github as github
example = github.DependabotOrganizationSecret("example",
secret_name="mysecret",
plaintext_value="foo",
visibility="selected")
example_repository = github.Repository("example",
name="myrepo",
visibility="public")
example_dependabot_organization_secret_repository = github.DependabotOrganizationSecretRepository("example",
secret_name=example.name,
repository_id=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.NewDependabotOrganizationSecret(ctx, "example", &github.DependabotOrganizationSecretArgs{
SecretName: pulumi.String("mysecret"),
PlaintextValue: pulumi.String("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.NewDependabotOrganizationSecretRepository(ctx, "example", &github.DependabotOrganizationSecretRepositoryArgs{
SecretName: example.Name,
RepositoryId: 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.DependabotOrganizationSecret("example", new()
{
SecretName = "mysecret",
PlaintextValue = "foo",
Visibility = "selected",
});
var exampleRepository = new Github.Repository("example", new()
{
Name = "myrepo",
Visibility = "public",
});
var exampleDependabotOrganizationSecretRepository = new Github.DependabotOrganizationSecretRepository("example", new()
{
SecretName = example.Name,
RepositoryId = exampleRepository.RepoId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.DependabotOrganizationSecret;
import com.pulumi.github.DependabotOrganizationSecretArgs;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.DependabotOrganizationSecretRepository;
import com.pulumi.github.DependabotOrganizationSecretRepositoryArgs;
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 DependabotOrganizationSecret("example", DependabotOrganizationSecretArgs.builder()
.secretName("mysecret")
.plaintextValue("foo")
.visibility("selected")
.build());
var exampleRepository = new Repository("exampleRepository", RepositoryArgs.builder()
.name("myrepo")
.visibility("public")
.build());
var exampleDependabotOrganizationSecretRepository = new DependabotOrganizationSecretRepository("exampleDependabotOrganizationSecretRepository", DependabotOrganizationSecretRepositoryArgs.builder()
.secretName(example.name())
.repositoryId(exampleRepository.repoId())
.build());
}
}
resources:
example:
type: github:DependabotOrganizationSecret
properties:
secretName: mysecret
plaintextValue: foo
visibility: selected
exampleRepository:
type: github:Repository
name: example
properties:
name: myrepo
visibility: public
exampleDependabotOrganizationSecretRepository:
type: github:DependabotOrganizationSecretRepository
name: example
properties:
secretName: ${example.name}
repositoryId: ${exampleRepository.repoId}
Create DependabotOrganizationSecretRepository Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DependabotOrganizationSecretRepository(name: string, args: DependabotOrganizationSecretRepositoryArgs, opts?: CustomResourceOptions);@overload
def DependabotOrganizationSecretRepository(resource_name: str,
args: DependabotOrganizationSecretRepositoryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DependabotOrganizationSecretRepository(resource_name: str,
opts: Optional[ResourceOptions] = None,
repository_id: Optional[int] = None,
secret_name: Optional[str] = None)func NewDependabotOrganizationSecretRepository(ctx *Context, name string, args DependabotOrganizationSecretRepositoryArgs, opts ...ResourceOption) (*DependabotOrganizationSecretRepository, error)public DependabotOrganizationSecretRepository(string name, DependabotOrganizationSecretRepositoryArgs args, CustomResourceOptions? opts = null)
public DependabotOrganizationSecretRepository(String name, DependabotOrganizationSecretRepositoryArgs args)
public DependabotOrganizationSecretRepository(String name, DependabotOrganizationSecretRepositoryArgs args, CustomResourceOptions options)
type: github:DependabotOrganizationSecretRepository
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 DependabotOrganizationSecretRepositoryArgs
- 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 DependabotOrganizationSecretRepositoryArgs
- 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 DependabotOrganizationSecretRepositoryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DependabotOrganizationSecretRepositoryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DependabotOrganizationSecretRepositoryArgs
- 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 dependabotOrganizationSecretRepositoryResource = new Github.DependabotOrganizationSecretRepository("dependabotOrganizationSecretRepositoryResource", new()
{
RepositoryId = 0,
SecretName = "string",
});
example, err := github.NewDependabotOrganizationSecretRepository(ctx, "dependabotOrganizationSecretRepositoryResource", &github.DependabotOrganizationSecretRepositoryArgs{
RepositoryId: pulumi.Int(0),
SecretName: pulumi.String("string"),
})
var dependabotOrganizationSecretRepositoryResource = new DependabotOrganizationSecretRepository("dependabotOrganizationSecretRepositoryResource", DependabotOrganizationSecretRepositoryArgs.builder()
.repositoryId(0)
.secretName("string")
.build());
dependabot_organization_secret_repository_resource = github.DependabotOrganizationSecretRepository("dependabotOrganizationSecretRepositoryResource",
repository_id=0,
secret_name="string")
const dependabotOrganizationSecretRepositoryResource = new github.DependabotOrganizationSecretRepository("dependabotOrganizationSecretRepositoryResource", {
repositoryId: 0,
secretName: "string",
});
type: github:DependabotOrganizationSecretRepository
properties:
repositoryId: 0
secretName: string
DependabotOrganizationSecretRepository 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 DependabotOrganizationSecretRepository resource accepts the following input properties:
- Repository
Id int - ID of the repository that should be able to access the secret.
- Secret
Name string - Name of the Dependabot organization secret.
- Repository
Id int - ID of the repository that should be able to access the secret.
- Secret
Name string - Name of the Dependabot organization secret.
- repository
Id Integer - ID of the repository that should be able to access the secret.
- secret
Name String - Name of the Dependabot organization secret.
- repository
Id number - ID of the repository that should be able to access the secret.
- secret
Name string - Name of the Dependabot organization secret.
- repository_
id int - ID of the repository that should be able to access the secret.
- secret_
name str - Name of the Dependabot organization secret.
- repository
Id Number - ID of the repository that should be able to access the secret.
- secret
Name String - Name of the Dependabot organization secret.
Outputs
All input properties are implicitly available as output properties. Additionally, the DependabotOrganizationSecretRepository 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 DependabotOrganizationSecretRepository Resource
Get an existing DependabotOrganizationSecretRepository 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?: DependabotOrganizationSecretRepositoryState, opts?: CustomResourceOptions): DependabotOrganizationSecretRepository@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
repository_id: Optional[int] = None,
secret_name: Optional[str] = None) -> DependabotOrganizationSecretRepositoryfunc GetDependabotOrganizationSecretRepository(ctx *Context, name string, id IDInput, state *DependabotOrganizationSecretRepositoryState, opts ...ResourceOption) (*DependabotOrganizationSecretRepository, error)public static DependabotOrganizationSecretRepository Get(string name, Input<string> id, DependabotOrganizationSecretRepositoryState? state, CustomResourceOptions? opts = null)public static DependabotOrganizationSecretRepository get(String name, Output<String> id, DependabotOrganizationSecretRepositoryState state, CustomResourceOptions options)resources: _: type: github:DependabotOrganizationSecretRepository 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.
- Repository
Id int - ID of the repository that should be able to access the secret.
- Secret
Name string - Name of the Dependabot organization secret.
- Repository
Id int - ID of the repository that should be able to access the secret.
- Secret
Name string - Name of the Dependabot organization secret.
- repository
Id Integer - ID of the repository that should be able to access the secret.
- secret
Name String - Name of the Dependabot organization secret.
- repository
Id number - ID of the repository that should be able to access the secret.
- secret
Name string - Name of the Dependabot organization secret.
- repository_
id int - ID of the repository that should be able to access the secret.
- secret_
name str - Name of the Dependabot organization secret.
- repository
Id Number - ID of the repository that should be able to access the secret.
- secret
Name String - Name of the Dependabot organization secret.
Import
Import Command
The following command imports the access of repository ID 123456 for the Dependabot organization secret named mysecret to a v resource named example.
$ pulumi import github:index/dependabotOrganizationSecretRepository:DependabotOrganizationSecretRepository example mysecret:123456
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.
