github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ivschat/loggingConfiguration.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package ivschat
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Resource for managing an AWS IVS (Interactive Video) Chat Logging Configuration.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage - Logging to CloudWatch
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ivschat"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			example, err := cloudwatch.NewLogGroup(ctx, "example", nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			_, err = ivschat.NewLoggingConfiguration(ctx, "example", &ivschat.LoggingConfigurationArgs{
    39  //				DestinationConfiguration: &ivschat.LoggingConfigurationDestinationConfigurationArgs{
    40  //					CloudwatchLogs: &ivschat.LoggingConfigurationDestinationConfigurationCloudwatchLogsArgs{
    41  //						LogGroupName: example.Name,
    42  //					},
    43  //				},
    44  //			})
    45  //			if err != nil {
    46  //				return err
    47  //			}
    48  //			return nil
    49  //		})
    50  //	}
    51  //
    52  // ```
    53  // <!--End PulumiCodeChooser -->
    54  //
    55  // ### Basic Usage - Logging to Kinesis Firehose with Extended S3
    56  //
    57  // <!--Start PulumiCodeChooser -->
    58  // ```go
    59  // package main
    60  //
    61  // import (
    62  //
    63  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    64  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ivschat"
    65  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kinesis"
    66  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    67  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    68  //
    69  // )
    70  //
    71  //	func main() {
    72  //		pulumi.Run(func(ctx *pulumi.Context) error {
    73  //			exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
    74  //				BucketPrefix: pulumi.String("tf-ivschat-logging-bucket"),
    75  //			})
    76  //			if err != nil {
    77  //				return err
    78  //			}
    79  //			assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    80  //				Statements: []iam.GetPolicyDocumentStatement{
    81  //					{
    82  //						Effect: pulumi.StringRef("Allow"),
    83  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    84  //							{
    85  //								Type: "Service",
    86  //								Identifiers: []string{
    87  //									"firehose.amazonaws.com",
    88  //								},
    89  //							},
    90  //						},
    91  //						Actions: []string{
    92  //							"sts:AssumeRole",
    93  //						},
    94  //					},
    95  //				},
    96  //			}, nil)
    97  //			if err != nil {
    98  //				return err
    99  //			}
   100  //			exampleRole, err := iam.NewRole(ctx, "example", &iam.RoleArgs{
   101  //				Name:             pulumi.String("firehose_example_role"),
   102  //				AssumeRolePolicy: pulumi.String(assumeRole.Json),
   103  //			})
   104  //			if err != nil {
   105  //				return err
   106  //			}
   107  //			example, err := kinesis.NewFirehoseDeliveryStream(ctx, "example", &kinesis.FirehoseDeliveryStreamArgs{
   108  //				Name:        pulumi.String("pulumi-kinesis-firehose-extended-s3-example-stream"),
   109  //				Destination: pulumi.String("extended_s3"),
   110  //				ExtendedS3Configuration: &kinesis.FirehoseDeliveryStreamExtendedS3ConfigurationArgs{
   111  //					RoleArn:   exampleRole.Arn,
   112  //					BucketArn: exampleBucketV2.Arn,
   113  //				},
   114  //				Tags: pulumi.StringMap{
   115  //					"LogDeliveryEnabled": pulumi.String("true"),
   116  //				},
   117  //			})
   118  //			if err != nil {
   119  //				return err
   120  //			}
   121  //			_, err = s3.NewBucketAclV2(ctx, "example", &s3.BucketAclV2Args{
   122  //				Bucket: exampleBucketV2.ID(),
   123  //				Acl:    pulumi.String("private"),
   124  //			})
   125  //			if err != nil {
   126  //				return err
   127  //			}
   128  //			_, err = ivschat.NewLoggingConfiguration(ctx, "example", &ivschat.LoggingConfigurationArgs{
   129  //				DestinationConfiguration: &ivschat.LoggingConfigurationDestinationConfigurationArgs{
   130  //					Firehose: &ivschat.LoggingConfigurationDestinationConfigurationFirehoseArgs{
   131  //						DeliveryStreamName: example.Name,
   132  //					},
   133  //				},
   134  //			})
   135  //			if err != nil {
   136  //				return err
   137  //			}
   138  //			return nil
   139  //		})
   140  //	}
   141  //
   142  // ```
   143  // <!--End PulumiCodeChooser -->
   144  //
   145  // ## Import
   146  //
   147  // Using `pulumi import`, import IVS (Interactive Video) Chat Logging Configuration using the ARN. For example:
   148  //
   149  // ```sh
   150  // $ pulumi import aws:ivschat/loggingConfiguration:LoggingConfiguration example arn:aws:ivschat:us-west-2:326937407773:logging-configuration/MMUQc8wcqZmC
   151  // ```
   152  type LoggingConfiguration struct {
   153  	pulumi.CustomResourceState
   154  
   155  	// ARN of the Logging Configuration.
   156  	Arn pulumi.StringOutput `pulumi:"arn"`
   157  	// Object containing destination configuration for where chat activity will be logged. This object must contain exactly one of the following children arguments:
   158  	DestinationConfiguration LoggingConfigurationDestinationConfigurationPtrOutput `pulumi:"destinationConfiguration"`
   159  	// Logging Configuration name.
   160  	Name pulumi.StringOutput `pulumi:"name"`
   161  	// State of the Logging Configuration.
   162  	State pulumi.StringOutput `pulumi:"state"`
   163  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   164  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   165  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   166  	//
   167  	// Deprecated: Please use `tags` instead.
   168  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   169  }
   170  
   171  // NewLoggingConfiguration registers a new resource with the given unique name, arguments, and options.
   172  func NewLoggingConfiguration(ctx *pulumi.Context,
   173  	name string, args *LoggingConfigurationArgs, opts ...pulumi.ResourceOption) (*LoggingConfiguration, error) {
   174  	if args == nil {
   175  		args = &LoggingConfigurationArgs{}
   176  	}
   177  
   178  	opts = internal.PkgResourceDefaultOpts(opts)
   179  	var resource LoggingConfiguration
   180  	err := ctx.RegisterResource("aws:ivschat/loggingConfiguration:LoggingConfiguration", name, args, &resource, opts...)
   181  	if err != nil {
   182  		return nil, err
   183  	}
   184  	return &resource, nil
   185  }
   186  
   187  // GetLoggingConfiguration gets an existing LoggingConfiguration resource's state with the given name, ID, and optional
   188  // state properties that are used to uniquely qualify the lookup (nil if not required).
   189  func GetLoggingConfiguration(ctx *pulumi.Context,
   190  	name string, id pulumi.IDInput, state *LoggingConfigurationState, opts ...pulumi.ResourceOption) (*LoggingConfiguration, error) {
   191  	var resource LoggingConfiguration
   192  	err := ctx.ReadResource("aws:ivschat/loggingConfiguration:LoggingConfiguration", name, id, state, &resource, opts...)
   193  	if err != nil {
   194  		return nil, err
   195  	}
   196  	return &resource, nil
   197  }
   198  
   199  // Input properties used for looking up and filtering LoggingConfiguration resources.
   200  type loggingConfigurationState struct {
   201  	// ARN of the Logging Configuration.
   202  	Arn *string `pulumi:"arn"`
   203  	// Object containing destination configuration for where chat activity will be logged. This object must contain exactly one of the following children arguments:
   204  	DestinationConfiguration *LoggingConfigurationDestinationConfiguration `pulumi:"destinationConfiguration"`
   205  	// Logging Configuration name.
   206  	Name *string `pulumi:"name"`
   207  	// State of the Logging Configuration.
   208  	State *string `pulumi:"state"`
   209  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   210  	Tags map[string]string `pulumi:"tags"`
   211  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   212  	//
   213  	// Deprecated: Please use `tags` instead.
   214  	TagsAll map[string]string `pulumi:"tagsAll"`
   215  }
   216  
   217  type LoggingConfigurationState struct {
   218  	// ARN of the Logging Configuration.
   219  	Arn pulumi.StringPtrInput
   220  	// Object containing destination configuration for where chat activity will be logged. This object must contain exactly one of the following children arguments:
   221  	DestinationConfiguration LoggingConfigurationDestinationConfigurationPtrInput
   222  	// Logging Configuration name.
   223  	Name pulumi.StringPtrInput
   224  	// State of the Logging Configuration.
   225  	State pulumi.StringPtrInput
   226  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   227  	Tags pulumi.StringMapInput
   228  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   229  	//
   230  	// Deprecated: Please use `tags` instead.
   231  	TagsAll pulumi.StringMapInput
   232  }
   233  
   234  func (LoggingConfigurationState) ElementType() reflect.Type {
   235  	return reflect.TypeOf((*loggingConfigurationState)(nil)).Elem()
   236  }
   237  
   238  type loggingConfigurationArgs struct {
   239  	// Object containing destination configuration for where chat activity will be logged. This object must contain exactly one of the following children arguments:
   240  	DestinationConfiguration *LoggingConfigurationDestinationConfiguration `pulumi:"destinationConfiguration"`
   241  	// Logging Configuration name.
   242  	Name *string `pulumi:"name"`
   243  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   244  	Tags map[string]string `pulumi:"tags"`
   245  }
   246  
   247  // The set of arguments for constructing a LoggingConfiguration resource.
   248  type LoggingConfigurationArgs struct {
   249  	// Object containing destination configuration for where chat activity will be logged. This object must contain exactly one of the following children arguments:
   250  	DestinationConfiguration LoggingConfigurationDestinationConfigurationPtrInput
   251  	// Logging Configuration name.
   252  	Name pulumi.StringPtrInput
   253  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   254  	Tags pulumi.StringMapInput
   255  }
   256  
   257  func (LoggingConfigurationArgs) ElementType() reflect.Type {
   258  	return reflect.TypeOf((*loggingConfigurationArgs)(nil)).Elem()
   259  }
   260  
   261  type LoggingConfigurationInput interface {
   262  	pulumi.Input
   263  
   264  	ToLoggingConfigurationOutput() LoggingConfigurationOutput
   265  	ToLoggingConfigurationOutputWithContext(ctx context.Context) LoggingConfigurationOutput
   266  }
   267  
   268  func (*LoggingConfiguration) ElementType() reflect.Type {
   269  	return reflect.TypeOf((**LoggingConfiguration)(nil)).Elem()
   270  }
   271  
   272  func (i *LoggingConfiguration) ToLoggingConfigurationOutput() LoggingConfigurationOutput {
   273  	return i.ToLoggingConfigurationOutputWithContext(context.Background())
   274  }
   275  
   276  func (i *LoggingConfiguration) ToLoggingConfigurationOutputWithContext(ctx context.Context) LoggingConfigurationOutput {
   277  	return pulumi.ToOutputWithContext(ctx, i).(LoggingConfigurationOutput)
   278  }
   279  
   280  // LoggingConfigurationArrayInput is an input type that accepts LoggingConfigurationArray and LoggingConfigurationArrayOutput values.
   281  // You can construct a concrete instance of `LoggingConfigurationArrayInput` via:
   282  //
   283  //	LoggingConfigurationArray{ LoggingConfigurationArgs{...} }
   284  type LoggingConfigurationArrayInput interface {
   285  	pulumi.Input
   286  
   287  	ToLoggingConfigurationArrayOutput() LoggingConfigurationArrayOutput
   288  	ToLoggingConfigurationArrayOutputWithContext(context.Context) LoggingConfigurationArrayOutput
   289  }
   290  
   291  type LoggingConfigurationArray []LoggingConfigurationInput
   292  
   293  func (LoggingConfigurationArray) ElementType() reflect.Type {
   294  	return reflect.TypeOf((*[]*LoggingConfiguration)(nil)).Elem()
   295  }
   296  
   297  func (i LoggingConfigurationArray) ToLoggingConfigurationArrayOutput() LoggingConfigurationArrayOutput {
   298  	return i.ToLoggingConfigurationArrayOutputWithContext(context.Background())
   299  }
   300  
   301  func (i LoggingConfigurationArray) ToLoggingConfigurationArrayOutputWithContext(ctx context.Context) LoggingConfigurationArrayOutput {
   302  	return pulumi.ToOutputWithContext(ctx, i).(LoggingConfigurationArrayOutput)
   303  }
   304  
   305  // LoggingConfigurationMapInput is an input type that accepts LoggingConfigurationMap and LoggingConfigurationMapOutput values.
   306  // You can construct a concrete instance of `LoggingConfigurationMapInput` via:
   307  //
   308  //	LoggingConfigurationMap{ "key": LoggingConfigurationArgs{...} }
   309  type LoggingConfigurationMapInput interface {
   310  	pulumi.Input
   311  
   312  	ToLoggingConfigurationMapOutput() LoggingConfigurationMapOutput
   313  	ToLoggingConfigurationMapOutputWithContext(context.Context) LoggingConfigurationMapOutput
   314  }
   315  
   316  type LoggingConfigurationMap map[string]LoggingConfigurationInput
   317  
   318  func (LoggingConfigurationMap) ElementType() reflect.Type {
   319  	return reflect.TypeOf((*map[string]*LoggingConfiguration)(nil)).Elem()
   320  }
   321  
   322  func (i LoggingConfigurationMap) ToLoggingConfigurationMapOutput() LoggingConfigurationMapOutput {
   323  	return i.ToLoggingConfigurationMapOutputWithContext(context.Background())
   324  }
   325  
   326  func (i LoggingConfigurationMap) ToLoggingConfigurationMapOutputWithContext(ctx context.Context) LoggingConfigurationMapOutput {
   327  	return pulumi.ToOutputWithContext(ctx, i).(LoggingConfigurationMapOutput)
   328  }
   329  
   330  type LoggingConfigurationOutput struct{ *pulumi.OutputState }
   331  
   332  func (LoggingConfigurationOutput) ElementType() reflect.Type {
   333  	return reflect.TypeOf((**LoggingConfiguration)(nil)).Elem()
   334  }
   335  
   336  func (o LoggingConfigurationOutput) ToLoggingConfigurationOutput() LoggingConfigurationOutput {
   337  	return o
   338  }
   339  
   340  func (o LoggingConfigurationOutput) ToLoggingConfigurationOutputWithContext(ctx context.Context) LoggingConfigurationOutput {
   341  	return o
   342  }
   343  
   344  // ARN of the Logging Configuration.
   345  func (o LoggingConfigurationOutput) Arn() pulumi.StringOutput {
   346  	return o.ApplyT(func(v *LoggingConfiguration) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   347  }
   348  
   349  // Object containing destination configuration for where chat activity will be logged. This object must contain exactly one of the following children arguments:
   350  func (o LoggingConfigurationOutput) DestinationConfiguration() LoggingConfigurationDestinationConfigurationPtrOutput {
   351  	return o.ApplyT(func(v *LoggingConfiguration) LoggingConfigurationDestinationConfigurationPtrOutput {
   352  		return v.DestinationConfiguration
   353  	}).(LoggingConfigurationDestinationConfigurationPtrOutput)
   354  }
   355  
   356  // Logging Configuration name.
   357  func (o LoggingConfigurationOutput) Name() pulumi.StringOutput {
   358  	return o.ApplyT(func(v *LoggingConfiguration) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   359  }
   360  
   361  // State of the Logging Configuration.
   362  func (o LoggingConfigurationOutput) State() pulumi.StringOutput {
   363  	return o.ApplyT(func(v *LoggingConfiguration) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
   364  }
   365  
   366  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   367  func (o LoggingConfigurationOutput) Tags() pulumi.StringMapOutput {
   368  	return o.ApplyT(func(v *LoggingConfiguration) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   369  }
   370  
   371  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   372  //
   373  // Deprecated: Please use `tags` instead.
   374  func (o LoggingConfigurationOutput) TagsAll() pulumi.StringMapOutput {
   375  	return o.ApplyT(func(v *LoggingConfiguration) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   376  }
   377  
   378  type LoggingConfigurationArrayOutput struct{ *pulumi.OutputState }
   379  
   380  func (LoggingConfigurationArrayOutput) ElementType() reflect.Type {
   381  	return reflect.TypeOf((*[]*LoggingConfiguration)(nil)).Elem()
   382  }
   383  
   384  func (o LoggingConfigurationArrayOutput) ToLoggingConfigurationArrayOutput() LoggingConfigurationArrayOutput {
   385  	return o
   386  }
   387  
   388  func (o LoggingConfigurationArrayOutput) ToLoggingConfigurationArrayOutputWithContext(ctx context.Context) LoggingConfigurationArrayOutput {
   389  	return o
   390  }
   391  
   392  func (o LoggingConfigurationArrayOutput) Index(i pulumi.IntInput) LoggingConfigurationOutput {
   393  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LoggingConfiguration {
   394  		return vs[0].([]*LoggingConfiguration)[vs[1].(int)]
   395  	}).(LoggingConfigurationOutput)
   396  }
   397  
   398  type LoggingConfigurationMapOutput struct{ *pulumi.OutputState }
   399  
   400  func (LoggingConfigurationMapOutput) ElementType() reflect.Type {
   401  	return reflect.TypeOf((*map[string]*LoggingConfiguration)(nil)).Elem()
   402  }
   403  
   404  func (o LoggingConfigurationMapOutput) ToLoggingConfigurationMapOutput() LoggingConfigurationMapOutput {
   405  	return o
   406  }
   407  
   408  func (o LoggingConfigurationMapOutput) ToLoggingConfigurationMapOutputWithContext(ctx context.Context) LoggingConfigurationMapOutput {
   409  	return o
   410  }
   411  
   412  func (o LoggingConfigurationMapOutput) MapIndex(k pulumi.StringInput) LoggingConfigurationOutput {
   413  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LoggingConfiguration {
   414  		return vs[0].(map[string]*LoggingConfiguration)[vs[1].(string)]
   415  	}).(LoggingConfigurationOutput)
   416  }
   417  
   418  func init() {
   419  	pulumi.RegisterInputType(reflect.TypeOf((*LoggingConfigurationInput)(nil)).Elem(), &LoggingConfiguration{})
   420  	pulumi.RegisterInputType(reflect.TypeOf((*LoggingConfigurationArrayInput)(nil)).Elem(), LoggingConfigurationArray{})
   421  	pulumi.RegisterInputType(reflect.TypeOf((*LoggingConfigurationMapInput)(nil)).Elem(), LoggingConfigurationMap{})
   422  	pulumi.RegisterOutputType(LoggingConfigurationOutput{})
   423  	pulumi.RegisterOutputType(LoggingConfigurationArrayOutput{})
   424  	pulumi.RegisterOutputType(LoggingConfigurationMapOutput{})
   425  }