github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/securitylake/customLogSource.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 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Resource for managing an AWS Security Lake Custom Log Source. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/securitylake" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := securitylake.NewCustomLogSource(ctx, "example", &securitylake.CustomLogSourceArgs{ 35 // SourceName: pulumi.String("example-name"), 36 // SourceVersion: pulumi.String("1.0"), 37 // EventClasses: pulumi.StringArray{ 38 // pulumi.String("FILE_ACTIVITY"), 39 // }, 40 // Configuration: &securitylake.CustomLogSourceConfigurationArgs{ 41 // CrawlerConfiguration: &securitylake.CustomLogSourceConfigurationCrawlerConfigurationArgs{ 42 // RoleArn: pulumi.Any(customLog.Arn), 43 // }, 44 // ProviderIdentity: &securitylake.CustomLogSourceConfigurationProviderIdentityArgs{ 45 // ExternalId: pulumi.String("example-id"), 46 // Principal: pulumi.String("123456789012"), 47 // }, 48 // }, 49 // }) 50 // if err != nil { 51 // return err 52 // } 53 // return nil 54 // }) 55 // } 56 // 57 // ``` 58 // <!--End PulumiCodeChooser --> 59 // 60 // ## Import 61 // 62 // Using `pulumi import`, import Custom log sources using the source name. For example: 63 // 64 // ```sh 65 // $ pulumi import aws:securitylake/customLogSource:CustomLogSource example example-name 66 // ``` 67 type CustomLogSource struct { 68 pulumi.CustomResourceState 69 70 // The attributes of a third-party custom source. 71 Attributes CustomLogSourceAttributeArrayOutput `pulumi:"attributes"` 72 // The configuration for the third-party custom source. 73 Configuration CustomLogSourceConfigurationPtrOutput `pulumi:"configuration"` 74 // The Open Cybersecurity Schema Framework (OCSF) event classes which describes the type of data that the custom source will send to Security Lake. 75 EventClasses pulumi.StringArrayOutput `pulumi:"eventClasses"` 76 // The details of the log provider for a third-party custom source. 77 ProviderDetails CustomLogSourceProviderDetailArrayOutput `pulumi:"providerDetails"` 78 // Specify the name for a third-party custom source. This must be a Regionally unique value. 79 SourceName pulumi.StringOutput `pulumi:"sourceName"` 80 // Specify the source version for the third-party custom source, to limit log collection to a specific version of custom data source. 81 SourceVersion pulumi.StringOutput `pulumi:"sourceVersion"` 82 } 83 84 // NewCustomLogSource registers a new resource with the given unique name, arguments, and options. 85 func NewCustomLogSource(ctx *pulumi.Context, 86 name string, args *CustomLogSourceArgs, opts ...pulumi.ResourceOption) (*CustomLogSource, error) { 87 if args == nil { 88 return nil, errors.New("missing one or more required arguments") 89 } 90 91 if args.SourceName == nil { 92 return nil, errors.New("invalid value for required argument 'SourceName'") 93 } 94 opts = internal.PkgResourceDefaultOpts(opts) 95 var resource CustomLogSource 96 err := ctx.RegisterResource("aws:securitylake/customLogSource:CustomLogSource", name, args, &resource, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return &resource, nil 101 } 102 103 // GetCustomLogSource gets an existing CustomLogSource resource's state with the given name, ID, and optional 104 // state properties that are used to uniquely qualify the lookup (nil if not required). 105 func GetCustomLogSource(ctx *pulumi.Context, 106 name string, id pulumi.IDInput, state *CustomLogSourceState, opts ...pulumi.ResourceOption) (*CustomLogSource, error) { 107 var resource CustomLogSource 108 err := ctx.ReadResource("aws:securitylake/customLogSource:CustomLogSource", name, id, state, &resource, opts...) 109 if err != nil { 110 return nil, err 111 } 112 return &resource, nil 113 } 114 115 // Input properties used for looking up and filtering CustomLogSource resources. 116 type customLogSourceState struct { 117 // The attributes of a third-party custom source. 118 Attributes []CustomLogSourceAttribute `pulumi:"attributes"` 119 // The configuration for the third-party custom source. 120 Configuration *CustomLogSourceConfiguration `pulumi:"configuration"` 121 // The Open Cybersecurity Schema Framework (OCSF) event classes which describes the type of data that the custom source will send to Security Lake. 122 EventClasses []string `pulumi:"eventClasses"` 123 // The details of the log provider for a third-party custom source. 124 ProviderDetails []CustomLogSourceProviderDetail `pulumi:"providerDetails"` 125 // Specify the name for a third-party custom source. This must be a Regionally unique value. 126 SourceName *string `pulumi:"sourceName"` 127 // Specify the source version for the third-party custom source, to limit log collection to a specific version of custom data source. 128 SourceVersion *string `pulumi:"sourceVersion"` 129 } 130 131 type CustomLogSourceState struct { 132 // The attributes of a third-party custom source. 133 Attributes CustomLogSourceAttributeArrayInput 134 // The configuration for the third-party custom source. 135 Configuration CustomLogSourceConfigurationPtrInput 136 // The Open Cybersecurity Schema Framework (OCSF) event classes which describes the type of data that the custom source will send to Security Lake. 137 EventClasses pulumi.StringArrayInput 138 // The details of the log provider for a third-party custom source. 139 ProviderDetails CustomLogSourceProviderDetailArrayInput 140 // Specify the name for a third-party custom source. This must be a Regionally unique value. 141 SourceName pulumi.StringPtrInput 142 // Specify the source version for the third-party custom source, to limit log collection to a specific version of custom data source. 143 SourceVersion pulumi.StringPtrInput 144 } 145 146 func (CustomLogSourceState) ElementType() reflect.Type { 147 return reflect.TypeOf((*customLogSourceState)(nil)).Elem() 148 } 149 150 type customLogSourceArgs struct { 151 // The configuration for the third-party custom source. 152 Configuration *CustomLogSourceConfiguration `pulumi:"configuration"` 153 // The Open Cybersecurity Schema Framework (OCSF) event classes which describes the type of data that the custom source will send to Security Lake. 154 EventClasses []string `pulumi:"eventClasses"` 155 // Specify the name for a third-party custom source. This must be a Regionally unique value. 156 SourceName string `pulumi:"sourceName"` 157 // Specify the source version for the third-party custom source, to limit log collection to a specific version of custom data source. 158 SourceVersion *string `pulumi:"sourceVersion"` 159 } 160 161 // The set of arguments for constructing a CustomLogSource resource. 162 type CustomLogSourceArgs struct { 163 // The configuration for the third-party custom source. 164 Configuration CustomLogSourceConfigurationPtrInput 165 // The Open Cybersecurity Schema Framework (OCSF) event classes which describes the type of data that the custom source will send to Security Lake. 166 EventClasses pulumi.StringArrayInput 167 // Specify the name for a third-party custom source. This must be a Regionally unique value. 168 SourceName pulumi.StringInput 169 // Specify the source version for the third-party custom source, to limit log collection to a specific version of custom data source. 170 SourceVersion pulumi.StringPtrInput 171 } 172 173 func (CustomLogSourceArgs) ElementType() reflect.Type { 174 return reflect.TypeOf((*customLogSourceArgs)(nil)).Elem() 175 } 176 177 type CustomLogSourceInput interface { 178 pulumi.Input 179 180 ToCustomLogSourceOutput() CustomLogSourceOutput 181 ToCustomLogSourceOutputWithContext(ctx context.Context) CustomLogSourceOutput 182 } 183 184 func (*CustomLogSource) ElementType() reflect.Type { 185 return reflect.TypeOf((**CustomLogSource)(nil)).Elem() 186 } 187 188 func (i *CustomLogSource) ToCustomLogSourceOutput() CustomLogSourceOutput { 189 return i.ToCustomLogSourceOutputWithContext(context.Background()) 190 } 191 192 func (i *CustomLogSource) ToCustomLogSourceOutputWithContext(ctx context.Context) CustomLogSourceOutput { 193 return pulumi.ToOutputWithContext(ctx, i).(CustomLogSourceOutput) 194 } 195 196 // CustomLogSourceArrayInput is an input type that accepts CustomLogSourceArray and CustomLogSourceArrayOutput values. 197 // You can construct a concrete instance of `CustomLogSourceArrayInput` via: 198 // 199 // CustomLogSourceArray{ CustomLogSourceArgs{...} } 200 type CustomLogSourceArrayInput interface { 201 pulumi.Input 202 203 ToCustomLogSourceArrayOutput() CustomLogSourceArrayOutput 204 ToCustomLogSourceArrayOutputWithContext(context.Context) CustomLogSourceArrayOutput 205 } 206 207 type CustomLogSourceArray []CustomLogSourceInput 208 209 func (CustomLogSourceArray) ElementType() reflect.Type { 210 return reflect.TypeOf((*[]*CustomLogSource)(nil)).Elem() 211 } 212 213 func (i CustomLogSourceArray) ToCustomLogSourceArrayOutput() CustomLogSourceArrayOutput { 214 return i.ToCustomLogSourceArrayOutputWithContext(context.Background()) 215 } 216 217 func (i CustomLogSourceArray) ToCustomLogSourceArrayOutputWithContext(ctx context.Context) CustomLogSourceArrayOutput { 218 return pulumi.ToOutputWithContext(ctx, i).(CustomLogSourceArrayOutput) 219 } 220 221 // CustomLogSourceMapInput is an input type that accepts CustomLogSourceMap and CustomLogSourceMapOutput values. 222 // You can construct a concrete instance of `CustomLogSourceMapInput` via: 223 // 224 // CustomLogSourceMap{ "key": CustomLogSourceArgs{...} } 225 type CustomLogSourceMapInput interface { 226 pulumi.Input 227 228 ToCustomLogSourceMapOutput() CustomLogSourceMapOutput 229 ToCustomLogSourceMapOutputWithContext(context.Context) CustomLogSourceMapOutput 230 } 231 232 type CustomLogSourceMap map[string]CustomLogSourceInput 233 234 func (CustomLogSourceMap) ElementType() reflect.Type { 235 return reflect.TypeOf((*map[string]*CustomLogSource)(nil)).Elem() 236 } 237 238 func (i CustomLogSourceMap) ToCustomLogSourceMapOutput() CustomLogSourceMapOutput { 239 return i.ToCustomLogSourceMapOutputWithContext(context.Background()) 240 } 241 242 func (i CustomLogSourceMap) ToCustomLogSourceMapOutputWithContext(ctx context.Context) CustomLogSourceMapOutput { 243 return pulumi.ToOutputWithContext(ctx, i).(CustomLogSourceMapOutput) 244 } 245 246 type CustomLogSourceOutput struct{ *pulumi.OutputState } 247 248 func (CustomLogSourceOutput) ElementType() reflect.Type { 249 return reflect.TypeOf((**CustomLogSource)(nil)).Elem() 250 } 251 252 func (o CustomLogSourceOutput) ToCustomLogSourceOutput() CustomLogSourceOutput { 253 return o 254 } 255 256 func (o CustomLogSourceOutput) ToCustomLogSourceOutputWithContext(ctx context.Context) CustomLogSourceOutput { 257 return o 258 } 259 260 // The attributes of a third-party custom source. 261 func (o CustomLogSourceOutput) Attributes() CustomLogSourceAttributeArrayOutput { 262 return o.ApplyT(func(v *CustomLogSource) CustomLogSourceAttributeArrayOutput { return v.Attributes }).(CustomLogSourceAttributeArrayOutput) 263 } 264 265 // The configuration for the third-party custom source. 266 func (o CustomLogSourceOutput) Configuration() CustomLogSourceConfigurationPtrOutput { 267 return o.ApplyT(func(v *CustomLogSource) CustomLogSourceConfigurationPtrOutput { return v.Configuration }).(CustomLogSourceConfigurationPtrOutput) 268 } 269 270 // The Open Cybersecurity Schema Framework (OCSF) event classes which describes the type of data that the custom source will send to Security Lake. 271 func (o CustomLogSourceOutput) EventClasses() pulumi.StringArrayOutput { 272 return o.ApplyT(func(v *CustomLogSource) pulumi.StringArrayOutput { return v.EventClasses }).(pulumi.StringArrayOutput) 273 } 274 275 // The details of the log provider for a third-party custom source. 276 func (o CustomLogSourceOutput) ProviderDetails() CustomLogSourceProviderDetailArrayOutput { 277 return o.ApplyT(func(v *CustomLogSource) CustomLogSourceProviderDetailArrayOutput { return v.ProviderDetails }).(CustomLogSourceProviderDetailArrayOutput) 278 } 279 280 // Specify the name for a third-party custom source. This must be a Regionally unique value. 281 func (o CustomLogSourceOutput) SourceName() pulumi.StringOutput { 282 return o.ApplyT(func(v *CustomLogSource) pulumi.StringOutput { return v.SourceName }).(pulumi.StringOutput) 283 } 284 285 // Specify the source version for the third-party custom source, to limit log collection to a specific version of custom data source. 286 func (o CustomLogSourceOutput) SourceVersion() pulumi.StringOutput { 287 return o.ApplyT(func(v *CustomLogSource) pulumi.StringOutput { return v.SourceVersion }).(pulumi.StringOutput) 288 } 289 290 type CustomLogSourceArrayOutput struct{ *pulumi.OutputState } 291 292 func (CustomLogSourceArrayOutput) ElementType() reflect.Type { 293 return reflect.TypeOf((*[]*CustomLogSource)(nil)).Elem() 294 } 295 296 func (o CustomLogSourceArrayOutput) ToCustomLogSourceArrayOutput() CustomLogSourceArrayOutput { 297 return o 298 } 299 300 func (o CustomLogSourceArrayOutput) ToCustomLogSourceArrayOutputWithContext(ctx context.Context) CustomLogSourceArrayOutput { 301 return o 302 } 303 304 func (o CustomLogSourceArrayOutput) Index(i pulumi.IntInput) CustomLogSourceOutput { 305 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomLogSource { 306 return vs[0].([]*CustomLogSource)[vs[1].(int)] 307 }).(CustomLogSourceOutput) 308 } 309 310 type CustomLogSourceMapOutput struct{ *pulumi.OutputState } 311 312 func (CustomLogSourceMapOutput) ElementType() reflect.Type { 313 return reflect.TypeOf((*map[string]*CustomLogSource)(nil)).Elem() 314 } 315 316 func (o CustomLogSourceMapOutput) ToCustomLogSourceMapOutput() CustomLogSourceMapOutput { 317 return o 318 } 319 320 func (o CustomLogSourceMapOutput) ToCustomLogSourceMapOutputWithContext(ctx context.Context) CustomLogSourceMapOutput { 321 return o 322 } 323 324 func (o CustomLogSourceMapOutput) MapIndex(k pulumi.StringInput) CustomLogSourceOutput { 325 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomLogSource { 326 return vs[0].(map[string]*CustomLogSource)[vs[1].(string)] 327 }).(CustomLogSourceOutput) 328 } 329 330 func init() { 331 pulumi.RegisterInputType(reflect.TypeOf((*CustomLogSourceInput)(nil)).Elem(), &CustomLogSource{}) 332 pulumi.RegisterInputType(reflect.TypeOf((*CustomLogSourceArrayInput)(nil)).Elem(), CustomLogSourceArray{}) 333 pulumi.RegisterInputType(reflect.TypeOf((*CustomLogSourceMapInput)(nil)).Elem(), CustomLogSourceMap{}) 334 pulumi.RegisterOutputType(CustomLogSourceOutput{}) 335 pulumi.RegisterOutputType(CustomLogSourceArrayOutput{}) 336 pulumi.RegisterOutputType(CustomLogSourceMapOutput{}) 337 }