aws.redshift.Logging
Explore with Pulumi AI
Resource for managing an AWS Redshift Logging configuration.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.redshift.Logging("example", {
clusterIdentifier: exampleAwsRedshiftCluster.id,
logDestinationType: "cloudwatch",
logExports: [
"connectionlog",
"userlog",
],
});
import pulumi
import pulumi_aws as aws
example = aws.redshift.Logging("example",
cluster_identifier=example_aws_redshift_cluster["id"],
log_destination_type="cloudwatch",
log_exports=[
"connectionlog",
"userlog",
])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshift"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := redshift.NewLogging(ctx, "example", &redshift.LoggingArgs{
ClusterIdentifier: pulumi.Any(exampleAwsRedshiftCluster.Id),
LogDestinationType: pulumi.String("cloudwatch"),
LogExports: pulumi.StringArray{
pulumi.String("connectionlog"),
pulumi.String("userlog"),
},
})
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 example = new Aws.RedShift.Logging("example", new()
{
ClusterIdentifier = exampleAwsRedshiftCluster.Id,
LogDestinationType = "cloudwatch",
LogExports = new[]
{
"connectionlog",
"userlog",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshift.Logging;
import com.pulumi.aws.redshift.LoggingArgs;
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 Logging("example", LoggingArgs.builder()
.clusterIdentifier(exampleAwsRedshiftCluster.id())
.logDestinationType("cloudwatch")
.logExports(
"connectionlog",
"userlog")
.build());
}
}
resources:
example:
type: aws:redshift:Logging
properties:
clusterIdentifier: ${exampleAwsRedshiftCluster.id}
logDestinationType: cloudwatch
logExports:
- connectionlog
- userlog
S3 Destination Type
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.redshift.Logging("example", {
clusterIdentifier: exampleAwsRedshiftCluster.id,
logDestinationType: "s3",
bucketName: exampleAwsS3Bucket.id,
s3KeyPrefix: "example-prefix/",
});
import pulumi
import pulumi_aws as aws
example = aws.redshift.Logging("example",
cluster_identifier=example_aws_redshift_cluster["id"],
log_destination_type="s3",
bucket_name=example_aws_s3_bucket["id"],
s3_key_prefix="example-prefix/")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshift"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := redshift.NewLogging(ctx, "example", &redshift.LoggingArgs{
ClusterIdentifier: pulumi.Any(exampleAwsRedshiftCluster.Id),
LogDestinationType: pulumi.String("s3"),
BucketName: pulumi.Any(exampleAwsS3Bucket.Id),
S3KeyPrefix: pulumi.String("example-prefix/"),
})
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 example = new Aws.RedShift.Logging("example", new()
{
ClusterIdentifier = exampleAwsRedshiftCluster.Id,
LogDestinationType = "s3",
BucketName = exampleAwsS3Bucket.Id,
S3KeyPrefix = "example-prefix/",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshift.Logging;
import com.pulumi.aws.redshift.LoggingArgs;
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 Logging("example", LoggingArgs.builder()
.clusterIdentifier(exampleAwsRedshiftCluster.id())
.logDestinationType("s3")
.bucketName(exampleAwsS3Bucket.id())
.s3KeyPrefix("example-prefix/")
.build());
}
}
resources:
example:
type: aws:redshift:Logging
properties:
clusterIdentifier: ${exampleAwsRedshiftCluster.id}
logDestinationType: s3
bucketName: ${exampleAwsS3Bucket.id}
s3KeyPrefix: example-prefix/
Create Logging Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Logging(name: string, args: LoggingArgs, opts?: CustomResourceOptions);
@overload
def Logging(resource_name: str,
args: LoggingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Logging(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_identifier: Optional[str] = None,
bucket_name: Optional[str] = None,
log_destination_type: Optional[str] = None,
log_exports: Optional[Sequence[str]] = None,
s3_key_prefix: Optional[str] = None)
func NewLogging(ctx *Context, name string, args LoggingArgs, opts ...ResourceOption) (*Logging, error)
public Logging(string name, LoggingArgs args, CustomResourceOptions? opts = null)
public Logging(String name, LoggingArgs args)
public Logging(String name, LoggingArgs args, CustomResourceOptions options)
type: aws:redshift:Logging
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 LoggingArgs
- 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 LoggingArgs
- 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 LoggingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoggingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoggingArgs
- 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 loggingResource = new Aws.RedShift.Logging("loggingResource", new()
{
ClusterIdentifier = "string",
BucketName = "string",
LogDestinationType = "string",
LogExports = new[]
{
"string",
},
S3KeyPrefix = "string",
});
example, err := redshift.NewLogging(ctx, "loggingResource", &redshift.LoggingArgs{
ClusterIdentifier: pulumi.String("string"),
BucketName: pulumi.String("string"),
LogDestinationType: pulumi.String("string"),
LogExports: pulumi.StringArray{
pulumi.String("string"),
},
S3KeyPrefix: pulumi.String("string"),
})
var loggingResource = new Logging("loggingResource", LoggingArgs.builder()
.clusterIdentifier("string")
.bucketName("string")
.logDestinationType("string")
.logExports("string")
.s3KeyPrefix("string")
.build());
logging_resource = aws.redshift.Logging("loggingResource",
cluster_identifier="string",
bucket_name="string",
log_destination_type="string",
log_exports=["string"],
s3_key_prefix="string")
const loggingResource = new aws.redshift.Logging("loggingResource", {
clusterIdentifier: "string",
bucketName: "string",
logDestinationType: "string",
logExports: ["string"],
s3KeyPrefix: "string",
});
type: aws:redshift:Logging
properties:
bucketName: string
clusterIdentifier: string
logDestinationType: string
logExports:
- string
s3KeyPrefix: string
Logging 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 Logging resource accepts the following input properties:
- Cluster
Identifier string Identifier of the source cluster.
The following arguments are optional:
- Bucket
Name string - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - Log
Destination stringType - Log destination type. Valid values are
s3
andcloudwatch
. - Log
Exports List<string> - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - S3Key
Prefix string - Prefix applied to the log file names.
- Cluster
Identifier string Identifier of the source cluster.
The following arguments are optional:
- Bucket
Name string - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - Log
Destination stringType - Log destination type. Valid values are
s3
andcloudwatch
. - Log
Exports []string - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - S3Key
Prefix string - Prefix applied to the log file names.
- cluster
Identifier String Identifier of the source cluster.
The following arguments are optional:
- bucket
Name String - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - log
Destination StringType - Log destination type. Valid values are
s3
andcloudwatch
. - log
Exports List<String> - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3Key
Prefix String - Prefix applied to the log file names.
- cluster
Identifier string Identifier of the source cluster.
The following arguments are optional:
- bucket
Name string - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - log
Destination stringType - Log destination type. Valid values are
s3
andcloudwatch
. - log
Exports string[] - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3Key
Prefix string - Prefix applied to the log file names.
- cluster_
identifier str Identifier of the source cluster.
The following arguments are optional:
- bucket_
name str - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - log_
destination_ strtype - Log destination type. Valid values are
s3
andcloudwatch
. - log_
exports Sequence[str] - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3_
key_ strprefix - Prefix applied to the log file names.
- cluster
Identifier String Identifier of the source cluster.
The following arguments are optional:
- bucket
Name String - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - log
Destination StringType - Log destination type. Valid values are
s3
andcloudwatch
. - log
Exports List<String> - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3Key
Prefix String - Prefix applied to the log file names.
Outputs
All input properties are implicitly available as output properties. Additionally, the Logging 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 Logging Resource
Get an existing Logging 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?: LoggingState, opts?: CustomResourceOptions): Logging
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket_name: Optional[str] = None,
cluster_identifier: Optional[str] = None,
log_destination_type: Optional[str] = None,
log_exports: Optional[Sequence[str]] = None,
s3_key_prefix: Optional[str] = None) -> Logging
func GetLogging(ctx *Context, name string, id IDInput, state *LoggingState, opts ...ResourceOption) (*Logging, error)
public static Logging Get(string name, Input<string> id, LoggingState? state, CustomResourceOptions? opts = null)
public static Logging get(String name, Output<String> id, LoggingState 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.
- Bucket
Name string - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - Cluster
Identifier string Identifier of the source cluster.
The following arguments are optional:
- Log
Destination stringType - Log destination type. Valid values are
s3
andcloudwatch
. - Log
Exports List<string> - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - S3Key
Prefix string - Prefix applied to the log file names.
- Bucket
Name string - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - Cluster
Identifier string Identifier of the source cluster.
The following arguments are optional:
- Log
Destination stringType - Log destination type. Valid values are
s3
andcloudwatch
. - Log
Exports []string - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - S3Key
Prefix string - Prefix applied to the log file names.
- bucket
Name String - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - cluster
Identifier String Identifier of the source cluster.
The following arguments are optional:
- log
Destination StringType - Log destination type. Valid values are
s3
andcloudwatch
. - log
Exports List<String> - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3Key
Prefix String - Prefix applied to the log file names.
- bucket
Name string - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - cluster
Identifier string Identifier of the source cluster.
The following arguments are optional:
- log
Destination stringType - Log destination type. Valid values are
s3
andcloudwatch
. - log
Exports string[] - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3Key
Prefix string - Prefix applied to the log file names.
- bucket_
name str - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - cluster_
identifier str Identifier of the source cluster.
The following arguments are optional:
- log_
destination_ strtype - Log destination type. Valid values are
s3
andcloudwatch
. - log_
exports Sequence[str] - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3_
key_ strprefix - Prefix applied to the log file names.
- bucket
Name String - Name of an existing S3 bucket where the log files are to be stored. Required when
log_destination_type
iss3
. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions. For more information on the permissions required for the bucket, please read the AWS documentation - cluster
Identifier String Identifier of the source cluster.
The following arguments are optional:
- log
Destination StringType - Log destination type. Valid values are
s3
andcloudwatch
. - log
Exports List<String> - Collection of exported log types. Required when
log_destination_type
iscloudwatch
. Valid values areconnectionlog
,useractivitylog
, anduserlog
. - s3Key
Prefix String - Prefix applied to the log file names.
Import
Using pulumi import
, import Redshift Logging using the id
. For example:
$ pulumi import aws:redshift/logging:Logging example cluster-id-12345678
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.