1. Packages
  2. AWS Classic
  3. API Docs
  4. cloudwatch
  5. LogStream

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.cloudwatch.LogStream

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

    Provides a CloudWatch Log Stream resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const yada = new aws.cloudwatch.LogGroup("yada", {name: "Yada"});
    const foo = new aws.cloudwatch.LogStream("foo", {
        name: "SampleLogStream1234",
        logGroupName: yada.name,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    yada = aws.cloudwatch.LogGroup("yada", name="Yada")
    foo = aws.cloudwatch.LogStream("foo",
        name="SampleLogStream1234",
        log_group_name=yada.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		yada, err := cloudwatch.NewLogGroup(ctx, "yada", &cloudwatch.LogGroupArgs{
    			Name: pulumi.String("Yada"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudwatch.NewLogStream(ctx, "foo", &cloudwatch.LogStreamArgs{
    			Name:         pulumi.String("SampleLogStream1234"),
    			LogGroupName: yada.Name,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var yada = new Aws.CloudWatch.LogGroup("yada", new()
        {
            Name = "Yada",
        });
    
        var foo = new Aws.CloudWatch.LogStream("foo", new()
        {
            Name = "SampleLogStream1234",
            LogGroupName = yada.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudwatch.LogGroup;
    import com.pulumi.aws.cloudwatch.LogGroupArgs;
    import com.pulumi.aws.cloudwatch.LogStream;
    import com.pulumi.aws.cloudwatch.LogStreamArgs;
    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 yada = new LogGroup("yada", LogGroupArgs.builder()        
                .name("Yada")
                .build());
    
            var foo = new LogStream("foo", LogStreamArgs.builder()        
                .name("SampleLogStream1234")
                .logGroupName(yada.name())
                .build());
    
        }
    }
    
    resources:
      yada:
        type: aws:cloudwatch:LogGroup
        properties:
          name: Yada
      foo:
        type: aws:cloudwatch:LogStream
        properties:
          name: SampleLogStream1234
          logGroupName: ${yada.name}
    

    Create LogStream Resource

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

    Constructor syntax

    new LogStream(name: string, args: LogStreamArgs, opts?: CustomResourceOptions);
    @overload
    def LogStream(resource_name: str,
                  args: LogStreamArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogStream(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  log_group_name: Optional[str] = None,
                  name: Optional[str] = None)
    func NewLogStream(ctx *Context, name string, args LogStreamArgs, opts ...ResourceOption) (*LogStream, error)
    public LogStream(string name, LogStreamArgs args, CustomResourceOptions? opts = null)
    public LogStream(String name, LogStreamArgs args)
    public LogStream(String name, LogStreamArgs args, CustomResourceOptions options)
    
    type: aws:cloudwatch:LogStream
    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 LogStreamArgs
    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 LogStreamArgs
    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 LogStreamArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogStreamArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogStreamArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var logStreamResource = new Aws.CloudWatch.LogStream("logStreamResource", new()
    {
        LogGroupName = "string",
        Name = "string",
    });
    
    example, err := cloudwatch.NewLogStream(ctx, "logStreamResource", &cloudwatch.LogStreamArgs{
    	LogGroupName: pulumi.String("string"),
    	Name:         pulumi.String("string"),
    })
    
    var logStreamResource = new LogStream("logStreamResource", LogStreamArgs.builder()        
        .logGroupName("string")
        .name("string")
        .build());
    
    log_stream_resource = aws.cloudwatch.LogStream("logStreamResource",
        log_group_name="string",
        name="string")
    
    const logStreamResource = new aws.cloudwatch.LogStream("logStreamResource", {
        logGroupName: "string",
        name: "string",
    });
    
    type: aws:cloudwatch:LogStream
    properties:
        logGroupName: string
        name: string
    

    LogStream Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The LogStream resource accepts the following input properties:

    LogGroupName string
    The name of the log group under which the log stream is to be created.
    Name string
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    LogGroupName string
    The name of the log group under which the log stream is to be created.
    Name string
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    logGroupName String
    The name of the log group under which the log stream is to be created.
    name String
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    logGroupName string
    The name of the log group under which the log stream is to be created.
    name string
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    log_group_name str
    The name of the log group under which the log stream is to be created.
    name str
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    logGroupName String
    The name of the log group under which the log stream is to be created.
    name String
    The name of the log stream. Must not be longer than 512 characters and must not contain :

    Outputs

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

    Arn string
    The Amazon Resource Name (ARN) specifying the log stream.
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    The Amazon Resource Name (ARN) specifying the log stream.
    Id string
    The provider-assigned unique ID for this managed resource.
    arn String
    The Amazon Resource Name (ARN) specifying the log stream.
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    The Amazon Resource Name (ARN) specifying the log stream.
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    The Amazon Resource Name (ARN) specifying the log stream.
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    The Amazon Resource Name (ARN) specifying the log stream.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing LogStream Resource

    Get an existing LogStream 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?: LogStreamState, opts?: CustomResourceOptions): LogStream
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            log_group_name: Optional[str] = None,
            name: Optional[str] = None) -> LogStream
    func GetLogStream(ctx *Context, name string, id IDInput, state *LogStreamState, opts ...ResourceOption) (*LogStream, error)
    public static LogStream Get(string name, Input<string> id, LogStreamState? state, CustomResourceOptions? opts = null)
    public static LogStream get(String name, Output<String> id, LogStreamState 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:
    Arn string
    The Amazon Resource Name (ARN) specifying the log stream.
    LogGroupName string
    The name of the log group under which the log stream is to be created.
    Name string
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    Arn string
    The Amazon Resource Name (ARN) specifying the log stream.
    LogGroupName string
    The name of the log group under which the log stream is to be created.
    Name string
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    arn String
    The Amazon Resource Name (ARN) specifying the log stream.
    logGroupName String
    The name of the log group under which the log stream is to be created.
    name String
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    arn string
    The Amazon Resource Name (ARN) specifying the log stream.
    logGroupName string
    The name of the log group under which the log stream is to be created.
    name string
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    arn str
    The Amazon Resource Name (ARN) specifying the log stream.
    log_group_name str
    The name of the log group under which the log stream is to be created.
    name str
    The name of the log stream. Must not be longer than 512 characters and must not contain :
    arn String
    The Amazon Resource Name (ARN) specifying the log stream.
    logGroupName String
    The name of the log group under which the log stream is to be created.
    name String
    The name of the log stream. Must not be longer than 512 characters and must not contain :

    Import

    Using pulumi import, import Cloudwatch Log Stream using the stream’s log_group_name and name. For example:

    $ pulumi import aws:cloudwatch/logStream:LogStream foo Yada:SampleLogStream1234
    

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

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi