1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. securesourcemanager
  5. Hook
Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi

gcp.securesourcemanager.Hook

Get Started
gcp logo
Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi

    Hook is a user-defined HTTP callback triggered by an event.

    To get more information about Hook, see:

    Example Usage

    Create Hook Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Hook(name: string, args: HookArgs, opts?: CustomResourceOptions);
    @overload
    def Hook(resource_name: str,
             args: HookArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Hook(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             hook_id: Optional[str] = None,
             location: Optional[str] = None,
             repository_id: Optional[str] = None,
             target_uri: Optional[str] = None,
             disabled: Optional[bool] = None,
             events: Optional[Sequence[str]] = None,
             project: Optional[str] = None,
             push_option: Optional[HookPushOptionArgs] = None,
             sensitive_query_string: Optional[str] = None)
    func NewHook(ctx *Context, name string, args HookArgs, opts ...ResourceOption) (*Hook, error)
    public Hook(string name, HookArgs args, CustomResourceOptions? opts = null)
    public Hook(String name, HookArgs args)
    public Hook(String name, HookArgs args, CustomResourceOptions options)
    
    type: gcp:securesourcemanager:Hook
    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 HookArgs
    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 HookArgs
    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 HookArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HookArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HookArgs
    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 hookResource = new Gcp.SecureSourceManager.Hook("hookResource", new()
    {
        HookId = "string",
        Location = "string",
        RepositoryId = "string",
        TargetUri = "string",
        Disabled = false,
        Events = new[]
        {
            "string",
        },
        Project = "string",
        PushOption = new Gcp.SecureSourceManager.Inputs.HookPushOptionArgs
        {
            BranchFilter = "string",
        },
        SensitiveQueryString = "string",
    });
    
    example, err := securesourcemanager.NewHook(ctx, "hookResource", &securesourcemanager.HookArgs{
    	HookId:       pulumi.String("string"),
    	Location:     pulumi.String("string"),
    	RepositoryId: pulumi.String("string"),
    	TargetUri:    pulumi.String("string"),
    	Disabled:     pulumi.Bool(false),
    	Events: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Project: pulumi.String("string"),
    	PushOption: &securesourcemanager.HookPushOptionArgs{
    		BranchFilter: pulumi.String("string"),
    	},
    	SensitiveQueryString: pulumi.String("string"),
    })
    
    var hookResource = new Hook("hookResource", HookArgs.builder()
        .hookId("string")
        .location("string")
        .repositoryId("string")
        .targetUri("string")
        .disabled(false)
        .events("string")
        .project("string")
        .pushOption(HookPushOptionArgs.builder()
            .branchFilter("string")
            .build())
        .sensitiveQueryString("string")
        .build());
    
    hook_resource = gcp.securesourcemanager.Hook("hookResource",
        hook_id="string",
        location="string",
        repository_id="string",
        target_uri="string",
        disabled=False,
        events=["string"],
        project="string",
        push_option={
            "branch_filter": "string",
        },
        sensitive_query_string="string")
    
    const hookResource = new gcp.securesourcemanager.Hook("hookResource", {
        hookId: "string",
        location: "string",
        repositoryId: "string",
        targetUri: "string",
        disabled: false,
        events: ["string"],
        project: "string",
        pushOption: {
            branchFilter: "string",
        },
        sensitiveQueryString: "string",
    });
    
    type: gcp:securesourcemanager:Hook
    properties:
        disabled: false
        events:
            - string
        hookId: string
        location: string
        project: string
        pushOption:
            branchFilter: string
        repositoryId: string
        sensitiveQueryString: string
        targetUri: string
    

    Hook 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 Hook resource accepts the following input properties:

    HookId string
    The ID for the Hook.
    Location string
    The location for the Repository.
    RepositoryId string
    The ID for the Repository.
    TargetUri string
    The target URI to which the payloads will be delivered.
    Disabled bool
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    Events List<string>
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PushOption HookPushOption
    The trigger option for push events. Structure is documented below.
    SensitiveQueryString string
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    HookId string
    The ID for the Hook.
    Location string
    The location for the Repository.
    RepositoryId string
    The ID for the Repository.
    TargetUri string
    The target URI to which the payloads will be delivered.
    Disabled bool
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    Events []string
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PushOption HookPushOptionArgs
    The trigger option for push events. Structure is documented below.
    SensitiveQueryString string
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    hookId String
    The ID for the Hook.
    location String
    The location for the Repository.
    repositoryId String
    The ID for the Repository.
    targetUri String
    The target URI to which the payloads will be delivered.
    disabled Boolean
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events List<String>
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pushOption HookPushOption
    The trigger option for push events. Structure is documented below.
    sensitiveQueryString String
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    hookId string
    The ID for the Hook.
    location string
    The location for the Repository.
    repositoryId string
    The ID for the Repository.
    targetUri string
    The target URI to which the payloads will be delivered.
    disabled boolean
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events string[]
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pushOption HookPushOption
    The trigger option for push events. Structure is documented below.
    sensitiveQueryString string
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    hook_id str
    The ID for the Hook.
    location str
    The location for the Repository.
    repository_id str
    The ID for the Repository.
    target_uri str
    The target URI to which the payloads will be delivered.
    disabled bool
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events Sequence[str]
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    push_option HookPushOptionArgs
    The trigger option for push events. Structure is documented below.
    sensitive_query_string str
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    hookId String
    The ID for the Hook.
    location String
    The location for the Repository.
    repositoryId String
    The ID for the Repository.
    targetUri String
    The target URI to which the payloads will be delivered.
    disabled Boolean
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events List<String>
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pushOption Property Map
    The trigger option for push events. Structure is documented below.
    sensitiveQueryString String
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Hook resource produces the following output properties:

    CreateTime string
    Create timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    Uid string
    Unique identifier of the hook.
    UpdateTime string
    Update timestamp.
    CreateTime string
    Create timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    Uid string
    Unique identifier of the hook.
    UpdateTime string
    Update timestamp.
    createTime String
    Create timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    uid String
    Unique identifier of the hook.
    updateTime String
    Update timestamp.
    createTime string
    Create timestamp.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    uid string
    Unique identifier of the hook.
    updateTime string
    Update timestamp.
    create_time str
    Create timestamp.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    uid str
    Unique identifier of the hook.
    update_time str
    Update timestamp.
    createTime String
    Create timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    uid String
    Unique identifier of the hook.
    updateTime String
    Update timestamp.

    Look up Existing Hook Resource

    Get an existing Hook 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?: HookState, opts?: CustomResourceOptions): Hook
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            disabled: Optional[bool] = None,
            events: Optional[Sequence[str]] = None,
            hook_id: Optional[str] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            push_option: Optional[HookPushOptionArgs] = None,
            repository_id: Optional[str] = None,
            sensitive_query_string: Optional[str] = None,
            target_uri: Optional[str] = None,
            uid: Optional[str] = None,
            update_time: Optional[str] = None) -> Hook
    func GetHook(ctx *Context, name string, id IDInput, state *HookState, opts ...ResourceOption) (*Hook, error)
    public static Hook Get(string name, Input<string> id, HookState? state, CustomResourceOptions? opts = null)
    public static Hook get(String name, Output<String> id, HookState state, CustomResourceOptions options)
    resources:  _:    type: gcp:securesourcemanager:Hook    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.
    The following state arguments are supported:
    CreateTime string
    Create timestamp.
    Disabled bool
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    Events List<string>
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    HookId string
    The ID for the Hook.
    Location string
    The location for the Repository.
    Name string
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PushOption HookPushOption
    The trigger option for push events. Structure is documented below.
    RepositoryId string
    The ID for the Repository.
    SensitiveQueryString string
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    TargetUri string
    The target URI to which the payloads will be delivered.
    Uid string
    Unique identifier of the hook.
    UpdateTime string
    Update timestamp.
    CreateTime string
    Create timestamp.
    Disabled bool
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    Events []string
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    HookId string
    The ID for the Hook.
    Location string
    The location for the Repository.
    Name string
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PushOption HookPushOptionArgs
    The trigger option for push events. Structure is documented below.
    RepositoryId string
    The ID for the Repository.
    SensitiveQueryString string
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    TargetUri string
    The target URI to which the payloads will be delivered.
    Uid string
    Unique identifier of the hook.
    UpdateTime string
    Update timestamp.
    createTime String
    Create timestamp.
    disabled Boolean
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events List<String>
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    hookId String
    The ID for the Hook.
    location String
    The location for the Repository.
    name String
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pushOption HookPushOption
    The trigger option for push events. Structure is documented below.
    repositoryId String
    The ID for the Repository.
    sensitiveQueryString String
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    targetUri String
    The target URI to which the payloads will be delivered.
    uid String
    Unique identifier of the hook.
    updateTime String
    Update timestamp.
    createTime string
    Create timestamp.
    disabled boolean
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events string[]
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    hookId string
    The ID for the Hook.
    location string
    The location for the Repository.
    name string
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pushOption HookPushOption
    The trigger option for push events. Structure is documented below.
    repositoryId string
    The ID for the Repository.
    sensitiveQueryString string
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    targetUri string
    The target URI to which the payloads will be delivered.
    uid string
    Unique identifier of the hook.
    updateTime string
    Update timestamp.
    create_time str
    Create timestamp.
    disabled bool
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events Sequence[str]
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    hook_id str
    The ID for the Hook.
    location str
    The location for the Repository.
    name str
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    push_option HookPushOptionArgs
    The trigger option for push events. Structure is documented below.
    repository_id str
    The ID for the Repository.
    sensitive_query_string str
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    target_uri str
    The target URI to which the payloads will be delivered.
    uid str
    Unique identifier of the hook.
    update_time str
    Update timestamp.
    createTime String
    Create timestamp.
    disabled Boolean
    Determines if the hook disabled or not. Set to true to stop sending traffic.
    events List<String>
    The events that trigger hook on. Each value may be one of: PUSH, PULL_REQUEST.
    hookId String
    The ID for the Hook.
    location String
    The location for the Repository.
    name String
    A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pushOption Property Map
    The trigger option for push events. Structure is documented below.
    repositoryId String
    The ID for the Repository.
    sensitiveQueryString String
    The sensitive query string to be appended to the target URI. Note: This property is sensitive and will not be displayed in the plan.
    targetUri String
    The target URI to which the payloads will be delivered.
    uid String
    Unique identifier of the hook.
    updateTime String
    Update timestamp.

    Supporting Types

    HookPushOption, HookPushOptionArgs

    BranchFilter string
    Trigger hook for matching branches only. Specified as glob pattern. If empty or , events for all branches are reported. Examples: main, {main,release}. See https://pkg.go.dev/github.com/gobwas/glob documentation.
    BranchFilter string
    Trigger hook for matching branches only. Specified as glob pattern. If empty or , events for all branches are reported. Examples: main, {main,release}. See https://pkg.go.dev/github.com/gobwas/glob documentation.
    branchFilter String
    Trigger hook for matching branches only. Specified as glob pattern. If empty or , events for all branches are reported. Examples: main, {main,release}. See https://pkg.go.dev/github.com/gobwas/glob documentation.
    branchFilter string
    Trigger hook for matching branches only. Specified as glob pattern. If empty or , events for all branches are reported. Examples: main, {main,release}. See https://pkg.go.dev/github.com/gobwas/glob documentation.
    branch_filter str
    Trigger hook for matching branches only. Specified as glob pattern. If empty or , events for all branches are reported. Examples: main, {main,release}. See https://pkg.go.dev/github.com/gobwas/glob documentation.
    branchFilter String
    Trigger hook for matching branches only. Specified as glob pattern. If empty or , events for all branches are reported. Examples: main, {main,release}. See https://pkg.go.dev/github.com/gobwas/glob documentation.

    Import

    Hook can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/repositories/{{repository_id}}/hooks/{{hook_id}}

    • {{project}}/{{location}}/{{repository_id}}/{{hook_id}}

    • {{location}}/{{repository_id}}/{{hook_id}}

    • {{hook_id}}

    When using the pulumi import command, Hook can be imported using one of the formats above. For example:

    $ pulumi import gcp:securesourcemanager/hook:Hook default projects/{{project}}/locations/{{location}}/repositories/{{repository_id}}/hooks/{{hook_id}}
    
    $ pulumi import gcp:securesourcemanager/hook:Hook default {{project}}/{{location}}/{{repository_id}}/{{hook_id}}
    
    $ pulumi import gcp:securesourcemanager/hook:Hook default {{location}}/{{repository_id}}/{{hook_id}}
    
    $ pulumi import gcp:securesourcemanager/hook:Hook default {{hook_id}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate