sonarqube.GithubBinding
Explore with Pulumi AI
Provides a Sonarqube GitHub binding resource. This can be used to create and manage the binding between a GitHub repository and a SonarQube project
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as sonarqube from "@pulumi/sonarqube";
const github_alm = new sonarqube.AlmGithub("github-alm", {
appId: "12345",
clientId: "56789",
clientSecret: "secret",
key: "myalm",
privateKey: "myprivate_key",
url: "https://api.github.com",
webhookSecret: "mysecret",
});
const main = new sonarqube.Project("main", {
project: "my_project",
visibility: "public",
});
const github_binding = new sonarqube.GithubBinding("github-binding", {
almSetting: github_alm.key,
project: "my_project",
repository: "myorg/myrepo",
});
import pulumi
import pulumi_sonarqube as sonarqube
github_alm = sonarqube.AlmGithub("github-alm",
app_id="12345",
client_id="56789",
client_secret="secret",
key="myalm",
private_key="myprivate_key",
url="https://api.github.com",
webhook_secret="mysecret")
main = sonarqube.Project("main",
project="my_project",
visibility="public")
github_binding = sonarqube.GithubBinding("github-binding",
alm_setting=github_alm.key,
project="my_project",
repository="myorg/myrepo")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/sonarqube/sonarqube"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
github_alm, err := sonarqube.NewAlmGithub(ctx, "github-alm", &sonarqube.AlmGithubArgs{
AppId: pulumi.String("12345"),
ClientId: pulumi.String("56789"),
ClientSecret: pulumi.String("secret"),
Key: pulumi.String("myalm"),
PrivateKey: pulumi.String("myprivate_key"),
Url: pulumi.String("https://api.github.com"),
WebhookSecret: pulumi.String("mysecret"),
})
if err != nil {
return err
}
_, err = sonarqube.NewProject(ctx, "main", &sonarqube.ProjectArgs{
Project: pulumi.String("my_project"),
Visibility: pulumi.String("public"),
})
if err != nil {
return err
}
_, err = sonarqube.NewGithubBinding(ctx, "github-binding", &sonarqube.GithubBindingArgs{
AlmSetting: github_alm.Key,
Project: pulumi.String("my_project"),
Repository: pulumi.String("myorg/myrepo"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sonarqube = Pulumi.Sonarqube;
return await Deployment.RunAsync(() =>
{
var github_alm = new Sonarqube.AlmGithub("github-alm", new()
{
AppId = "12345",
ClientId = "56789",
ClientSecret = "secret",
Key = "myalm",
PrivateKey = "myprivate_key",
Url = "https://api.github.com",
WebhookSecret = "mysecret",
});
var main = new Sonarqube.Project("main", new()
{
Project = "my_project",
Visibility = "public",
});
var github_binding = new Sonarqube.GithubBinding("github-binding", new()
{
AlmSetting = github_alm.Key,
Project = "my_project",
Repository = "myorg/myrepo",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sonarqube.AlmGithub;
import com.pulumi.sonarqube.AlmGithubArgs;
import com.pulumi.sonarqube.Project;
import com.pulumi.sonarqube.ProjectArgs;
import com.pulumi.sonarqube.GithubBinding;
import com.pulumi.sonarqube.GithubBindingArgs;
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 github_alm = new AlmGithub("github-alm", AlmGithubArgs.builder()
.appId("12345")
.clientId("56789")
.clientSecret("secret")
.key("myalm")
.privateKey("myprivate_key")
.url("https://api.github.com")
.webhookSecret("mysecret")
.build());
var main = new Project("main", ProjectArgs.builder()
.project("my_project")
.visibility("public")
.build());
var github_binding = new GithubBinding("github-binding", GithubBindingArgs.builder()
.almSetting(github_alm.key())
.project("my_project")
.repository("myorg/myrepo")
.build());
}
}
resources:
github-alm:
type: sonarqube:AlmGithub
properties:
appId: '12345'
clientId: '56789'
clientSecret: secret
key: myalm
privateKey: myprivate_key
url: https://api.github.com
webhookSecret: mysecret
main:
type: sonarqube:Project
properties:
project: my_project
visibility: public
github-binding:
type: sonarqube:GithubBinding
properties:
almSetting: ${["github-alm"].key}
project: my_project
repository: myorg/myrepo
Create GithubBinding Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GithubBinding(name: string, args: GithubBindingArgs, opts?: CustomResourceOptions);
@overload
def GithubBinding(resource_name: str,
args: GithubBindingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GithubBinding(resource_name: str,
opts: Optional[ResourceOptions] = None,
alm_setting: Optional[str] = None,
project: Optional[str] = None,
repository: Optional[str] = None,
github_binding_id: Optional[str] = None,
monorepo: Optional[str] = None,
summary_comment_enabled: Optional[str] = None)
func NewGithubBinding(ctx *Context, name string, args GithubBindingArgs, opts ...ResourceOption) (*GithubBinding, error)
public GithubBinding(string name, GithubBindingArgs args, CustomResourceOptions? opts = null)
public GithubBinding(String name, GithubBindingArgs args)
public GithubBinding(String name, GithubBindingArgs args, CustomResourceOptions options)
type: sonarqube:GithubBinding
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 GithubBindingArgs
- 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 GithubBindingArgs
- 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 GithubBindingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GithubBindingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GithubBindingArgs
- 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 githubBindingResource = new Sonarqube.GithubBinding("githubBindingResource", new()
{
AlmSetting = "string",
Project = "string",
Repository = "string",
GithubBindingId = "string",
Monorepo = "string",
SummaryCommentEnabled = "string",
});
example, err := sonarqube.NewGithubBinding(ctx, "githubBindingResource", &sonarqube.GithubBindingArgs{
AlmSetting: pulumi.String("string"),
Project: pulumi.String("string"),
Repository: pulumi.String("string"),
GithubBindingId: pulumi.String("string"),
Monorepo: pulumi.String("string"),
SummaryCommentEnabled: pulumi.String("string"),
})
var githubBindingResource = new GithubBinding("githubBindingResource", GithubBindingArgs.builder()
.almSetting("string")
.project("string")
.repository("string")
.githubBindingId("string")
.monorepo("string")
.summaryCommentEnabled("string")
.build());
github_binding_resource = sonarqube.GithubBinding("githubBindingResource",
alm_setting="string",
project="string",
repository="string",
github_binding_id="string",
monorepo="string",
summary_comment_enabled="string")
const githubBindingResource = new sonarqube.GithubBinding("githubBindingResource", {
almSetting: "string",
project: "string",
repository: "string",
githubBindingId: "string",
monorepo: "string",
summaryCommentEnabled: "string",
});
type: sonarqube:GithubBinding
properties:
almSetting: string
githubBindingId: string
monorepo: string
project: string
repository: string
summaryCommentEnabled: string
GithubBinding 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 GithubBinding resource accepts the following input properties:
- Alm
Setting string - GitHub ALM setting key
- Project string
- Project key
- Repository string
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- Github
Binding stringId - The ID of this resource.
- Monorepo string
- Is this project part of a monorepo. Default value: false
- Summary
Comment stringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- Alm
Setting string - GitHub ALM setting key
- Project string
- Project key
- Repository string
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- Github
Binding stringId - The ID of this resource.
- Monorepo string
- Is this project part of a monorepo. Default value: false
- Summary
Comment stringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- alm
Setting String - GitHub ALM setting key
- project String
- Project key
- repository String
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- github
Binding StringId - The ID of this resource.
- monorepo String
- Is this project part of a monorepo. Default value: false
- summary
Comment StringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- alm
Setting string - GitHub ALM setting key
- project string
- Project key
- repository string
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- github
Binding stringId - The ID of this resource.
- monorepo string
- Is this project part of a monorepo. Default value: false
- summary
Comment stringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- alm_
setting str - GitHub ALM setting key
- project str
- Project key
- repository str
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- github_
binding_ strid - The ID of this resource.
- monorepo str
- Is this project part of a monorepo. Default value: false
- summary_
comment_ strenabled - Enable/disable summary in PR discussion tab. Default value: true
- alm
Setting String - GitHub ALM setting key
- project String
- Project key
- repository String
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- github
Binding StringId - The ID of this resource.
- monorepo String
- Is this project part of a monorepo. Default value: false
- summary
Comment StringEnabled - Enable/disable summary in PR discussion tab. Default value: true
Outputs
All input properties are implicitly available as output properties. Additionally, the GithubBinding 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 GithubBinding Resource
Get an existing GithubBinding 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?: GithubBindingState, opts?: CustomResourceOptions): GithubBinding
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alm_setting: Optional[str] = None,
github_binding_id: Optional[str] = None,
monorepo: Optional[str] = None,
project: Optional[str] = None,
repository: Optional[str] = None,
summary_comment_enabled: Optional[str] = None) -> GithubBinding
func GetGithubBinding(ctx *Context, name string, id IDInput, state *GithubBindingState, opts ...ResourceOption) (*GithubBinding, error)
public static GithubBinding Get(string name, Input<string> id, GithubBindingState? state, CustomResourceOptions? opts = null)
public static GithubBinding get(String name, Output<String> id, GithubBindingState state, CustomResourceOptions options)
resources: _: type: sonarqube:GithubBinding 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.
- Alm
Setting string - GitHub ALM setting key
- Github
Binding stringId - The ID of this resource.
- Monorepo string
- Is this project part of a monorepo. Default value: false
- Project string
- Project key
- Repository string
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- Summary
Comment stringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- Alm
Setting string - GitHub ALM setting key
- Github
Binding stringId - The ID of this resource.
- Monorepo string
- Is this project part of a monorepo. Default value: false
- Project string
- Project key
- Repository string
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- Summary
Comment stringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- alm
Setting String - GitHub ALM setting key
- github
Binding StringId - The ID of this resource.
- monorepo String
- Is this project part of a monorepo. Default value: false
- project String
- Project key
- repository String
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- summary
Comment StringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- alm
Setting string - GitHub ALM setting key
- github
Binding stringId - The ID of this resource.
- monorepo string
- Is this project part of a monorepo. Default value: false
- project string
- Project key
- repository string
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- summary
Comment stringEnabled - Enable/disable summary in PR discussion tab. Default value: true
- alm_
setting str - GitHub ALM setting key
- github_
binding_ strid - The ID of this resource.
- monorepo str
- Is this project part of a monorepo. Default value: false
- project str
- Project key
- repository str
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- summary_
comment_ strenabled - Enable/disable summary in PR discussion tab. Default value: true
- alm
Setting String - GitHub ALM setting key
- github
Binding StringId - The ID of this resource.
- monorepo String
- Is this project part of a monorepo. Default value: false
- project String
- Project key
- repository String
- The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256
- summary
Comment StringEnabled - Enable/disable summary in PR discussion tab. Default value: true
Package Details
- Repository
- sonarqube jdamata/terraform-provider-sonarqube
- License
- Notes
- This Pulumi package is based on the
sonarqube
Terraform Provider.