github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/flowLog.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 ec2 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 // Provides a VPC/Subnet/ENI/Transit Gateway/Transit Gateway Attachment Flow Log to capture IP traffic for a specific network 15 // interface, subnet, or VPC. Logs are sent to a CloudWatch Log Group, a S3 Bucket, or Amazon Kinesis Data Firehose 16 // 17 // ## Example Usage 18 // 19 // ### CloudWatch Logging 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch" 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 30 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 31 // 32 // ) 33 // 34 // func main() { 35 // pulumi.Run(func(ctx *pulumi.Context) error { 36 // exampleLogGroup, err := cloudwatch.NewLogGroup(ctx, "example", &cloudwatch.LogGroupArgs{ 37 // Name: pulumi.String("example"), 38 // }) 39 // if err != nil { 40 // return err 41 // } 42 // assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{ 43 // Statements: []iam.GetPolicyDocumentStatement{ 44 // { 45 // Effect: pulumi.StringRef("Allow"), 46 // Principals: []iam.GetPolicyDocumentStatementPrincipal{ 47 // { 48 // Type: "Service", 49 // Identifiers: []string{ 50 // "vpc-flow-logs.amazonaws.com", 51 // }, 52 // }, 53 // }, 54 // Actions: []string{ 55 // "sts:AssumeRole", 56 // }, 57 // }, 58 // }, 59 // }, nil) 60 // if err != nil { 61 // return err 62 // } 63 // exampleRole, err := iam.NewRole(ctx, "example", &iam.RoleArgs{ 64 // Name: pulumi.String("example"), 65 // AssumeRolePolicy: pulumi.String(assumeRole.Json), 66 // }) 67 // if err != nil { 68 // return err 69 // } 70 // _, err = ec2.NewFlowLog(ctx, "example", &ec2.FlowLogArgs{ 71 // IamRoleArn: exampleRole.Arn, 72 // LogDestination: exampleLogGroup.Arn, 73 // TrafficType: pulumi.String("ALL"), 74 // VpcId: pulumi.Any(exampleAwsVpc.Id), 75 // }) 76 // if err != nil { 77 // return err 78 // } 79 // example, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{ 80 // Statements: []iam.GetPolicyDocumentStatement{ 81 // { 82 // Effect: pulumi.StringRef("Allow"), 83 // Actions: []string{ 84 // "logs:CreateLogGroup", 85 // "logs:CreateLogStream", 86 // "logs:PutLogEvents", 87 // "logs:DescribeLogGroups", 88 // "logs:DescribeLogStreams", 89 // }, 90 // Resources: []string{ 91 // "*", 92 // }, 93 // }, 94 // }, 95 // }, nil) 96 // if err != nil { 97 // return err 98 // } 99 // _, err = iam.NewRolePolicy(ctx, "example", &iam.RolePolicyArgs{ 100 // Name: pulumi.String("example"), 101 // Role: exampleRole.ID(), 102 // Policy: pulumi.String(example.Json), 103 // }) 104 // if err != nil { 105 // return err 106 // } 107 // return nil 108 // }) 109 // } 110 // 111 // ``` 112 // <!--End PulumiCodeChooser --> 113 // 114 // ### S3 Logging 115 // 116 // <!--Start PulumiCodeChooser --> 117 // ```go 118 // package main 119 // 120 // import ( 121 // 122 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 123 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 124 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 125 // 126 // ) 127 // 128 // func main() { 129 // pulumi.Run(func(ctx *pulumi.Context) error { 130 // exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{ 131 // Bucket: pulumi.String("example"), 132 // }) 133 // if err != nil { 134 // return err 135 // } 136 // _, err = ec2.NewFlowLog(ctx, "example", &ec2.FlowLogArgs{ 137 // LogDestination: exampleBucketV2.Arn, 138 // LogDestinationType: pulumi.String("s3"), 139 // TrafficType: pulumi.String("ALL"), 140 // VpcId: pulumi.Any(exampleAwsVpc.Id), 141 // }) 142 // if err != nil { 143 // return err 144 // } 145 // return nil 146 // }) 147 // } 148 // 149 // ``` 150 // <!--End PulumiCodeChooser --> 151 // 152 // ### S3 Logging in Apache Parquet format with per-hour partitions 153 // 154 // <!--Start PulumiCodeChooser --> 155 // ```go 156 // package main 157 // 158 // import ( 159 // 160 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 161 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 162 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 163 // 164 // ) 165 // 166 // func main() { 167 // pulumi.Run(func(ctx *pulumi.Context) error { 168 // exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{ 169 // Bucket: pulumi.String("example"), 170 // }) 171 // if err != nil { 172 // return err 173 // } 174 // _, err = ec2.NewFlowLog(ctx, "example", &ec2.FlowLogArgs{ 175 // LogDestination: exampleBucketV2.Arn, 176 // LogDestinationType: pulumi.String("s3"), 177 // TrafficType: pulumi.String("ALL"), 178 // VpcId: pulumi.Any(exampleAwsVpc.Id), 179 // DestinationOptions: &ec2.FlowLogDestinationOptionsArgs{ 180 // FileFormat: pulumi.String("parquet"), 181 // PerHourPartition: pulumi.Bool(true), 182 // }, 183 // }) 184 // if err != nil { 185 // return err 186 // } 187 // return nil 188 // }) 189 // } 190 // 191 // ``` 192 // <!--End PulumiCodeChooser --> 193 // 194 // ## Import 195 // 196 // Using `pulumi import`, import Flow Logs using the `id`. For example: 197 // 198 // ```sh 199 // $ pulumi import aws:ec2/flowLog:FlowLog test_flow_log fl-1a2b3c4d 200 // ``` 201 type FlowLog struct { 202 pulumi.CustomResourceState 203 204 // The ARN of the Flow Log. 205 Arn pulumi.StringOutput `pulumi:"arn"` 206 // ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. 207 DeliverCrossAccountRole pulumi.StringPtrOutput `pulumi:"deliverCrossAccountRole"` 208 // Describes the destination options for a flow log. More details below. 209 DestinationOptions FlowLogDestinationOptionsPtrOutput `pulumi:"destinationOptions"` 210 // Elastic Network Interface ID to attach to 211 EniId pulumi.StringPtrOutput `pulumi:"eniId"` 212 // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group 213 IamRoleArn pulumi.StringPtrOutput `pulumi:"iamRoleArn"` 214 // The ARN of the logging destination. Either `logDestination` or `logGroupName` must be set. 215 LogDestination pulumi.StringOutput `pulumi:"logDestination"` 216 // The type of the logging destination. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. 217 LogDestinationType pulumi.StringPtrOutput `pulumi:"logDestinationType"` 218 // The fields to include in the flow log record. Accepted format example: `"$${interface-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport}"`. 219 LogFormat pulumi.StringOutput `pulumi:"logFormat"` 220 // **Deprecated:** Use `logDestination` instead. The name of the CloudWatch log group. Either `logGroupName` or `logDestination` must be set. 221 // 222 // Deprecated: use 'log_destination' argument instead 223 LogGroupName pulumi.StringOutput `pulumi:"logGroupName"` 224 // The maximum interval of time 225 // during which a flow of packets is captured and aggregated into a flow 226 // log record. Valid Values: `60` seconds (1 minute) or `600` seconds (10 227 // minutes). Default: `600`. When `transitGatewayId` or `transitGatewayAttachmentId` is specified, `maxAggregationInterval` *must* be 60 seconds (1 minute). 228 MaxAggregationInterval pulumi.IntPtrOutput `pulumi:"maxAggregationInterval"` 229 // Subnet ID to attach to 230 SubnetId pulumi.StringPtrOutput `pulumi:"subnetId"` 231 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 232 Tags pulumi.StringMapOutput `pulumi:"tags"` 233 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 234 // 235 // Deprecated: Please use `tags` instead. 236 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 237 // The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. 238 TrafficType pulumi.StringPtrOutput `pulumi:"trafficType"` 239 // Transit Gateway Attachment ID to attach to 240 TransitGatewayAttachmentId pulumi.StringPtrOutput `pulumi:"transitGatewayAttachmentId"` 241 // Transit Gateway ID to attach to 242 TransitGatewayId pulumi.StringPtrOutput `pulumi:"transitGatewayId"` 243 // VPC ID to attach to 244 VpcId pulumi.StringPtrOutput `pulumi:"vpcId"` 245 } 246 247 // NewFlowLog registers a new resource with the given unique name, arguments, and options. 248 func NewFlowLog(ctx *pulumi.Context, 249 name string, args *FlowLogArgs, opts ...pulumi.ResourceOption) (*FlowLog, error) { 250 if args == nil { 251 args = &FlowLogArgs{} 252 } 253 254 opts = internal.PkgResourceDefaultOpts(opts) 255 var resource FlowLog 256 err := ctx.RegisterResource("aws:ec2/flowLog:FlowLog", name, args, &resource, opts...) 257 if err != nil { 258 return nil, err 259 } 260 return &resource, nil 261 } 262 263 // GetFlowLog gets an existing FlowLog resource's state with the given name, ID, and optional 264 // state properties that are used to uniquely qualify the lookup (nil if not required). 265 func GetFlowLog(ctx *pulumi.Context, 266 name string, id pulumi.IDInput, state *FlowLogState, opts ...pulumi.ResourceOption) (*FlowLog, error) { 267 var resource FlowLog 268 err := ctx.ReadResource("aws:ec2/flowLog:FlowLog", name, id, state, &resource, opts...) 269 if err != nil { 270 return nil, err 271 } 272 return &resource, nil 273 } 274 275 // Input properties used for looking up and filtering FlowLog resources. 276 type flowLogState struct { 277 // The ARN of the Flow Log. 278 Arn *string `pulumi:"arn"` 279 // ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. 280 DeliverCrossAccountRole *string `pulumi:"deliverCrossAccountRole"` 281 // Describes the destination options for a flow log. More details below. 282 DestinationOptions *FlowLogDestinationOptions `pulumi:"destinationOptions"` 283 // Elastic Network Interface ID to attach to 284 EniId *string `pulumi:"eniId"` 285 // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group 286 IamRoleArn *string `pulumi:"iamRoleArn"` 287 // The ARN of the logging destination. Either `logDestination` or `logGroupName` must be set. 288 LogDestination *string `pulumi:"logDestination"` 289 // The type of the logging destination. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. 290 LogDestinationType *string `pulumi:"logDestinationType"` 291 // The fields to include in the flow log record. Accepted format example: `"$${interface-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport}"`. 292 LogFormat *string `pulumi:"logFormat"` 293 // **Deprecated:** Use `logDestination` instead. The name of the CloudWatch log group. Either `logGroupName` or `logDestination` must be set. 294 // 295 // Deprecated: use 'log_destination' argument instead 296 LogGroupName *string `pulumi:"logGroupName"` 297 // The maximum interval of time 298 // during which a flow of packets is captured and aggregated into a flow 299 // log record. Valid Values: `60` seconds (1 minute) or `600` seconds (10 300 // minutes). Default: `600`. When `transitGatewayId` or `transitGatewayAttachmentId` is specified, `maxAggregationInterval` *must* be 60 seconds (1 minute). 301 MaxAggregationInterval *int `pulumi:"maxAggregationInterval"` 302 // Subnet ID to attach to 303 SubnetId *string `pulumi:"subnetId"` 304 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 305 Tags map[string]string `pulumi:"tags"` 306 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 307 // 308 // Deprecated: Please use `tags` instead. 309 TagsAll map[string]string `pulumi:"tagsAll"` 310 // The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. 311 TrafficType *string `pulumi:"trafficType"` 312 // Transit Gateway Attachment ID to attach to 313 TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"` 314 // Transit Gateway ID to attach to 315 TransitGatewayId *string `pulumi:"transitGatewayId"` 316 // VPC ID to attach to 317 VpcId *string `pulumi:"vpcId"` 318 } 319 320 type FlowLogState struct { 321 // The ARN of the Flow Log. 322 Arn pulumi.StringPtrInput 323 // ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. 324 DeliverCrossAccountRole pulumi.StringPtrInput 325 // Describes the destination options for a flow log. More details below. 326 DestinationOptions FlowLogDestinationOptionsPtrInput 327 // Elastic Network Interface ID to attach to 328 EniId pulumi.StringPtrInput 329 // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group 330 IamRoleArn pulumi.StringPtrInput 331 // The ARN of the logging destination. Either `logDestination` or `logGroupName` must be set. 332 LogDestination pulumi.StringPtrInput 333 // The type of the logging destination. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. 334 LogDestinationType pulumi.StringPtrInput 335 // The fields to include in the flow log record. Accepted format example: `"$${interface-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport}"`. 336 LogFormat pulumi.StringPtrInput 337 // **Deprecated:** Use `logDestination` instead. The name of the CloudWatch log group. Either `logGroupName` or `logDestination` must be set. 338 // 339 // Deprecated: use 'log_destination' argument instead 340 LogGroupName pulumi.StringPtrInput 341 // The maximum interval of time 342 // during which a flow of packets is captured and aggregated into a flow 343 // log record. Valid Values: `60` seconds (1 minute) or `600` seconds (10 344 // minutes). Default: `600`. When `transitGatewayId` or `transitGatewayAttachmentId` is specified, `maxAggregationInterval` *must* be 60 seconds (1 minute). 345 MaxAggregationInterval pulumi.IntPtrInput 346 // Subnet ID to attach to 347 SubnetId pulumi.StringPtrInput 348 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 349 Tags pulumi.StringMapInput 350 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 351 // 352 // Deprecated: Please use `tags` instead. 353 TagsAll pulumi.StringMapInput 354 // The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. 355 TrafficType pulumi.StringPtrInput 356 // Transit Gateway Attachment ID to attach to 357 TransitGatewayAttachmentId pulumi.StringPtrInput 358 // Transit Gateway ID to attach to 359 TransitGatewayId pulumi.StringPtrInput 360 // VPC ID to attach to 361 VpcId pulumi.StringPtrInput 362 } 363 364 func (FlowLogState) ElementType() reflect.Type { 365 return reflect.TypeOf((*flowLogState)(nil)).Elem() 366 } 367 368 type flowLogArgs struct { 369 // ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. 370 DeliverCrossAccountRole *string `pulumi:"deliverCrossAccountRole"` 371 // Describes the destination options for a flow log. More details below. 372 DestinationOptions *FlowLogDestinationOptions `pulumi:"destinationOptions"` 373 // Elastic Network Interface ID to attach to 374 EniId *string `pulumi:"eniId"` 375 // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group 376 IamRoleArn *string `pulumi:"iamRoleArn"` 377 // The ARN of the logging destination. Either `logDestination` or `logGroupName` must be set. 378 LogDestination *string `pulumi:"logDestination"` 379 // The type of the logging destination. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. 380 LogDestinationType *string `pulumi:"logDestinationType"` 381 // The fields to include in the flow log record. Accepted format example: `"$${interface-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport}"`. 382 LogFormat *string `pulumi:"logFormat"` 383 // **Deprecated:** Use `logDestination` instead. The name of the CloudWatch log group. Either `logGroupName` or `logDestination` must be set. 384 // 385 // Deprecated: use 'log_destination' argument instead 386 LogGroupName *string `pulumi:"logGroupName"` 387 // The maximum interval of time 388 // during which a flow of packets is captured and aggregated into a flow 389 // log record. Valid Values: `60` seconds (1 minute) or `600` seconds (10 390 // minutes). Default: `600`. When `transitGatewayId` or `transitGatewayAttachmentId` is specified, `maxAggregationInterval` *must* be 60 seconds (1 minute). 391 MaxAggregationInterval *int `pulumi:"maxAggregationInterval"` 392 // Subnet ID to attach to 393 SubnetId *string `pulumi:"subnetId"` 394 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 395 Tags map[string]string `pulumi:"tags"` 396 // The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. 397 TrafficType *string `pulumi:"trafficType"` 398 // Transit Gateway Attachment ID to attach to 399 TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"` 400 // Transit Gateway ID to attach to 401 TransitGatewayId *string `pulumi:"transitGatewayId"` 402 // VPC ID to attach to 403 VpcId *string `pulumi:"vpcId"` 404 } 405 406 // The set of arguments for constructing a FlowLog resource. 407 type FlowLogArgs struct { 408 // ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. 409 DeliverCrossAccountRole pulumi.StringPtrInput 410 // Describes the destination options for a flow log. More details below. 411 DestinationOptions FlowLogDestinationOptionsPtrInput 412 // Elastic Network Interface ID to attach to 413 EniId pulumi.StringPtrInput 414 // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group 415 IamRoleArn pulumi.StringPtrInput 416 // The ARN of the logging destination. Either `logDestination` or `logGroupName` must be set. 417 LogDestination pulumi.StringPtrInput 418 // The type of the logging destination. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. 419 LogDestinationType pulumi.StringPtrInput 420 // The fields to include in the flow log record. Accepted format example: `"$${interface-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport}"`. 421 LogFormat pulumi.StringPtrInput 422 // **Deprecated:** Use `logDestination` instead. The name of the CloudWatch log group. Either `logGroupName` or `logDestination` must be set. 423 // 424 // Deprecated: use 'log_destination' argument instead 425 LogGroupName pulumi.StringPtrInput 426 // The maximum interval of time 427 // during which a flow of packets is captured and aggregated into a flow 428 // log record. Valid Values: `60` seconds (1 minute) or `600` seconds (10 429 // minutes). Default: `600`. When `transitGatewayId` or `transitGatewayAttachmentId` is specified, `maxAggregationInterval` *must* be 60 seconds (1 minute). 430 MaxAggregationInterval pulumi.IntPtrInput 431 // Subnet ID to attach to 432 SubnetId pulumi.StringPtrInput 433 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 434 Tags pulumi.StringMapInput 435 // The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. 436 TrafficType pulumi.StringPtrInput 437 // Transit Gateway Attachment ID to attach to 438 TransitGatewayAttachmentId pulumi.StringPtrInput 439 // Transit Gateway ID to attach to 440 TransitGatewayId pulumi.StringPtrInput 441 // VPC ID to attach to 442 VpcId pulumi.StringPtrInput 443 } 444 445 func (FlowLogArgs) ElementType() reflect.Type { 446 return reflect.TypeOf((*flowLogArgs)(nil)).Elem() 447 } 448 449 type FlowLogInput interface { 450 pulumi.Input 451 452 ToFlowLogOutput() FlowLogOutput 453 ToFlowLogOutputWithContext(ctx context.Context) FlowLogOutput 454 } 455 456 func (*FlowLog) ElementType() reflect.Type { 457 return reflect.TypeOf((**FlowLog)(nil)).Elem() 458 } 459 460 func (i *FlowLog) ToFlowLogOutput() FlowLogOutput { 461 return i.ToFlowLogOutputWithContext(context.Background()) 462 } 463 464 func (i *FlowLog) ToFlowLogOutputWithContext(ctx context.Context) FlowLogOutput { 465 return pulumi.ToOutputWithContext(ctx, i).(FlowLogOutput) 466 } 467 468 // FlowLogArrayInput is an input type that accepts FlowLogArray and FlowLogArrayOutput values. 469 // You can construct a concrete instance of `FlowLogArrayInput` via: 470 // 471 // FlowLogArray{ FlowLogArgs{...} } 472 type FlowLogArrayInput interface { 473 pulumi.Input 474 475 ToFlowLogArrayOutput() FlowLogArrayOutput 476 ToFlowLogArrayOutputWithContext(context.Context) FlowLogArrayOutput 477 } 478 479 type FlowLogArray []FlowLogInput 480 481 func (FlowLogArray) ElementType() reflect.Type { 482 return reflect.TypeOf((*[]*FlowLog)(nil)).Elem() 483 } 484 485 func (i FlowLogArray) ToFlowLogArrayOutput() FlowLogArrayOutput { 486 return i.ToFlowLogArrayOutputWithContext(context.Background()) 487 } 488 489 func (i FlowLogArray) ToFlowLogArrayOutputWithContext(ctx context.Context) FlowLogArrayOutput { 490 return pulumi.ToOutputWithContext(ctx, i).(FlowLogArrayOutput) 491 } 492 493 // FlowLogMapInput is an input type that accepts FlowLogMap and FlowLogMapOutput values. 494 // You can construct a concrete instance of `FlowLogMapInput` via: 495 // 496 // FlowLogMap{ "key": FlowLogArgs{...} } 497 type FlowLogMapInput interface { 498 pulumi.Input 499 500 ToFlowLogMapOutput() FlowLogMapOutput 501 ToFlowLogMapOutputWithContext(context.Context) FlowLogMapOutput 502 } 503 504 type FlowLogMap map[string]FlowLogInput 505 506 func (FlowLogMap) ElementType() reflect.Type { 507 return reflect.TypeOf((*map[string]*FlowLog)(nil)).Elem() 508 } 509 510 func (i FlowLogMap) ToFlowLogMapOutput() FlowLogMapOutput { 511 return i.ToFlowLogMapOutputWithContext(context.Background()) 512 } 513 514 func (i FlowLogMap) ToFlowLogMapOutputWithContext(ctx context.Context) FlowLogMapOutput { 515 return pulumi.ToOutputWithContext(ctx, i).(FlowLogMapOutput) 516 } 517 518 type FlowLogOutput struct{ *pulumi.OutputState } 519 520 func (FlowLogOutput) ElementType() reflect.Type { 521 return reflect.TypeOf((**FlowLog)(nil)).Elem() 522 } 523 524 func (o FlowLogOutput) ToFlowLogOutput() FlowLogOutput { 525 return o 526 } 527 528 func (o FlowLogOutput) ToFlowLogOutputWithContext(ctx context.Context) FlowLogOutput { 529 return o 530 } 531 532 // The ARN of the Flow Log. 533 func (o FlowLogOutput) Arn() pulumi.StringOutput { 534 return o.ApplyT(func(v *FlowLog) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 535 } 536 537 // ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. 538 func (o FlowLogOutput) DeliverCrossAccountRole() pulumi.StringPtrOutput { 539 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.DeliverCrossAccountRole }).(pulumi.StringPtrOutput) 540 } 541 542 // Describes the destination options for a flow log. More details below. 543 func (o FlowLogOutput) DestinationOptions() FlowLogDestinationOptionsPtrOutput { 544 return o.ApplyT(func(v *FlowLog) FlowLogDestinationOptionsPtrOutput { return v.DestinationOptions }).(FlowLogDestinationOptionsPtrOutput) 545 } 546 547 // Elastic Network Interface ID to attach to 548 func (o FlowLogOutput) EniId() pulumi.StringPtrOutput { 549 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.EniId }).(pulumi.StringPtrOutput) 550 } 551 552 // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group 553 func (o FlowLogOutput) IamRoleArn() pulumi.StringPtrOutput { 554 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.IamRoleArn }).(pulumi.StringPtrOutput) 555 } 556 557 // The ARN of the logging destination. Either `logDestination` or `logGroupName` must be set. 558 func (o FlowLogOutput) LogDestination() pulumi.StringOutput { 559 return o.ApplyT(func(v *FlowLog) pulumi.StringOutput { return v.LogDestination }).(pulumi.StringOutput) 560 } 561 562 // The type of the logging destination. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. 563 func (o FlowLogOutput) LogDestinationType() pulumi.StringPtrOutput { 564 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.LogDestinationType }).(pulumi.StringPtrOutput) 565 } 566 567 // The fields to include in the flow log record. Accepted format example: `"$${interface-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport}"`. 568 func (o FlowLogOutput) LogFormat() pulumi.StringOutput { 569 return o.ApplyT(func(v *FlowLog) pulumi.StringOutput { return v.LogFormat }).(pulumi.StringOutput) 570 } 571 572 // **Deprecated:** Use `logDestination` instead. The name of the CloudWatch log group. Either `logGroupName` or `logDestination` must be set. 573 // 574 // Deprecated: use 'log_destination' argument instead 575 func (o FlowLogOutput) LogGroupName() pulumi.StringOutput { 576 return o.ApplyT(func(v *FlowLog) pulumi.StringOutput { return v.LogGroupName }).(pulumi.StringOutput) 577 } 578 579 // The maximum interval of time 580 // during which a flow of packets is captured and aggregated into a flow 581 // log record. Valid Values: `60` seconds (1 minute) or `600` seconds (10 582 // minutes). Default: `600`. When `transitGatewayId` or `transitGatewayAttachmentId` is specified, `maxAggregationInterval` *must* be 60 seconds (1 minute). 583 func (o FlowLogOutput) MaxAggregationInterval() pulumi.IntPtrOutput { 584 return o.ApplyT(func(v *FlowLog) pulumi.IntPtrOutput { return v.MaxAggregationInterval }).(pulumi.IntPtrOutput) 585 } 586 587 // Subnet ID to attach to 588 func (o FlowLogOutput) SubnetId() pulumi.StringPtrOutput { 589 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.SubnetId }).(pulumi.StringPtrOutput) 590 } 591 592 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 593 func (o FlowLogOutput) Tags() pulumi.StringMapOutput { 594 return o.ApplyT(func(v *FlowLog) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 595 } 596 597 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 598 // 599 // Deprecated: Please use `tags` instead. 600 func (o FlowLogOutput) TagsAll() pulumi.StringMapOutput { 601 return o.ApplyT(func(v *FlowLog) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 602 } 603 604 // The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. 605 func (o FlowLogOutput) TrafficType() pulumi.StringPtrOutput { 606 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.TrafficType }).(pulumi.StringPtrOutput) 607 } 608 609 // Transit Gateway Attachment ID to attach to 610 func (o FlowLogOutput) TransitGatewayAttachmentId() pulumi.StringPtrOutput { 611 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.TransitGatewayAttachmentId }).(pulumi.StringPtrOutput) 612 } 613 614 // Transit Gateway ID to attach to 615 func (o FlowLogOutput) TransitGatewayId() pulumi.StringPtrOutput { 616 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.TransitGatewayId }).(pulumi.StringPtrOutput) 617 } 618 619 // VPC ID to attach to 620 func (o FlowLogOutput) VpcId() pulumi.StringPtrOutput { 621 return o.ApplyT(func(v *FlowLog) pulumi.StringPtrOutput { return v.VpcId }).(pulumi.StringPtrOutput) 622 } 623 624 type FlowLogArrayOutput struct{ *pulumi.OutputState } 625 626 func (FlowLogArrayOutput) ElementType() reflect.Type { 627 return reflect.TypeOf((*[]*FlowLog)(nil)).Elem() 628 } 629 630 func (o FlowLogArrayOutput) ToFlowLogArrayOutput() FlowLogArrayOutput { 631 return o 632 } 633 634 func (o FlowLogArrayOutput) ToFlowLogArrayOutputWithContext(ctx context.Context) FlowLogArrayOutput { 635 return o 636 } 637 638 func (o FlowLogArrayOutput) Index(i pulumi.IntInput) FlowLogOutput { 639 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FlowLog { 640 return vs[0].([]*FlowLog)[vs[1].(int)] 641 }).(FlowLogOutput) 642 } 643 644 type FlowLogMapOutput struct{ *pulumi.OutputState } 645 646 func (FlowLogMapOutput) ElementType() reflect.Type { 647 return reflect.TypeOf((*map[string]*FlowLog)(nil)).Elem() 648 } 649 650 func (o FlowLogMapOutput) ToFlowLogMapOutput() FlowLogMapOutput { 651 return o 652 } 653 654 func (o FlowLogMapOutput) ToFlowLogMapOutputWithContext(ctx context.Context) FlowLogMapOutput { 655 return o 656 } 657 658 func (o FlowLogMapOutput) MapIndex(k pulumi.StringInput) FlowLogOutput { 659 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FlowLog { 660 return vs[0].(map[string]*FlowLog)[vs[1].(string)] 661 }).(FlowLogOutput) 662 } 663 664 func init() { 665 pulumi.RegisterInputType(reflect.TypeOf((*FlowLogInput)(nil)).Elem(), &FlowLog{}) 666 pulumi.RegisterInputType(reflect.TypeOf((*FlowLogArrayInput)(nil)).Elem(), FlowLogArray{}) 667 pulumi.RegisterInputType(reflect.TypeOf((*FlowLogMapInput)(nil)).Elem(), FlowLogMap{}) 668 pulumi.RegisterOutputType(FlowLogOutput{}) 669 pulumi.RegisterOutputType(FlowLogArrayOutput{}) 670 pulumi.RegisterOutputType(FlowLogMapOutput{}) 671 }