github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/securitylake/awsLogSource.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 securitylake
     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 Amazon Security Lake AWS Log Source.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/securitylake"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := securitylake.NewAwsLogSource(ctx, "test", &securitylake.AwsLogSourceArgs{
    34  //				Source: &securitylake.AwsLogSourceSourceArgs{
    35  //					Accounts: pulumi.StringArray{
    36  //						pulumi.String("123456789012"),
    37  //					},
    38  //					Regions: pulumi.StringArray{
    39  //						pulumi.String("eu-west-1"),
    40  //					},
    41  //					SourceName:    pulumi.String("ROUTE53"),
    42  //					SourceVersion: pulumi.String("1.0"),
    43  //				},
    44  //			})
    45  //			if err != nil {
    46  //				return err
    47  //			}
    48  //			return nil
    49  //		})
    50  //	}
    51  //
    52  // ```
    53  // <!--End PulumiCodeChooser -->
    54  //
    55  // ## Import
    56  //
    57  // Using `pulumi import`, import AWS log sources using the source name. For example:
    58  //
    59  // ```sh
    60  // $ pulumi import aws:securitylake/awsLogSource:AwsLogSource example ROUTE53
    61  // ```
    62  type AwsLogSource struct {
    63  	pulumi.CustomResourceState
    64  
    65  	// Specify the natively-supported AWS service to add as a source in Security Lake.
    66  	Source AwsLogSourceSourcePtrOutput `pulumi:"source"`
    67  }
    68  
    69  // NewAwsLogSource registers a new resource with the given unique name, arguments, and options.
    70  func NewAwsLogSource(ctx *pulumi.Context,
    71  	name string, args *AwsLogSourceArgs, opts ...pulumi.ResourceOption) (*AwsLogSource, error) {
    72  	if args == nil {
    73  		args = &AwsLogSourceArgs{}
    74  	}
    75  
    76  	opts = internal.PkgResourceDefaultOpts(opts)
    77  	var resource AwsLogSource
    78  	err := ctx.RegisterResource("aws:securitylake/awsLogSource:AwsLogSource", name, args, &resource, opts...)
    79  	if err != nil {
    80  		return nil, err
    81  	}
    82  	return &resource, nil
    83  }
    84  
    85  // GetAwsLogSource gets an existing AwsLogSource resource's state with the given name, ID, and optional
    86  // state properties that are used to uniquely qualify the lookup (nil if not required).
    87  func GetAwsLogSource(ctx *pulumi.Context,
    88  	name string, id pulumi.IDInput, state *AwsLogSourceState, opts ...pulumi.ResourceOption) (*AwsLogSource, error) {
    89  	var resource AwsLogSource
    90  	err := ctx.ReadResource("aws:securitylake/awsLogSource:AwsLogSource", name, id, state, &resource, opts...)
    91  	if err != nil {
    92  		return nil, err
    93  	}
    94  	return &resource, nil
    95  }
    96  
    97  // Input properties used for looking up and filtering AwsLogSource resources.
    98  type awsLogSourceState struct {
    99  	// Specify the natively-supported AWS service to add as a source in Security Lake.
   100  	Source *AwsLogSourceSource `pulumi:"source"`
   101  }
   102  
   103  type AwsLogSourceState struct {
   104  	// Specify the natively-supported AWS service to add as a source in Security Lake.
   105  	Source AwsLogSourceSourcePtrInput
   106  }
   107  
   108  func (AwsLogSourceState) ElementType() reflect.Type {
   109  	return reflect.TypeOf((*awsLogSourceState)(nil)).Elem()
   110  }
   111  
   112  type awsLogSourceArgs struct {
   113  	// Specify the natively-supported AWS service to add as a source in Security Lake.
   114  	Source *AwsLogSourceSource `pulumi:"source"`
   115  }
   116  
   117  // The set of arguments for constructing a AwsLogSource resource.
   118  type AwsLogSourceArgs struct {
   119  	// Specify the natively-supported AWS service to add as a source in Security Lake.
   120  	Source AwsLogSourceSourcePtrInput
   121  }
   122  
   123  func (AwsLogSourceArgs) ElementType() reflect.Type {
   124  	return reflect.TypeOf((*awsLogSourceArgs)(nil)).Elem()
   125  }
   126  
   127  type AwsLogSourceInput interface {
   128  	pulumi.Input
   129  
   130  	ToAwsLogSourceOutput() AwsLogSourceOutput
   131  	ToAwsLogSourceOutputWithContext(ctx context.Context) AwsLogSourceOutput
   132  }
   133  
   134  func (*AwsLogSource) ElementType() reflect.Type {
   135  	return reflect.TypeOf((**AwsLogSource)(nil)).Elem()
   136  }
   137  
   138  func (i *AwsLogSource) ToAwsLogSourceOutput() AwsLogSourceOutput {
   139  	return i.ToAwsLogSourceOutputWithContext(context.Background())
   140  }
   141  
   142  func (i *AwsLogSource) ToAwsLogSourceOutputWithContext(ctx context.Context) AwsLogSourceOutput {
   143  	return pulumi.ToOutputWithContext(ctx, i).(AwsLogSourceOutput)
   144  }
   145  
   146  // AwsLogSourceArrayInput is an input type that accepts AwsLogSourceArray and AwsLogSourceArrayOutput values.
   147  // You can construct a concrete instance of `AwsLogSourceArrayInput` via:
   148  //
   149  //	AwsLogSourceArray{ AwsLogSourceArgs{...} }
   150  type AwsLogSourceArrayInput interface {
   151  	pulumi.Input
   152  
   153  	ToAwsLogSourceArrayOutput() AwsLogSourceArrayOutput
   154  	ToAwsLogSourceArrayOutputWithContext(context.Context) AwsLogSourceArrayOutput
   155  }
   156  
   157  type AwsLogSourceArray []AwsLogSourceInput
   158  
   159  func (AwsLogSourceArray) ElementType() reflect.Type {
   160  	return reflect.TypeOf((*[]*AwsLogSource)(nil)).Elem()
   161  }
   162  
   163  func (i AwsLogSourceArray) ToAwsLogSourceArrayOutput() AwsLogSourceArrayOutput {
   164  	return i.ToAwsLogSourceArrayOutputWithContext(context.Background())
   165  }
   166  
   167  func (i AwsLogSourceArray) ToAwsLogSourceArrayOutputWithContext(ctx context.Context) AwsLogSourceArrayOutput {
   168  	return pulumi.ToOutputWithContext(ctx, i).(AwsLogSourceArrayOutput)
   169  }
   170  
   171  // AwsLogSourceMapInput is an input type that accepts AwsLogSourceMap and AwsLogSourceMapOutput values.
   172  // You can construct a concrete instance of `AwsLogSourceMapInput` via:
   173  //
   174  //	AwsLogSourceMap{ "key": AwsLogSourceArgs{...} }
   175  type AwsLogSourceMapInput interface {
   176  	pulumi.Input
   177  
   178  	ToAwsLogSourceMapOutput() AwsLogSourceMapOutput
   179  	ToAwsLogSourceMapOutputWithContext(context.Context) AwsLogSourceMapOutput
   180  }
   181  
   182  type AwsLogSourceMap map[string]AwsLogSourceInput
   183  
   184  func (AwsLogSourceMap) ElementType() reflect.Type {
   185  	return reflect.TypeOf((*map[string]*AwsLogSource)(nil)).Elem()
   186  }
   187  
   188  func (i AwsLogSourceMap) ToAwsLogSourceMapOutput() AwsLogSourceMapOutput {
   189  	return i.ToAwsLogSourceMapOutputWithContext(context.Background())
   190  }
   191  
   192  func (i AwsLogSourceMap) ToAwsLogSourceMapOutputWithContext(ctx context.Context) AwsLogSourceMapOutput {
   193  	return pulumi.ToOutputWithContext(ctx, i).(AwsLogSourceMapOutput)
   194  }
   195  
   196  type AwsLogSourceOutput struct{ *pulumi.OutputState }
   197  
   198  func (AwsLogSourceOutput) ElementType() reflect.Type {
   199  	return reflect.TypeOf((**AwsLogSource)(nil)).Elem()
   200  }
   201  
   202  func (o AwsLogSourceOutput) ToAwsLogSourceOutput() AwsLogSourceOutput {
   203  	return o
   204  }
   205  
   206  func (o AwsLogSourceOutput) ToAwsLogSourceOutputWithContext(ctx context.Context) AwsLogSourceOutput {
   207  	return o
   208  }
   209  
   210  // Specify the natively-supported AWS service to add as a source in Security Lake.
   211  func (o AwsLogSourceOutput) Source() AwsLogSourceSourcePtrOutput {
   212  	return o.ApplyT(func(v *AwsLogSource) AwsLogSourceSourcePtrOutput { return v.Source }).(AwsLogSourceSourcePtrOutput)
   213  }
   214  
   215  type AwsLogSourceArrayOutput struct{ *pulumi.OutputState }
   216  
   217  func (AwsLogSourceArrayOutput) ElementType() reflect.Type {
   218  	return reflect.TypeOf((*[]*AwsLogSource)(nil)).Elem()
   219  }
   220  
   221  func (o AwsLogSourceArrayOutput) ToAwsLogSourceArrayOutput() AwsLogSourceArrayOutput {
   222  	return o
   223  }
   224  
   225  func (o AwsLogSourceArrayOutput) ToAwsLogSourceArrayOutputWithContext(ctx context.Context) AwsLogSourceArrayOutput {
   226  	return o
   227  }
   228  
   229  func (o AwsLogSourceArrayOutput) Index(i pulumi.IntInput) AwsLogSourceOutput {
   230  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AwsLogSource {
   231  		return vs[0].([]*AwsLogSource)[vs[1].(int)]
   232  	}).(AwsLogSourceOutput)
   233  }
   234  
   235  type AwsLogSourceMapOutput struct{ *pulumi.OutputState }
   236  
   237  func (AwsLogSourceMapOutput) ElementType() reflect.Type {
   238  	return reflect.TypeOf((*map[string]*AwsLogSource)(nil)).Elem()
   239  }
   240  
   241  func (o AwsLogSourceMapOutput) ToAwsLogSourceMapOutput() AwsLogSourceMapOutput {
   242  	return o
   243  }
   244  
   245  func (o AwsLogSourceMapOutput) ToAwsLogSourceMapOutputWithContext(ctx context.Context) AwsLogSourceMapOutput {
   246  	return o
   247  }
   248  
   249  func (o AwsLogSourceMapOutput) MapIndex(k pulumi.StringInput) AwsLogSourceOutput {
   250  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AwsLogSource {
   251  		return vs[0].(map[string]*AwsLogSource)[vs[1].(string)]
   252  	}).(AwsLogSourceOutput)
   253  }
   254  
   255  func init() {
   256  	pulumi.RegisterInputType(reflect.TypeOf((*AwsLogSourceInput)(nil)).Elem(), &AwsLogSource{})
   257  	pulumi.RegisterInputType(reflect.TypeOf((*AwsLogSourceArrayInput)(nil)).Elem(), AwsLogSourceArray{})
   258  	pulumi.RegisterInputType(reflect.TypeOf((*AwsLogSourceMapInput)(nil)).Elem(), AwsLogSourceMap{})
   259  	pulumi.RegisterOutputType(AwsLogSourceOutput{})
   260  	pulumi.RegisterOutputType(AwsLogSourceArrayOutput{})
   261  	pulumi.RegisterOutputType(AwsLogSourceMapOutput{})
   262  }