1. Packages
  2. Lacework Provider
  3. API Docs
  4. AlertProfile
lacework 2.0.6 published on Monday, Apr 14, 2025 by lacework

lacework.AlertProfile

Explore with Pulumi AI

lacework logo
lacework 2.0.6 published on Monday, Apr 14, 2025 by lacework

    Use this resource to create a Lacework Alert Profile in order to map query results to events and form event descriptions.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as lacework from "@pulumi/lacework";
    
    const example = new lacework.AlertProfile("example", {
        "extends": "LW_CFG_GCP_DEFAULT_PROFILE",
        alerts: [{
            name: "Violation",
            eventName: "LW Configuration GCP Violation Alert",
            subject: "{{_OCCURRENCE}} violation detected in project {{PROJECT_ID}}",
            description: _var.alert_description,
        }],
    });
    
    import pulumi
    import pulumi_lacework as lacework
    
    example = lacework.AlertProfile("example",
        extends="LW_CFG_GCP_DEFAULT_PROFILE",
        alerts=[{
            "name": "Violation",
            "event_name": "LW Configuration GCP Violation Alert",
            "subject": "{{_OCCURRENCE}} violation detected in project {{PROJECT_ID}}",
            "description": var["alert_description"],
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/lacework/v2/lacework"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lacework.NewAlertProfile(ctx, "example", &lacework.AlertProfileArgs{
    			Extends: pulumi.String("LW_CFG_GCP_DEFAULT_PROFILE"),
    			Alerts: lacework.AlertProfileAlertArray{
    				&lacework.AlertProfileAlertArgs{
    					Name:        pulumi.String("Violation"),
    					EventName:   pulumi.String("LW Configuration GCP Violation Alert"),
    					Subject:     pulumi.String("{{_OCCURRENCE}} violation detected in project {{PROJECT_ID}}"),
    					Description: pulumi.Any(_var.Alert_description),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Lacework = Pulumi.Lacework;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Lacework.AlertProfile("example", new()
        {
            Extends = "LW_CFG_GCP_DEFAULT_PROFILE",
            Alerts = new[]
            {
                new Lacework.Inputs.AlertProfileAlertArgs
                {
                    Name = "Violation",
                    EventName = "LW Configuration GCP Violation Alert",
                    Subject = "{{_OCCURRENCE}} violation detected in project {{PROJECT_ID}}",
                    Description = @var.Alert_description,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.lacework.AlertProfile;
    import com.pulumi.lacework.AlertProfileArgs;
    import com.pulumi.lacework.inputs.AlertProfileAlertArgs;
    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 example = new AlertProfile("example", AlertProfileArgs.builder()
                .extends_("LW_CFG_GCP_DEFAULT_PROFILE")
                .alerts(AlertProfileAlertArgs.builder()
                    .name("Violation")
                    .eventName("LW Configuration GCP Violation Alert")
                    .subject("{{_OCCURRENCE}} violation detected in project {{PROJECT_ID}}")
                    .description(var_.alert_description())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: lacework:AlertProfile
        properties:
          extends: LW_CFG_GCP_DEFAULT_PROFILE
          alerts:
            - name: Violation
              eventName: LW Configuration GCP Violation Alert
              subject: '{{_OCCURRENCE}} violation detected in project {{PROJECT_ID}}'
              description: ${var.alert_description}
    

    Create AlertProfile Resource

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

    Constructor syntax

    new AlertProfile(name: string, args: AlertProfileArgs, opts?: CustomResourceOptions);
    @overload
    def AlertProfile(resource_name: str,
                     args: AlertProfileArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertProfile(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     alerts: Optional[Sequence[AlertProfileAlertArgs]] = None,
                     extends: Optional[str] = None,
                     alert_profile_id: Optional[str] = None,
                     name: Optional[str] = None)
    func NewAlertProfile(ctx *Context, name string, args AlertProfileArgs, opts ...ResourceOption) (*AlertProfile, error)
    public AlertProfile(string name, AlertProfileArgs args, CustomResourceOptions? opts = null)
    public AlertProfile(String name, AlertProfileArgs args)
    public AlertProfile(String name, AlertProfileArgs args, CustomResourceOptions options)
    
    type: lacework:AlertProfile
    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 AlertProfileArgs
    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 AlertProfileArgs
    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 AlertProfileArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertProfileArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertProfileArgs
    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 alertProfileResource = new Lacework.AlertProfile("alertProfileResource", new()
    {
        Alerts = new[]
        {
            new Lacework.Inputs.AlertProfileAlertArgs
            {
                Description = "string",
                EventName = "string",
                Name = "string",
                Subject = "string",
            },
        },
        Extends = "string",
        AlertProfileId = "string",
        Name = "string",
    });
    
    example, err := lacework.NewAlertProfile(ctx, "alertProfileResource", &lacework.AlertProfileArgs{
    	Alerts: lacework.AlertProfileAlertArray{
    		&lacework.AlertProfileAlertArgs{
    			Description: pulumi.String("string"),
    			EventName:   pulumi.String("string"),
    			Name:        pulumi.String("string"),
    			Subject:     pulumi.String("string"),
    		},
    	},
    	Extends:        pulumi.String("string"),
    	AlertProfileId: pulumi.String("string"),
    	Name:           pulumi.String("string"),
    })
    
    var alertProfileResource = new AlertProfile("alertProfileResource", AlertProfileArgs.builder()
        .alerts(AlertProfileAlertArgs.builder()
            .description("string")
            .eventName("string")
            .name("string")
            .subject("string")
            .build())
        .extends_("string")
        .alertProfileId("string")
        .name("string")
        .build());
    
    alert_profile_resource = lacework.AlertProfile("alertProfileResource",
        alerts=[{
            "description": "string",
            "event_name": "string",
            "name": "string",
            "subject": "string",
        }],
        extends="string",
        alert_profile_id="string",
        name="string")
    
    const alertProfileResource = new lacework.AlertProfile("alertProfileResource", {
        alerts: [{
            description: "string",
            eventName: "string",
            name: "string",
            subject: "string",
        }],
        "extends": "string",
        alertProfileId: "string",
        name: "string",
    });
    
    type: lacework:AlertProfile
    properties:
        alertProfileId: string
        alerts:
            - description: string
              eventName: string
              name: string
              subject: string
        extends: string
        name: string
    

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

    Alerts List<AlertProfileAlert>
    The list of alert templates. See Alert below for details.
    Extends string
    The name of existing alert profile from which this profile extends.
    AlertProfileId string
    Name string
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    Alerts []AlertProfileAlertArgs
    The list of alert templates. See Alert below for details.
    Extends string
    The name of existing alert profile from which this profile extends.
    AlertProfileId string
    Name string
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alerts List<AlertProfileAlert>
    The list of alert templates. See Alert below for details.
    extends_ String
    The name of existing alert profile from which this profile extends.
    alertProfileId String
    name String
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alerts AlertProfileAlert[]
    The list of alert templates. See Alert below for details.
    extends string
    The name of existing alert profile from which this profile extends.
    alertProfileId string
    name string
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alerts Sequence[AlertProfileAlertArgs]
    The list of alert templates. See Alert below for details.
    extends str
    The name of existing alert profile from which this profile extends.
    alert_profile_id str
    name str
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alerts List<Property Map>
    The list of alert templates. See Alert below for details.
    extends String
    The name of existing alert profile from which this profile extends.
    alertProfileId String
    name String
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.

    Outputs

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

    Fields List<string>
    A field is a declaration of a field to be mapped in from an LQL query
    Id string
    The provider-assigned unique ID for this managed resource.
    Fields []string
    A field is a declaration of a field to be mapped in from an LQL query
    Id string
    The provider-assigned unique ID for this managed resource.
    fields List<String>
    A field is a declaration of a field to be mapped in from an LQL query
    id String
    The provider-assigned unique ID for this managed resource.
    fields string[]
    A field is a declaration of a field to be mapped in from an LQL query
    id string
    The provider-assigned unique ID for this managed resource.
    fields Sequence[str]
    A field is a declaration of a field to be mapped in from an LQL query
    id str
    The provider-assigned unique ID for this managed resource.
    fields List<String>
    A field is a declaration of a field to be mapped in from an LQL query
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AlertProfile Resource

    Get an existing AlertProfile 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?: AlertProfileState, opts?: CustomResourceOptions): AlertProfile
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alert_profile_id: Optional[str] = None,
            alerts: Optional[Sequence[AlertProfileAlertArgs]] = None,
            extends: Optional[str] = None,
            fields: Optional[Sequence[str]] = None,
            name: Optional[str] = None) -> AlertProfile
    func GetAlertProfile(ctx *Context, name string, id IDInput, state *AlertProfileState, opts ...ResourceOption) (*AlertProfile, error)
    public static AlertProfile Get(string name, Input<string> id, AlertProfileState? state, CustomResourceOptions? opts = null)
    public static AlertProfile get(String name, Output<String> id, AlertProfileState state, CustomResourceOptions options)
    resources:  _:    type: lacework:AlertProfile    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:
    AlertProfileId string
    Alerts List<AlertProfileAlert>
    The list of alert templates. See Alert below for details.
    Extends string
    The name of existing alert profile from which this profile extends.
    Fields List<string>
    A field is a declaration of a field to be mapped in from an LQL query
    Name string
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    AlertProfileId string
    Alerts []AlertProfileAlertArgs
    The list of alert templates. See Alert below for details.
    Extends string
    The name of existing alert profile from which this profile extends.
    Fields []string
    A field is a declaration of a field to be mapped in from an LQL query
    Name string
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alertProfileId String
    alerts List<AlertProfileAlert>
    The list of alert templates. See Alert below for details.
    extends_ String
    The name of existing alert profile from which this profile extends.
    fields List<String>
    A field is a declaration of a field to be mapped in from an LQL query
    name String
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alertProfileId string
    alerts AlertProfileAlert[]
    The list of alert templates. See Alert below for details.
    extends string
    The name of existing alert profile from which this profile extends.
    fields string[]
    A field is a declaration of a field to be mapped in from an LQL query
    name string
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alert_profile_id str
    alerts Sequence[AlertProfileAlertArgs]
    The list of alert templates. See Alert below for details.
    extends str
    The name of existing alert profile from which this profile extends.
    fields Sequence[str]
    A field is a declaration of a field to be mapped in from an LQL query
    name str
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.
    alertProfileId String
    alerts List<Property Map>
    The list of alert templates. See Alert below for details.
    extends String
    The name of existing alert profile from which this profile extends.
    fields List<String>
    A field is a declaration of a field to be mapped in from an LQL query
    name String
    The alert profile name, uniquely identifies the profile. Cannot start 'LW_' which is reserved for Lacework profiles.

    Supporting Types

    AlertProfileAlert, AlertProfileAlertArgs

    Description string
    The summary of the resulting alert.
    EventName string
    The name of the resulting alert.
    Name string
    The name that policies can use to refer to this template when generating alerts.
    Subject string
    A high-level observation of the resulting alert.
    Description string
    The summary of the resulting alert.
    EventName string
    The name of the resulting alert.
    Name string
    The name that policies can use to refer to this template when generating alerts.
    Subject string
    A high-level observation of the resulting alert.
    description String
    The summary of the resulting alert.
    eventName String
    The name of the resulting alert.
    name String
    The name that policies can use to refer to this template when generating alerts.
    subject String
    A high-level observation of the resulting alert.
    description string
    The summary of the resulting alert.
    eventName string
    The name of the resulting alert.
    name string
    The name that policies can use to refer to this template when generating alerts.
    subject string
    A high-level observation of the resulting alert.
    description str
    The summary of the resulting alert.
    event_name str
    The name of the resulting alert.
    name str
    The name that policies can use to refer to this template when generating alerts.
    subject str
    A high-level observation of the resulting alert.
    description String
    The summary of the resulting alert.
    eventName String
    The name of the resulting alert.
    name String
    The name that policies can use to refer to this template when generating alerts.
    subject String
    A high-level observation of the resulting alert.

    Import

    A Lacework Alert Profile can be imported using it’s name, e.g.

    $ pulumi import lacework:index/alertProfile:AlertProfile example CUSTOM_PROFILE_TERRAFORM_TEST
    

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

    Package Details

    Repository
    lacework lacework/terraform-provider-lacework
    License
    Notes
    This Pulumi package is based on the lacework Terraform Provider.
    lacework logo
    lacework 2.0.6 published on Monday, Apr 14, 2025 by lacework