UserInvitationAccepter

class UserInvitationAccepter : KotlinCustomResource

Provides a resource to manage GitHub repository collaborator invitations.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const example = new github.Repository("example", {name: "example-repo"});
const exampleRepositoryCollaborator = new github.RepositoryCollaborator("example", {
repository: example.name,
username: "example-username",
permission: "push",
});
const exampleUserInvitationAccepter = new github.UserInvitationAccepter("example", {invitationId: exampleRepositoryCollaborator.invitationId});
import pulumi
import pulumi_github as github
example = github.Repository("example", name="example-repo")
example_repository_collaborator = github.RepositoryCollaborator("example",
repository=example.name,
username="example-username",
permission="push")
example_user_invitation_accepter = github.UserInvitationAccepter("example", invitation_id=example_repository_collaborator.invitation_id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var example = new Github.Repository("example", new()
{
Name = "example-repo",
});
var exampleRepositoryCollaborator = new Github.RepositoryCollaborator("example", new()
{
Repository = example.Name,
Username = "example-username",
Permission = "push",
});
var exampleUserInvitationAccepter = new Github.UserInvitationAccepter("example", new()
{
InvitationId = exampleRepositoryCollaborator.InvitationId,
});
});
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.NewRepository(ctx, "example", &github.RepositoryArgs{
Name: pulumi.String("example-repo"),
})
if err != nil {
return err
}
exampleRepositoryCollaborator, err := github.NewRepositoryCollaborator(ctx, "example", &github.RepositoryCollaboratorArgs{
Repository: example.Name,
Username: pulumi.String("example-username"),
Permission: pulumi.String("push"),
})
if err != nil {
return err
}
_, err = github.NewUserInvitationAccepter(ctx, "example", &github.UserInvitationAccepterArgs{
InvitationId: exampleRepositoryCollaborator.InvitationId,
})
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.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.RepositoryCollaborator;
import com.pulumi.github.RepositoryCollaboratorArgs;
import com.pulumi.github.UserInvitationAccepter;
import com.pulumi.github.UserInvitationAccepterArgs;
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 Repository("example", RepositoryArgs.builder()
.name("example-repo")
.build());
var exampleRepositoryCollaborator = new RepositoryCollaborator("exampleRepositoryCollaborator", RepositoryCollaboratorArgs.builder()
.repository(example.name())
.username("example-username")
.permission("push")
.build());
var exampleUserInvitationAccepter = new UserInvitationAccepter("exampleUserInvitationAccepter", UserInvitationAccepterArgs.builder()
.invitationId(exampleRepositoryCollaborator.invitationId())
.build());
}
}
resources:
example:
type: github:Repository
properties:
name: example-repo
exampleRepositoryCollaborator:
type: github:RepositoryCollaborator
name: example
properties:
repository: ${example.name}
username: example-username
permission: push
exampleUserInvitationAccepter:
type: github:UserInvitationAccepter
name: example
properties:
invitationId: ${exampleRepositoryCollaborator.invitationId}

Allowing empty invitation IDs

Set allow_empty_id when using for_each over a list of github_repository_collaborator.invitation_id's. This allows applying a module again when a new github.RepositoryCollaborator resource is added to the for_each loop. This is needed as the github_repository_collaborator.invitation_id will be empty after a state refresh when the invitation has been accepted. Note that when an invitation is accepted manually or by another tool between a state refresh and a pulumi up using that refreshed state, the plan will contain the invitation ID, but the apply will receive an HTTP 404 from the API since the invitation has already been accepted. This is tracked in #1157.

Properties

Link copied to clipboard
val allowEmptyId: Output<Boolean>?

Allow the ID to be unset. This will result in the resource being skipped when the ID is not set instead of returning an error.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val invitationId: Output<String>?

ID of the invitation to accept. Must be set when allow_empty_id is false.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>