prefect.getWebhook
Explore with Pulumi AI
Get information about an existing Webhook, by name or ID.
Use this data source to obtain webhook-level attributes, such as ID, Name, Template, and more.
For more information, see receive events with webhooks.
This feature is available in the following product plan(s): Prefect Cloud (Free), Prefect Cloud (Pro), Prefect Cloud (Enterprise).
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as prefect from "@pulumi/prefect";
const exampleById = prefect.getWebhook({
    id: "00000000-0000-0000-0000-000000000000",
});
const exampleByName = prefect.getWebhook({
    name: "my-webhook",
});
import pulumi
import pulumi_prefect as prefect
example_by_id = prefect.get_webhook(id="00000000-0000-0000-0000-000000000000")
example_by_name = prefect.get_webhook(name="my-webhook")
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/prefect/v2/prefect"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := prefect.LookupWebhook(ctx, &prefect.LookupWebhookArgs{
			Id: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = prefect.LookupWebhook(ctx, &prefect.LookupWebhookArgs{
			Name: pulumi.StringRef("my-webhook"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Prefect = Pulumi.Prefect;
return await Deployment.RunAsync(() => 
{
    var exampleById = Prefect.GetWebhook.Invoke(new()
    {
        Id = "00000000-0000-0000-0000-000000000000",
    });
    var exampleByName = Prefect.GetWebhook.Invoke(new()
    {
        Name = "my-webhook",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.prefect.PrefectFunctions;
import com.pulumi.prefect.inputs.GetWebhookArgs;
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 exampleById = PrefectFunctions.getWebhook(GetWebhookArgs.builder()
            .id("00000000-0000-0000-0000-000000000000")
            .build());
        final var exampleByName = PrefectFunctions.getWebhook(GetWebhookArgs.builder()
            .name("my-webhook")
            .build());
    }
}
variables:
  exampleById:
    fn::invoke:
      function: prefect:getWebhook
      arguments:
        id: 00000000-0000-0000-0000-000000000000
  exampleByName:
    fn::invoke:
      function: prefect:getWebhook
      arguments:
        name: my-webhook
Using getWebhook
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getWebhook(args: GetWebhookArgs, opts?: InvokeOptions): Promise<GetWebhookResult>
function getWebhookOutput(args: GetWebhookOutputArgs, opts?: InvokeOptions): Output<GetWebhookResult>def get_webhook(account_id: Optional[str] = None,
                id: Optional[str] = None,
                name: Optional[str] = None,
                workspace_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetWebhookResult
def get_webhook_output(account_id: Optional[pulumi.Input[str]] = None,
                id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                workspace_id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetWebhookResult]func LookupWebhook(ctx *Context, args *LookupWebhookArgs, opts ...InvokeOption) (*LookupWebhookResult, error)
func LookupWebhookOutput(ctx *Context, args *LookupWebhookOutputArgs, opts ...InvokeOption) LookupWebhookResultOutput> Note: This function is named LookupWebhook in the Go SDK.
public static class GetWebhook 
{
    public static Task<GetWebhookResult> InvokeAsync(GetWebhookArgs args, InvokeOptions? opts = null)
    public static Output<GetWebhookResult> Invoke(GetWebhookInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetWebhookResult> getWebhook(GetWebhookArgs args, InvokeOptions options)
public static Output<GetWebhookResult> getWebhook(GetWebhookArgs args, InvokeOptions options)
fn::invoke:
  function: prefect:index/getWebhook:getWebhook
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Account
Id string - Account ID (UUID), defaults to the account set in the provider
 - Id string
 - Webhook ID (UUID)
 - Name string
 - Name of the webhook
 - Workspace
Id string - Workspace ID (UUID), defaults to the workspace set in the provider
 
- Account
Id string - Account ID (UUID), defaults to the account set in the provider
 - Id string
 - Webhook ID (UUID)
 - Name string
 - Name of the webhook
 - Workspace
Id string - Workspace ID (UUID), defaults to the workspace set in the provider
 
- account
Id String - Account ID (UUID), defaults to the account set in the provider
 - id String
 - Webhook ID (UUID)
 - name String
 - Name of the webhook
 - workspace
Id String - Workspace ID (UUID), defaults to the workspace set in the provider
 
- account
Id string - Account ID (UUID), defaults to the account set in the provider
 - id string
 - Webhook ID (UUID)
 - name string
 - Name of the webhook
 - workspace
Id string - Workspace ID (UUID), defaults to the workspace set in the provider
 
- account_
id str - Account ID (UUID), defaults to the account set in the provider
 - id str
 - Webhook ID (UUID)
 - name str
 - Name of the webhook
 - workspace_
id str - Workspace ID (UUID), defaults to the workspace set in the provider
 
- account
Id String - Account ID (UUID), defaults to the account set in the provider
 - id String
 - Webhook ID (UUID)
 - name String
 - Name of the webhook
 - workspace
Id String - Workspace ID (UUID), defaults to the workspace set in the provider
 
getWebhook Result
The following output properties are available:
- Created string
 - Timestamp of when the resource was created (RFC3339)
 - Description string
 - Description of the webhook
 - Enabled bool
 - Whether the webhook is enabled
 - Id string
 - Webhook ID (UUID)
 - Name string
 - Name of the webhook
 - Service
Account stringId  - ID of the Service Account to which this webhook belongs. 
ProandEnterprisecustomers can assign a Service Account to a webhook to enhance security. - Slug string
 - Slug of the webhook
 - Template string
 - Template used by the webhook
 - Updated string
 - Timestamp of when the resource was updated (RFC3339)
 - Account
Id string - Account ID (UUID), defaults to the account set in the provider
 - Workspace
Id string - Workspace ID (UUID), defaults to the workspace set in the provider
 
- Created string
 - Timestamp of when the resource was created (RFC3339)
 - Description string
 - Description of the webhook
 - Enabled bool
 - Whether the webhook is enabled
 - Id string
 - Webhook ID (UUID)
 - Name string
 - Name of the webhook
 - Service
Account stringId  - ID of the Service Account to which this webhook belongs. 
ProandEnterprisecustomers can assign a Service Account to a webhook to enhance security. - Slug string
 - Slug of the webhook
 - Template string
 - Template used by the webhook
 - Updated string
 - Timestamp of when the resource was updated (RFC3339)
 - Account
Id string - Account ID (UUID), defaults to the account set in the provider
 - Workspace
Id string - Workspace ID (UUID), defaults to the workspace set in the provider
 
- created String
 - Timestamp of when the resource was created (RFC3339)
 - description String
 - Description of the webhook
 - enabled Boolean
 - Whether the webhook is enabled
 - id String
 - Webhook ID (UUID)
 - name String
 - Name of the webhook
 - service
Account StringId  - ID of the Service Account to which this webhook belongs. 
ProandEnterprisecustomers can assign a Service Account to a webhook to enhance security. - slug String
 - Slug of the webhook
 - template String
 - Template used by the webhook
 - updated String
 - Timestamp of when the resource was updated (RFC3339)
 - account
Id String - Account ID (UUID), defaults to the account set in the provider
 - workspace
Id String - Workspace ID (UUID), defaults to the workspace set in the provider
 
- created string
 - Timestamp of when the resource was created (RFC3339)
 - description string
 - Description of the webhook
 - enabled boolean
 - Whether the webhook is enabled
 - id string
 - Webhook ID (UUID)
 - name string
 - Name of the webhook
 - service
Account stringId  - ID of the Service Account to which this webhook belongs. 
ProandEnterprisecustomers can assign a Service Account to a webhook to enhance security. - slug string
 - Slug of the webhook
 - template string
 - Template used by the webhook
 - updated string
 - Timestamp of when the resource was updated (RFC3339)
 - account
Id string - Account ID (UUID), defaults to the account set in the provider
 - workspace
Id string - Workspace ID (UUID), defaults to the workspace set in the provider
 
- created str
 - Timestamp of when the resource was created (RFC3339)
 - description str
 - Description of the webhook
 - enabled bool
 - Whether the webhook is enabled
 - id str
 - Webhook ID (UUID)
 - name str
 - Name of the webhook
 - service_
account_ strid  - ID of the Service Account to which this webhook belongs. 
ProandEnterprisecustomers can assign a Service Account to a webhook to enhance security. - slug str
 - Slug of the webhook
 - template str
 - Template used by the webhook
 - updated str
 - Timestamp of when the resource was updated (RFC3339)
 - account_
id str - Account ID (UUID), defaults to the account set in the provider
 - workspace_
id str - Workspace ID (UUID), defaults to the workspace set in the provider
 
- created String
 - Timestamp of when the resource was created (RFC3339)
 - description String
 - Description of the webhook
 - enabled Boolean
 - Whether the webhook is enabled
 - id String
 - Webhook ID (UUID)
 - name String
 - Name of the webhook
 - service
Account StringId  - ID of the Service Account to which this webhook belongs. 
ProandEnterprisecustomers can assign a Service Account to a webhook to enhance security. - slug String
 - Slug of the webhook
 - template String
 - Template used by the webhook
 - updated String
 - Timestamp of when the resource was updated (RFC3339)
 - account
Id String - Account ID (UUID), defaults to the account set in the provider
 - workspace
Id String - Workspace ID (UUID), defaults to the workspace set in the provider
 
Package Details
- Repository
 - prefect prefecthq/terraform-provider-prefect
 - License
 - Notes
 - This Pulumi package is based on the 
prefectTerraform Provider.