gcp.securesourcemanager.Hook
Hook is a user-defined HTTP callback triggered by an event.
To get more information about Hook, see:
- How-to Guides
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)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:
- Hook
Id string - The ID for the Hook.
- Location string
- The location for the Repository.
- Repository
Id string - The ID for the Repository.
- Target
Uri 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.
- Push
Option HookPush Option - The trigger option for push events. Structure is documented below.
- Sensitive
Query stringString - 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 string - The ID for the Hook.
- Location string
- The location for the Repository.
- Repository
Id string - The ID for the Repository.
- Target
Uri 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.
- Push
Option HookPush Option Args - The trigger option for push events. Structure is documented below.
- Sensitive
Query stringString - 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 String - The ID for the Hook.
- location String
- The location for the Repository.
- repository
Id String - The ID for the Repository.
- target
Uri 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.
- push
Option HookPush Option - The trigger option for push events. Structure is documented below.
- sensitive
Query StringString - 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 string - The ID for the Hook.
- location string
- The location for the Repository.
- repository
Id string - The ID for the Repository.
- target
Uri 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.
- push
Option HookPush Option - The trigger option for push events. Structure is documented below.
- sensitive
Query stringString - 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 HookPush Option Args - The trigger option for push events. Structure is documented below.
- sensitive_
query_ strstring - 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 String - The ID for the Hook.
- location String
- The location for the Repository.
- repository
Id String - The ID for the Repository.
- target
Uri 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.
- push
Option Property Map - The trigger option for push events. Structure is documented below.
- sensitive
Query StringString - 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:
- Create
Time 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.
- Update
Time string - Update timestamp.
- Create
Time 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.
- Update
Time string - Update timestamp.
- create
Time 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.
- update
Time String - Update timestamp.
- create
Time 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.
- update
Time 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.
- create
Time 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.
- update
Time 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) -> Hookfunc 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.
- Create
Time 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. - Hook
Id 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.
- Push
Option HookPush Option - The trigger option for push events. Structure is documented below.
- Repository
Id string - The ID for the Repository.
- Sensitive
Query stringString - 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 string - The target URI to which the payloads will be delivered.
- Uid string
- Unique identifier of the hook.
- Update
Time string - Update timestamp.
- Create
Time 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. - Hook
Id 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.
- Push
Option HookPush Option Args - The trigger option for push events. Structure is documented below.
- Repository
Id string - The ID for the Repository.
- Sensitive
Query stringString - 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 string - The target URI to which the payloads will be delivered.
- Uid string
- Unique identifier of the hook.
- Update
Time string - Update timestamp.
- create
Time 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. - hook
Id 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.
- push
Option HookPush Option - The trigger option for push events. Structure is documented below.
- repository
Id String - The ID for the Repository.
- sensitive
Query StringString - 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 String - The target URI to which the payloads will be delivered.
- uid String
- Unique identifier of the hook.
- update
Time String - Update timestamp.
- create
Time 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. - hook
Id 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.
- push
Option HookPush Option - The trigger option for push events. Structure is documented below.
- repository
Id string - The ID for the Repository.
- sensitive
Query stringString - 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 string - The target URI to which the payloads will be delivered.
- uid string
- Unique identifier of the hook.
- update
Time 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 HookPush Option Args - The trigger option for push events. Structure is documented below.
- repository_
id str - The ID for the Repository.
- sensitive_
query_ strstring - 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.
- create
Time 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. - hook
Id 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.
- push
Option Property Map - The trigger option for push events. Structure is documented below.
- repository
Id String - The ID for the Repository.
- sensitive
Query StringString - 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 String - The target URI to which the payloads will be delivered.
- uid String
- Unique identifier of the hook.
- update
Time String - Update timestamp.
Supporting Types
HookPushOption, HookPushOptionArgs
- Branch
Filter 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 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 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 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.
- branch
Filter 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-betaTerraform Provider.
