1. Packages
  2. AWS
  3. API Docs
  4. iot
  5. LoggingOptions
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.iot.LoggingOptions

Explore with Pulumi AI

Provides a resource to manage default logging options.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.iot.LoggingOptions("example", {
    defaultLogLevel: "WARN",
    roleArn: exampleAwsIamRole.arn,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.iot.LoggingOptions("example",
    default_log_level="WARN",
    role_arn=example_aws_iam_role["arn"])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := iot.NewLoggingOptions(ctx, "example", &iot.LoggingOptionsArgs{
			DefaultLogLevel: pulumi.String("WARN"),
			RoleArn:         pulumi.Any(exampleAwsIamRole.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Iot.LoggingOptions("example", new()
    {
        DefaultLogLevel = "WARN",
        RoleArn = exampleAwsIamRole.Arn,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iot.LoggingOptions;
import com.pulumi.aws.iot.LoggingOptionsArgs;
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 LoggingOptions("example", LoggingOptionsArgs.builder()
            .defaultLogLevel("WARN")
            .roleArn(exampleAwsIamRole.arn())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:iot:LoggingOptions
    properties:
      defaultLogLevel: WARN
      roleArn: ${exampleAwsIamRole.arn}
Copy

Create LoggingOptions Resource

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

Constructor syntax

new LoggingOptions(name: string, args: LoggingOptionsArgs, opts?: CustomResourceOptions);
@overload
def LoggingOptions(resource_name: str,
                   args: LoggingOptionsArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def LoggingOptions(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   default_log_level: Optional[str] = None,
                   role_arn: Optional[str] = None,
                   disable_all_logs: Optional[bool] = None)
func NewLoggingOptions(ctx *Context, name string, args LoggingOptionsArgs, opts ...ResourceOption) (*LoggingOptions, error)
public LoggingOptions(string name, LoggingOptionsArgs args, CustomResourceOptions? opts = null)
public LoggingOptions(String name, LoggingOptionsArgs args)
public LoggingOptions(String name, LoggingOptionsArgs args, CustomResourceOptions options)
type: aws:iot:LoggingOptions
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. LoggingOptionsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. LoggingOptionsArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. LoggingOptionsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. LoggingOptionsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LoggingOptionsArgs
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 loggingOptionsResource = new Aws.Iot.LoggingOptions("loggingOptionsResource", new()
{
    DefaultLogLevel = "string",
    RoleArn = "string",
    DisableAllLogs = false,
});
Copy
example, err := iot.NewLoggingOptions(ctx, "loggingOptionsResource", &iot.LoggingOptionsArgs{
	DefaultLogLevel: pulumi.String("string"),
	RoleArn:         pulumi.String("string"),
	DisableAllLogs:  pulumi.Bool(false),
})
Copy
var loggingOptionsResource = new LoggingOptions("loggingOptionsResource", LoggingOptionsArgs.builder()
    .defaultLogLevel("string")
    .roleArn("string")
    .disableAllLogs(false)
    .build());
Copy
logging_options_resource = aws.iot.LoggingOptions("loggingOptionsResource",
    default_log_level="string",
    role_arn="string",
    disable_all_logs=False)
Copy
const loggingOptionsResource = new aws.iot.LoggingOptions("loggingOptionsResource", {
    defaultLogLevel: "string",
    roleArn: "string",
    disableAllLogs: false,
});
Copy
type: aws:iot:LoggingOptions
properties:
    defaultLogLevel: string
    disableAllLogs: false
    roleArn: string
Copy

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

DefaultLogLevel This property is required. string
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
RoleArn This property is required. string
The ARN of the role that allows IoT to write to Cloudwatch logs.
DisableAllLogs bool
If true all logs are disabled. The default is false.
DefaultLogLevel This property is required. string
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
RoleArn This property is required. string
The ARN of the role that allows IoT to write to Cloudwatch logs.
DisableAllLogs bool
If true all logs are disabled. The default is false.
defaultLogLevel This property is required. String
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
roleArn This property is required. String
The ARN of the role that allows IoT to write to Cloudwatch logs.
disableAllLogs Boolean
If true all logs are disabled. The default is false.
defaultLogLevel This property is required. string
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
roleArn This property is required. string
The ARN of the role that allows IoT to write to Cloudwatch logs.
disableAllLogs boolean
If true all logs are disabled. The default is false.
default_log_level This property is required. str
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
role_arn This property is required. str
The ARN of the role that allows IoT to write to Cloudwatch logs.
disable_all_logs bool
If true all logs are disabled. The default is false.
defaultLogLevel This property is required. String
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
roleArn This property is required. String
The ARN of the role that allows IoT to write to Cloudwatch logs.
disableAllLogs Boolean
If true all logs are disabled. The default is false.

Outputs

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

Get an existing LoggingOptions 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?: LoggingOptionsState, opts?: CustomResourceOptions): LoggingOptions
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        default_log_level: Optional[str] = None,
        disable_all_logs: Optional[bool] = None,
        role_arn: Optional[str] = None) -> LoggingOptions
func GetLoggingOptions(ctx *Context, name string, id IDInput, state *LoggingOptionsState, opts ...ResourceOption) (*LoggingOptions, error)
public static LoggingOptions Get(string name, Input<string> id, LoggingOptionsState? state, CustomResourceOptions? opts = null)
public static LoggingOptions get(String name, Output<String> id, LoggingOptionsState state, CustomResourceOptions options)
resources:  _:    type: aws:iot:LoggingOptions    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DefaultLogLevel string
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
DisableAllLogs bool
If true all logs are disabled. The default is false.
RoleArn string
The ARN of the role that allows IoT to write to Cloudwatch logs.
DefaultLogLevel string
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
DisableAllLogs bool
If true all logs are disabled. The default is false.
RoleArn string
The ARN of the role that allows IoT to write to Cloudwatch logs.
defaultLogLevel String
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
disableAllLogs Boolean
If true all logs are disabled. The default is false.
roleArn String
The ARN of the role that allows IoT to write to Cloudwatch logs.
defaultLogLevel string
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
disableAllLogs boolean
If true all logs are disabled. The default is false.
roleArn string
The ARN of the role that allows IoT to write to Cloudwatch logs.
default_log_level str
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
disable_all_logs bool
If true all logs are disabled. The default is false.
role_arn str
The ARN of the role that allows IoT to write to Cloudwatch logs.
defaultLogLevel String
The default logging level. Valid Values: "DEBUG", "INFO", "ERROR", "WARN", "DISABLED".
disableAllLogs Boolean
If true all logs are disabled. The default is false.
roleArn String
The ARN of the role that allows IoT to write to Cloudwatch logs.

Package Details

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