1. Packages
  2. Impart Security
  3. API Docs
  4. LogBinding
Impart Security v0.8.0 published on Monday, Nov 11, 2024 by Impart Security

impart.LogBinding

Explore with Pulumi AI

impart logo
Impart Security v0.8.0 published on Monday, Nov 11, 2024 by Impart Security

    Manage a log binding.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as impart from "@impart-security/pulumi-impart";
    
    // Create a new log binding
    const example = new impart.LogBinding("example", {
        name: "log_binding_example",
        patternType: "grok",
        pattern: "<pattern>\n",
        logstreamId: "logstream_id",
        specId: resource.impart_spec.example.id,
    });
    
    import pulumi
    import pulumi_impart as impart
    
    # Create a new log binding
    example = impart.LogBinding("example",
        name="log_binding_example",
        pattern_type="grok",
        pattern="<pattern>\n",
        logstream_id="logstream_id",
        spec_id=resource["impart_spec"]["example"]["id"])
    
    package main
    
    import (
    	"github.com/impart-security/pulumi-impart/sdk/go/impart"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new log binding
    		_, err := impart.NewLogBinding(ctx, "example", &impart.LogBindingArgs{
    			Name:        pulumi.String("log_binding_example"),
    			PatternType: pulumi.String("grok"),
    			Pattern:     pulumi.String("<pattern>\n"),
    			LogstreamId: pulumi.String("logstream_id"),
    			SpecId:      pulumi.Any(resource.Impart_spec.Example.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Impart = Pulumi.Impart;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new log binding
        var example = new Impart.LogBinding("example", new()
        {
            Name = "log_binding_example",
            PatternType = "grok",
            Pattern = @"<pattern>
    ",
            LogstreamId = "logstream_id",
            SpecId = resource.Impart_spec.Example.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.impart.LogBinding;
    import com.pulumi.impart.LogBindingArgs;
    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) {
            // Create a new log binding
            var example = new LogBinding("example", LogBindingArgs.builder()
                .name("log_binding_example")
                .patternType("grok")
                .pattern("""
    <pattern>
                """)
                .logstreamId("logstream_id")
                .specId(resource.impart_spec().example().id())
                .build());
    
        }
    }
    
    resources:
      # Create a new log binding
      example:
        type: impart:LogBinding
        properties:
          name: log_binding_example
          patternType: grok
          # Example patterns
          #   # for api gateway log format: $context.requestTime "$context.httpMethod $context.path $context.protocol" $context.status $context.identity.sourceIp $context.requestId
          #   # %%{HTTPDATE:timestamp} "(?:%%{WORD:http_method}|-) (?:%%{GREEDYDATA:request}|-) (?:HTTP/%%{NUMBER:httpversion}|-( )?)" (?:%%{NUMBER:response_code}|-)
          #   # for aws loadbalancer access logs
          #   # %%{TIMESTAMP_ISO8601:timestamp} %%{NOTSPACE:loadbalancer} %%{IP:client_ip}:%{NUMBER:client_port} (?:%{IP:backend_ip}:%{NUMBER:backend_port}|-) %%{NUMBER:request_processing_time} %%{NUMBER:backend_processing_time} %%{NUMBER:response_processing_time} (?:%{NUMBER:response_code}|-) (?:%{NUMBER:backend_status_code}|-) %%{NUMBER:received_bytes} %%{NUMBER:sent_bytes} "(?:%{WORD:http_method}|-) (?:%{GREEDYDATA:request}|-) (?:HTTP/%{NUMBER:http_version}|-( )?)" "%{DATA:user_agent}"( %%{NOTSPACE:ssl_cipher} %%{NOTSPACE:ssl_protocol})?
          pattern: |
            <pattern>        
          logstreamId: logstream_id
          specId: ${resource.impart_spec.example.id}
    

    Create LogBinding Resource

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

    Constructor syntax

    new LogBinding(name: string, args: LogBindingArgs, opts?: CustomResourceOptions);
    @overload
    def LogBinding(resource_name: str,
                   args: LogBindingArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogBinding(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   name: Optional[str] = None,
                   pattern: Optional[str] = None,
                   pattern_type: Optional[str] = None,
                   spec_id: Optional[str] = None,
                   logstream_id: Optional[str] = None)
    func NewLogBinding(ctx *Context, name string, args LogBindingArgs, opts ...ResourceOption) (*LogBinding, error)
    public LogBinding(string name, LogBindingArgs args, CustomResourceOptions? opts = null)
    public LogBinding(String name, LogBindingArgs args)
    public LogBinding(String name, LogBindingArgs args, CustomResourceOptions options)
    
    type: impart:LogBinding
    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 LogBindingArgs
    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 LogBindingArgs
    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 LogBindingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogBindingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogBindingArgs
    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 logBindingResource = new Impart.LogBinding("logBindingResource", new()
    {
        Name = "string",
        Pattern = "string",
        PatternType = "string",
        SpecId = "string",
        LogstreamId = "string",
    });
    
    example, err := impart.NewLogBinding(ctx, "logBindingResource", &impart.LogBindingArgs{
    	Name:        pulumi.String("string"),
    	Pattern:     pulumi.String("string"),
    	PatternType: pulumi.String("string"),
    	SpecId:      pulumi.String("string"),
    	LogstreamId: pulumi.String("string"),
    })
    
    var logBindingResource = new LogBinding("logBindingResource", LogBindingArgs.builder()
        .name("string")
        .pattern("string")
        .patternType("string")
        .specId("string")
        .logstreamId("string")
        .build());
    
    log_binding_resource = impart.LogBinding("logBindingResource",
        name="string",
        pattern="string",
        pattern_type="string",
        spec_id="string",
        logstream_id="string")
    
    const logBindingResource = new impart.LogBinding("logBindingResource", {
        name: "string",
        pattern: "string",
        patternType: "string",
        specId: "string",
        logstreamId: "string",
    });
    
    type: impart:LogBinding
    properties:
        logstreamId: string
        name: string
        pattern: string
        patternType: string
        specId: string
    

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

    Name string
    The name for this log binding.
    Pattern string
    The grok/json pattern for this log binding.
    PatternType string
    The pattern type for this log binding. Accepted values: grok, json
    SpecId string
    The specification id.
    LogstreamId string
    The logstream id for this log binding.
    Name string
    The name for this log binding.
    Pattern string
    The grok/json pattern for this log binding.
    PatternType string
    The pattern type for this log binding. Accepted values: grok, json
    SpecId string
    The specification id.
    LogstreamId string
    The logstream id for this log binding.
    name String
    The name for this log binding.
    pattern String
    The grok/json pattern for this log binding.
    patternType String
    The pattern type for this log binding. Accepted values: grok, json
    specId String
    The specification id.
    logstreamId String
    The logstream id for this log binding.
    name string
    The name for this log binding.
    pattern string
    The grok/json pattern for this log binding.
    patternType string
    The pattern type for this log binding. Accepted values: grok, json
    specId string
    The specification id.
    logstreamId string
    The logstream id for this log binding.
    name str
    The name for this log binding.
    pattern str
    The grok/json pattern for this log binding.
    pattern_type str
    The pattern type for this log binding. Accepted values: grok, json
    spec_id str
    The specification id.
    logstream_id str
    The logstream id for this log binding.
    name String
    The name for this log binding.
    pattern String
    The grok/json pattern for this log binding.
    patternType String
    The pattern type for this log binding. Accepted values: grok, json
    specId String
    The specification id.
    logstreamId String
    The logstream id for this log binding.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LogBinding 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 LogBinding Resource

    Get an existing LogBinding 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?: LogBindingState, opts?: CustomResourceOptions): LogBinding
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            logstream_id: Optional[str] = None,
            name: Optional[str] = None,
            pattern: Optional[str] = None,
            pattern_type: Optional[str] = None,
            spec_id: Optional[str] = None) -> LogBinding
    func GetLogBinding(ctx *Context, name string, id IDInput, state *LogBindingState, opts ...ResourceOption) (*LogBinding, error)
    public static LogBinding Get(string name, Input<string> id, LogBindingState? state, CustomResourceOptions? opts = null)
    public static LogBinding get(String name, Output<String> id, LogBindingState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    LogstreamId string
    The logstream id for this log binding.
    Name string
    The name for this log binding.
    Pattern string
    The grok/json pattern for this log binding.
    PatternType string
    The pattern type for this log binding. Accepted values: grok, json
    SpecId string
    The specification id.
    LogstreamId string
    The logstream id for this log binding.
    Name string
    The name for this log binding.
    Pattern string
    The grok/json pattern for this log binding.
    PatternType string
    The pattern type for this log binding. Accepted values: grok, json
    SpecId string
    The specification id.
    logstreamId String
    The logstream id for this log binding.
    name String
    The name for this log binding.
    pattern String
    The grok/json pattern for this log binding.
    patternType String
    The pattern type for this log binding. Accepted values: grok, json
    specId String
    The specification id.
    logstreamId string
    The logstream id for this log binding.
    name string
    The name for this log binding.
    pattern string
    The grok/json pattern for this log binding.
    patternType string
    The pattern type for this log binding. Accepted values: grok, json
    specId string
    The specification id.
    logstream_id str
    The logstream id for this log binding.
    name str
    The name for this log binding.
    pattern str
    The grok/json pattern for this log binding.
    pattern_type str
    The pattern type for this log binding. Accepted values: grok, json
    spec_id str
    The specification id.
    logstreamId String
    The logstream id for this log binding.
    name String
    The name for this log binding.
    pattern String
    The grok/json pattern for this log binding.
    patternType String
    The pattern type for this log binding. Accepted values: grok, json
    specId String
    The specification id.

    Package Details

    Repository
    impart impart-security/pulumi-impart
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the impart Terraform Provider.
    impart logo
    Impart Security v0.8.0 published on Monday, Nov 11, 2024 by Impart Security