sonarqube.Webhook
Explore with Pulumi AI
Provides a Sonarqube Webhook resource. This can be used to manage Sonarqube webhooks.
Example Usage
Example: create a webhook
import * as pulumi from "@pulumi/pulumi";
import * as sonarqube from "@pulumi/sonarqube";
const webhook = new sonarqube.Webhook("webhook", {url: "https://my-webhook-destination.example.com"});
import pulumi
import pulumi_sonarqube as sonarqube
webhook = sonarqube.Webhook("webhook", url="https://my-webhook-destination.example.com")
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 {
_, err := sonarqube.NewWebhook(ctx, "webhook", &sonarqube.WebhookArgs{
Url: pulumi.String("https://my-webhook-destination.example.com"),
})
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 webhook = new Sonarqube.Webhook("webhook", new()
{
Url = "https://my-webhook-destination.example.com",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sonarqube.Webhook;
import com.pulumi.sonarqube.WebhookArgs;
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 webhook = new Webhook("webhook", WebhookArgs.builder()
.url("https://my-webhook-destination.example.com")
.build());
}
}
resources:
webhook:
type: sonarqube:Webhook
properties:
url: https://my-webhook-destination.example.com
Example: create a webhook owned by a project
import * as pulumi from "@pulumi/pulumi";
import * as sonarqube from "@pulumi/sonarqube";
const project = new sonarqube.Project("project", {
project: "project",
visibility: "public",
});
const webhook = new sonarqube.Webhook("webhook", {
url: "https://my-webhook-destination.example.com",
project: project.name,
});
import pulumi
import pulumi_sonarqube as sonarqube
project = sonarqube.Project("project",
project="project",
visibility="public")
webhook = sonarqube.Webhook("webhook",
url="https://my-webhook-destination.example.com",
project=project.name)
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 {
project, err := sonarqube.NewProject(ctx, "project", &sonarqube.ProjectArgs{
Project: pulumi.String("project"),
Visibility: pulumi.String("public"),
})
if err != nil {
return err
}
_, err = sonarqube.NewWebhook(ctx, "webhook", &sonarqube.WebhookArgs{
Url: pulumi.String("https://my-webhook-destination.example.com"),
Project: project.Name,
})
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 project = new Sonarqube.Project("project", new()
{
Project = "project",
Visibility = "public",
});
var webhook = new Sonarqube.Webhook("webhook", new()
{
Url = "https://my-webhook-destination.example.com",
Project = project.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sonarqube.Project;
import com.pulumi.sonarqube.ProjectArgs;
import com.pulumi.sonarqube.Webhook;
import com.pulumi.sonarqube.WebhookArgs;
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 project = new Project("project", ProjectArgs.builder()
.project("project")
.visibility("public")
.build());
var webhook = new Webhook("webhook", WebhookArgs.builder()
.url("https://my-webhook-destination.example.com")
.project(project.name())
.build());
}
}
resources:
project:
type: sonarqube:Project
properties:
project: project
visibility: public
webhook:
type: sonarqube:Webhook
properties:
url: https://my-webhook-destination.example.com
project: ${project.name}
Create Webhook Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);
@overload
def Webhook(resource_name: str,
args: WebhookArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Webhook(resource_name: str,
opts: Optional[ResourceOptions] = None,
url: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
secret: Optional[str] = None,
webhook_id: Optional[str] = None)
func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)
public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
public Webhook(String name, WebhookArgs args)
public Webhook(String name, WebhookArgs args, CustomResourceOptions options)
type: sonarqube:Webhook
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 WebhookArgs
- 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 WebhookArgs
- 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 WebhookArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WebhookArgs
- 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 webhookResource = new Sonarqube.Webhook("webhookResource", new()
{
Url = "string",
Name = "string",
Project = "string",
Secret = "string",
WebhookId = "string",
});
example, err := sonarqube.NewWebhook(ctx, "webhookResource", &sonarqube.WebhookArgs{
Url: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
Secret: pulumi.String("string"),
WebhookId: pulumi.String("string"),
})
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
.url("string")
.name("string")
.project("string")
.secret("string")
.webhookId("string")
.build());
webhook_resource = sonarqube.Webhook("webhookResource",
url="string",
name="string",
project="string",
secret="string",
webhook_id="string")
const webhookResource = new sonarqube.Webhook("webhookResource", {
url: "string",
name: "string",
project: "string",
secret: "string",
webhookId: "string",
});
type: sonarqube:Webhook
properties:
name: string
project: string
secret: string
url: string
webhookId: string
Webhook 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 Webhook resource accepts the following input properties:
- Url string
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - Name string
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- Project string
- The key of the project that will own the webhook.
- Secret string
- The secret to send with the event payload.
- Webhook
Id string - The ID of this resource.
- Url string
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - Name string
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- Project string
- The key of the project that will own the webhook.
- Secret string
- The secret to send with the event payload.
- Webhook
Id string - The ID of this resource.
- url String
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - name String
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project String
- The key of the project that will own the webhook.
- secret String
- The secret to send with the event payload.
- webhook
Id String - The ID of this resource.
- url string
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - name string
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project string
- The key of the project that will own the webhook.
- secret string
- The secret to send with the event payload.
- webhook
Id string - The ID of this resource.
- url str
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - name str
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project str
- The key of the project that will own the webhook.
- secret str
- The secret to send with the event payload.
- webhook_
id str - The ID of this resource.
- url String
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - name String
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project String
- The key of the project that will own the webhook.
- secret String
- The secret to send with the event payload.
- webhook
Id String - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Webhook 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 Webhook Resource
Get an existing Webhook 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?: WebhookState, opts?: CustomResourceOptions): Webhook
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
project: Optional[str] = None,
secret: Optional[str] = None,
url: Optional[str] = None,
webhook_id: Optional[str] = None) -> Webhook
func GetWebhook(ctx *Context, name string, id IDInput, state *WebhookState, opts ...ResourceOption) (*Webhook, error)
public static Webhook Get(string name, Input<string> id, WebhookState? state, CustomResourceOptions? opts = null)
public static Webhook get(String name, Output<String> id, WebhookState state, CustomResourceOptions options)
resources: _: type: sonarqube:Webhook 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.
- Name string
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- Project string
- The key of the project that will own the webhook.
- Secret string
- The secret to send with the event payload.
- Url string
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - Webhook
Id string - The ID of this resource.
- Name string
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- Project string
- The key of the project that will own the webhook.
- Secret string
- The secret to send with the event payload.
- Url string
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - Webhook
Id string - The ID of this resource.
- name String
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project String
- The key of the project that will own the webhook.
- secret String
- The secret to send with the event payload.
- url String
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - webhook
Id String - The ID of this resource.
- name string
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project string
- The key of the project that will own the webhook.
- secret string
- The secret to send with the event payload.
- url string
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - webhook
Id string - The ID of this resource.
- name str
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project str
- The key of the project that will own the webhook.
- secret str
- The secret to send with the event payload.
- url str
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - webhook_
id str - The ID of this resource.
- name String
- The name of the webhook to create. This will be displayed in the Sonarqube administration console.
- project String
- The key of the project that will own the webhook.
- secret String
- The secret to send with the event payload.
- url String
- The URL to send event payloads to. This must begin with either
https://
orhttp://
. - webhook
Id String - The ID of this resource.
Package Details
- Repository
- sonarqube jdamata/terraform-provider-sonarqube
- License
- Notes
- This Pulumi package is based on the
sonarqube
Terraform Provider.