github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudtrail/trail.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 cloudtrail 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 // Provides a CloudTrail resource. 16 // 17 // > **Tip:** For a multi-region trail, this resource must be in the home region of the trail. 18 // 19 // > **Tip:** For an organization trail, this resource must be in the master account of the organization. 20 // 21 // ## Example Usage 22 // 23 // ### Basic 24 // 25 // Enable CloudTrail to capture all compatible management events in region. 26 // For capturing events from services like IAM, `includeGlobalServiceEvents` must be enabled. 27 // 28 // <!--Start PulumiCodeChooser --> 29 // ```go 30 // package main 31 // 32 // import ( 33 // 34 // "fmt" 35 // 36 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" 37 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail" 38 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 39 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 40 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 41 // 42 // ) 43 // 44 // func main() { 45 // pulumi.Run(func(ctx *pulumi.Context) error { 46 // exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{ 47 // Bucket: pulumi.String("my-test-trail"), 48 // ForceDestroy: pulumi.Bool(true), 49 // }) 50 // if err != nil { 51 // return err 52 // } 53 // current, err := aws.GetCallerIdentity(ctx, nil, nil) 54 // if err != nil { 55 // return err 56 // } 57 // currentGetPartition, err := aws.GetPartition(ctx, nil, nil) 58 // if err != nil { 59 // return err 60 // } 61 // currentGetRegion, err := aws.GetRegion(ctx, nil, nil) 62 // if err != nil { 63 // return err 64 // } 65 // example := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{ 66 // Statements: iam.GetPolicyDocumentStatementArray{ 67 // &iam.GetPolicyDocumentStatementArgs{ 68 // Sid: pulumi.String("AWSCloudTrailAclCheck"), 69 // Effect: pulumi.String("Allow"), 70 // Principals: iam.GetPolicyDocumentStatementPrincipalArray{ 71 // &iam.GetPolicyDocumentStatementPrincipalArgs{ 72 // Type: pulumi.String("Service"), 73 // Identifiers: pulumi.StringArray{ 74 // pulumi.String("cloudtrail.amazonaws.com"), 75 // }, 76 // }, 77 // }, 78 // Actions: pulumi.StringArray{ 79 // pulumi.String("s3:GetBucketAcl"), 80 // }, 81 // Resources: pulumi.StringArray{ 82 // exampleBucketV2.Arn, 83 // }, 84 // Conditions: iam.GetPolicyDocumentStatementConditionArray{ 85 // &iam.GetPolicyDocumentStatementConditionArgs{ 86 // Test: pulumi.String("StringEquals"), 87 // Variable: pulumi.String("aws:SourceArn"), 88 // Values: pulumi.StringArray{ 89 // pulumi.String(fmt.Sprintf("arn:%v:cloudtrail:%v:%v:trail/example", currentGetPartition.Partition, currentGetRegion.Name, current.AccountId)), 90 // }, 91 // }, 92 // }, 93 // }, 94 // &iam.GetPolicyDocumentStatementArgs{ 95 // Sid: pulumi.String("AWSCloudTrailWrite"), 96 // Effect: pulumi.String("Allow"), 97 // Principals: iam.GetPolicyDocumentStatementPrincipalArray{ 98 // &iam.GetPolicyDocumentStatementPrincipalArgs{ 99 // Type: pulumi.String("Service"), 100 // Identifiers: pulumi.StringArray{ 101 // pulumi.String("cloudtrail.amazonaws.com"), 102 // }, 103 // }, 104 // }, 105 // Actions: pulumi.StringArray{ 106 // pulumi.String("s3:PutObject"), 107 // }, 108 // Resources: pulumi.StringArray{ 109 // exampleBucketV2.Arn.ApplyT(func(arn string) (string, error) { 110 // return fmt.Sprintf("%v/prefix/AWSLogs/%v/*", arn, current.AccountId), nil 111 // }).(pulumi.StringOutput), 112 // }, 113 // Conditions: iam.GetPolicyDocumentStatementConditionArray{ 114 // &iam.GetPolicyDocumentStatementConditionArgs{ 115 // Test: pulumi.String("StringEquals"), 116 // Variable: pulumi.String("s3:x-amz-acl"), 117 // Values: pulumi.StringArray{ 118 // pulumi.String("bucket-owner-full-control"), 119 // }, 120 // }, 121 // &iam.GetPolicyDocumentStatementConditionArgs{ 122 // Test: pulumi.String("StringEquals"), 123 // Variable: pulumi.String("aws:SourceArn"), 124 // Values: pulumi.StringArray{ 125 // pulumi.String(fmt.Sprintf("arn:%v:cloudtrail:%v:%v:trail/example", currentGetPartition.Partition, currentGetRegion.Name, current.AccountId)), 126 // }, 127 // }, 128 // }, 129 // }, 130 // }, 131 // }, nil) 132 // exampleBucketPolicy, err := s3.NewBucketPolicy(ctx, "example", &s3.BucketPolicyArgs{ 133 // Bucket: exampleBucketV2.ID(), 134 // Policy: example.ApplyT(func(example iam.GetPolicyDocumentResult) (*string, error) { 135 // return &example.Json, nil 136 // }).(pulumi.StringPtrOutput), 137 // }) 138 // if err != nil { 139 // return err 140 // } 141 // _, err = cloudtrail.NewTrail(ctx, "example", &cloudtrail.TrailArgs{ 142 // Name: pulumi.String("example"), 143 // S3BucketName: exampleBucketV2.ID(), 144 // S3KeyPrefix: pulumi.String("prefix"), 145 // IncludeGlobalServiceEvents: pulumi.Bool(false), 146 // }, pulumi.DependsOn([]pulumi.Resource{ 147 // exampleBucketPolicy, 148 // })) 149 // if err != nil { 150 // return err 151 // } 152 // return nil 153 // }) 154 // } 155 // 156 // ``` 157 // <!--End PulumiCodeChooser --> 158 // 159 // ### Data Event Logging 160 // 161 // CloudTrail can log [Data Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) for certain services such as S3 objects and Lambda function invocations. Additional information about data event configuration can be found in the following links: 162 // 163 // * [CloudTrail API DataResource documentation](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_DataResource.html) (for basic event selector). 164 // * [CloudTrail API AdvancedFieldSelector documentation](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html) (for advanced event selector). 165 // 166 // ### Logging All Lambda Function Invocations By Using Basic Event Selectors 167 // 168 // <!--Start PulumiCodeChooser --> 169 // ```go 170 // package main 171 // 172 // import ( 173 // 174 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail" 175 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 176 // 177 // ) 178 // 179 // func main() { 180 // pulumi.Run(func(ctx *pulumi.Context) error { 181 // _, err := cloudtrail.NewTrail(ctx, "example", &cloudtrail.TrailArgs{ 182 // EventSelectors: cloudtrail.TrailEventSelectorArray{ 183 // &cloudtrail.TrailEventSelectorArgs{ 184 // ReadWriteType: pulumi.String("All"), 185 // IncludeManagementEvents: pulumi.Bool(true), 186 // DataResources: cloudtrail.TrailEventSelectorDataResourceArray{ 187 // &cloudtrail.TrailEventSelectorDataResourceArgs{ 188 // Type: pulumi.String("AWS::Lambda::Function"), 189 // Values: pulumi.StringArray{ 190 // pulumi.String("arn:aws:lambda"), 191 // }, 192 // }, 193 // }, 194 // }, 195 // }, 196 // }) 197 // if err != nil { 198 // return err 199 // } 200 // return nil 201 // }) 202 // } 203 // 204 // ``` 205 // <!--End PulumiCodeChooser --> 206 // 207 // ### Logging All S3 Object Events By Using Basic Event Selectors 208 // 209 // <!--Start PulumiCodeChooser --> 210 // ```go 211 // package main 212 // 213 // import ( 214 // 215 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail" 216 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 217 // 218 // ) 219 // 220 // func main() { 221 // pulumi.Run(func(ctx *pulumi.Context) error { 222 // _, err := cloudtrail.NewTrail(ctx, "example", &cloudtrail.TrailArgs{ 223 // EventSelectors: cloudtrail.TrailEventSelectorArray{ 224 // &cloudtrail.TrailEventSelectorArgs{ 225 // ReadWriteType: pulumi.String("All"), 226 // IncludeManagementEvents: pulumi.Bool(true), 227 // DataResources: cloudtrail.TrailEventSelectorDataResourceArray{ 228 // &cloudtrail.TrailEventSelectorDataResourceArgs{ 229 // Type: pulumi.String("AWS::S3::Object"), 230 // Values: pulumi.StringArray{ 231 // pulumi.String("arn:aws:s3"), 232 // }, 233 // }, 234 // }, 235 // }, 236 // }, 237 // }) 238 // if err != nil { 239 // return err 240 // } 241 // return nil 242 // }) 243 // } 244 // 245 // ``` 246 // <!--End PulumiCodeChooser --> 247 // 248 // ### Logging Individual S3 Bucket Events By Using Basic Event Selectors 249 // 250 // <!--Start PulumiCodeChooser --> 251 // ```go 252 // package main 253 // 254 // import ( 255 // 256 // "fmt" 257 // 258 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail" 259 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 260 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 261 // 262 // ) 263 // 264 // func main() { 265 // pulumi.Run(func(ctx *pulumi.Context) error { 266 // important_bucket, err := s3.LookupBucket(ctx, &s3.LookupBucketArgs{ 267 // Bucket: "important-bucket", 268 // }, nil) 269 // if err != nil { 270 // return err 271 // } 272 // _, err = cloudtrail.NewTrail(ctx, "example", &cloudtrail.TrailArgs{ 273 // EventSelectors: cloudtrail.TrailEventSelectorArray{ 274 // &cloudtrail.TrailEventSelectorArgs{ 275 // ReadWriteType: pulumi.String("All"), 276 // IncludeManagementEvents: pulumi.Bool(true), 277 // DataResources: cloudtrail.TrailEventSelectorDataResourceArray{ 278 // &cloudtrail.TrailEventSelectorDataResourceArgs{ 279 // Type: pulumi.String("AWS::S3::Object"), 280 // Values: pulumi.StringArray{ 281 // pulumi.String(fmt.Sprintf("%v/", important_bucket.Arn)), 282 // }, 283 // }, 284 // }, 285 // }, 286 // }, 287 // }) 288 // if err != nil { 289 // return err 290 // } 291 // return nil 292 // }) 293 // } 294 // 295 // ``` 296 // <!--End PulumiCodeChooser --> 297 // 298 // ### Logging All S3 Object Events Except For Two S3 Buckets By Using Advanced Event Selectors 299 // 300 // <!--Start PulumiCodeChooser --> 301 // ```go 302 // package main 303 // 304 // import ( 305 // 306 // "fmt" 307 // 308 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail" 309 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 310 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 311 // 312 // ) 313 // 314 // func main() { 315 // pulumi.Run(func(ctx *pulumi.Context) error { 316 // not_important_bucket_1, err := s3.LookupBucket(ctx, &s3.LookupBucketArgs{ 317 // Bucket: "not-important-bucket-1", 318 // }, nil) 319 // if err != nil { 320 // return err 321 // } 322 // not_important_bucket_2, err := s3.LookupBucket(ctx, &s3.LookupBucketArgs{ 323 // Bucket: "not-important-bucket-2", 324 // }, nil) 325 // if err != nil { 326 // return err 327 // } 328 // _, err = cloudtrail.NewTrail(ctx, "example", &cloudtrail.TrailArgs{ 329 // AdvancedEventSelectors: cloudtrail.TrailAdvancedEventSelectorArray{ 330 // &cloudtrail.TrailAdvancedEventSelectorArgs{ 331 // Name: pulumi.String("Log all S3 objects events except for two S3 buckets"), 332 // FieldSelectors: cloudtrail.TrailAdvancedEventSelectorFieldSelectorArray{ 333 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 334 // Field: pulumi.String("eventCategory"), 335 // Equals: pulumi.StringArray{ 336 // pulumi.String("Data"), 337 // }, 338 // }, 339 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 340 // Field: pulumi.String("resources.ARN"), 341 // NotStartsWiths: pulumi.StringArray{ 342 // pulumi.String(fmt.Sprintf("%v/", not_important_bucket_1.Arn)), 343 // pulumi.String(fmt.Sprintf("%v/", not_important_bucket_2.Arn)), 344 // }, 345 // }, 346 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 347 // Field: pulumi.String("resources.type"), 348 // Equals: pulumi.StringArray{ 349 // pulumi.String("AWS::S3::Object"), 350 // }, 351 // }, 352 // }, 353 // }, 354 // &cloudtrail.TrailAdvancedEventSelectorArgs{ 355 // Name: pulumi.String("Log readOnly and writeOnly management events"), 356 // FieldSelectors: cloudtrail.TrailAdvancedEventSelectorFieldSelectorArray{ 357 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 358 // Field: pulumi.String("eventCategory"), 359 // Equals: pulumi.StringArray{ 360 // pulumi.String("Management"), 361 // }, 362 // }, 363 // }, 364 // }, 365 // }, 366 // }) 367 // if err != nil { 368 // return err 369 // } 370 // return nil 371 // }) 372 // } 373 // 374 // ``` 375 // <!--End PulumiCodeChooser --> 376 // 377 // ### Logging Individual S3 Buckets And Specific Event Names By Using Advanced Event Selectors 378 // 379 // <!--Start PulumiCodeChooser --> 380 // ```go 381 // package main 382 // 383 // import ( 384 // 385 // "fmt" 386 // 387 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail" 388 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 389 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 390 // 391 // ) 392 // 393 // func main() { 394 // pulumi.Run(func(ctx *pulumi.Context) error { 395 // important_bucket_1, err := s3.LookupBucket(ctx, &s3.LookupBucketArgs{ 396 // Bucket: "important-bucket-1", 397 // }, nil) 398 // if err != nil { 399 // return err 400 // } 401 // important_bucket_2, err := s3.LookupBucket(ctx, &s3.LookupBucketArgs{ 402 // Bucket: "important-bucket-2", 403 // }, nil) 404 // if err != nil { 405 // return err 406 // } 407 // important_bucket_3, err := s3.LookupBucket(ctx, &s3.LookupBucketArgs{ 408 // Bucket: "important-bucket-3", 409 // }, nil) 410 // if err != nil { 411 // return err 412 // } 413 // _, err = cloudtrail.NewTrail(ctx, "example", &cloudtrail.TrailArgs{ 414 // AdvancedEventSelectors: cloudtrail.TrailAdvancedEventSelectorArray{ 415 // &cloudtrail.TrailAdvancedEventSelectorArgs{ 416 // Name: pulumi.String("Log PutObject and DeleteObject events for two S3 buckets"), 417 // FieldSelectors: cloudtrail.TrailAdvancedEventSelectorFieldSelectorArray{ 418 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 419 // Field: pulumi.String("eventCategory"), 420 // Equals: pulumi.StringArray{ 421 // pulumi.String("Data"), 422 // }, 423 // }, 424 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 425 // Field: pulumi.String("eventName"), 426 // Equals: pulumi.StringArray{ 427 // pulumi.String("PutObject"), 428 // pulumi.String("DeleteObject"), 429 // }, 430 // }, 431 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 432 // Field: pulumi.String("resources.ARN"), 433 // StartsWiths: pulumi.StringArray{ 434 // pulumi.String(fmt.Sprintf("%v/", important_bucket_1.Arn)), 435 // pulumi.String(fmt.Sprintf("%v/", important_bucket_2.Arn)), 436 // }, 437 // }, 438 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 439 // Field: pulumi.String("readOnly"), 440 // Equals: pulumi.StringArray{ 441 // pulumi.String("false"), 442 // }, 443 // }, 444 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 445 // Field: pulumi.String("resources.type"), 446 // Equals: pulumi.StringArray{ 447 // pulumi.String("AWS::S3::Object"), 448 // }, 449 // }, 450 // }, 451 // }, 452 // &cloudtrail.TrailAdvancedEventSelectorArgs{ 453 // Name: pulumi.String("Log Delete* events for one S3 bucket"), 454 // FieldSelectors: cloudtrail.TrailAdvancedEventSelectorFieldSelectorArray{ 455 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 456 // Field: pulumi.String("eventCategory"), 457 // Equals: pulumi.StringArray{ 458 // pulumi.String("Data"), 459 // }, 460 // }, 461 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 462 // Field: pulumi.String("eventName"), 463 // StartsWiths: pulumi.StringArray{ 464 // pulumi.String("Delete"), 465 // }, 466 // }, 467 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 468 // Field: pulumi.String("resources.ARN"), 469 // Equals: pulumi.StringArray{ 470 // pulumi.String(fmt.Sprintf("%v/important-prefix", important_bucket_3.Arn)), 471 // }, 472 // }, 473 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 474 // Field: pulumi.String("readOnly"), 475 // Equals: pulumi.StringArray{ 476 // pulumi.String("false"), 477 // }, 478 // }, 479 // &cloudtrail.TrailAdvancedEventSelectorFieldSelectorArgs{ 480 // Field: pulumi.String("resources.type"), 481 // Equals: pulumi.StringArray{ 482 // pulumi.String("AWS::S3::Object"), 483 // }, 484 // }, 485 // }, 486 // }, 487 // }, 488 // }) 489 // if err != nil { 490 // return err 491 // } 492 // return nil 493 // }) 494 // } 495 // 496 // ``` 497 // <!--End PulumiCodeChooser --> 498 // 499 // ### Sending Events to CloudWatch Logs 500 // 501 // <!--Start PulumiCodeChooser --> 502 // ```go 503 // package main 504 // 505 // import ( 506 // 507 // "fmt" 508 // 509 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail" 510 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch" 511 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 512 // 513 // ) 514 // 515 // func main() { 516 // pulumi.Run(func(ctx *pulumi.Context) error { 517 // example, err := cloudwatch.NewLogGroup(ctx, "example", &cloudwatch.LogGroupArgs{ 518 // Name: pulumi.String("Example"), 519 // }) 520 // if err != nil { 521 // return err 522 // } 523 // _, err = cloudtrail.NewTrail(ctx, "example", &cloudtrail.TrailArgs{ 524 // CloudWatchLogsGroupArn: example.Arn.ApplyT(func(arn string) (string, error) { 525 // return fmt.Sprintf("%v:*", arn), nil 526 // }).(pulumi.StringOutput), 527 // }) 528 // if err != nil { 529 // return err 530 // } 531 // return nil 532 // }) 533 // } 534 // 535 // ``` 536 // <!--End PulumiCodeChooser --> 537 // 538 // ## Import 539 // 540 // Using `pulumi import`, import Cloudtrails using the `arn`. For example: 541 // 542 // ```sh 543 // $ pulumi import aws:cloudtrail/trail:Trail sample arn:aws:cloudtrail:us-east-1:123456789012:trail/my-sample-trail 544 // ``` 545 type Trail struct { 546 pulumi.CustomResourceState 547 548 // Specifies an advanced event selector for enabling data event logging. Fields documented below. Conflicts with `eventSelector`. 549 AdvancedEventSelectors TrailAdvancedEventSelectorArrayOutput `pulumi:"advancedEventSelectors"` 550 // ARN of the trail. 551 Arn pulumi.StringOutput `pulumi:"arn"` 552 // Log group name using an ARN that represents the log group to which CloudTrail logs will be delivered. Note that CloudTrail requires the Log Stream wildcard. 553 CloudWatchLogsGroupArn pulumi.StringPtrOutput `pulumi:"cloudWatchLogsGroupArn"` 554 // Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. 555 CloudWatchLogsRoleArn pulumi.StringPtrOutput `pulumi:"cloudWatchLogsRoleArn"` 556 // Whether log file integrity validation is enabled. Defaults to `false`. 557 EnableLogFileValidation pulumi.BoolPtrOutput `pulumi:"enableLogFileValidation"` 558 // Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause logging. 559 EnableLogging pulumi.BoolPtrOutput `pulumi:"enableLogging"` 560 // Specifies an event selector for enabling data event logging. Fields documented below. Please note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) when configuring these. Conflicts with `advancedEventSelector`. 561 EventSelectors TrailEventSelectorArrayOutput `pulumi:"eventSelectors"` 562 // Region in which the trail was created. 563 HomeRegion pulumi.StringOutput `pulumi:"homeRegion"` 564 // Whether the trail is publishing events from global services such as IAM to the log files. Defaults to `true`. 565 IncludeGlobalServiceEvents pulumi.BoolPtrOutput `pulumi:"includeGlobalServiceEvents"` 566 // Configuration block for identifying unusual operational activity. See details below. 567 InsightSelectors TrailInsightSelectorArrayOutput `pulumi:"insightSelectors"` 568 // Whether the trail is created in the current region or in all regions. Defaults to `false`. 569 IsMultiRegionTrail pulumi.BoolPtrOutput `pulumi:"isMultiRegionTrail"` 570 // Whether the trail is an AWS Organizations trail. Organization trails log events for the master account and all member accounts. Can only be created in the organization master account. Defaults to `false`. 571 IsOrganizationTrail pulumi.BoolPtrOutput `pulumi:"isOrganizationTrail"` 572 // KMS key ARN to use to encrypt the logs delivered by CloudTrail. 573 KmsKeyId pulumi.StringPtrOutput `pulumi:"kmsKeyId"` 574 // Name of the trail. 575 Name pulumi.StringOutput `pulumi:"name"` 576 // Name of the S3 bucket designated for publishing log files. 577 // 578 // The following arguments are optional: 579 S3BucketName pulumi.StringOutput `pulumi:"s3BucketName"` 580 // S3 key prefix that follows the name of the bucket you have designated for log file delivery. 581 S3KeyPrefix pulumi.StringPtrOutput `pulumi:"s3KeyPrefix"` 582 // Name of the Amazon SNS topic defined for notification of log file delivery. 583 SnsTopicName pulumi.StringPtrOutput `pulumi:"snsTopicName"` 584 // Map of tags to assign to the trail. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 585 Tags pulumi.StringMapOutput `pulumi:"tags"` 586 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 587 // 588 // Deprecated: Please use `tags` instead. 589 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 590 } 591 592 // NewTrail registers a new resource with the given unique name, arguments, and options. 593 func NewTrail(ctx *pulumi.Context, 594 name string, args *TrailArgs, opts ...pulumi.ResourceOption) (*Trail, error) { 595 if args == nil { 596 return nil, errors.New("missing one or more required arguments") 597 } 598 599 if args.S3BucketName == nil { 600 return nil, errors.New("invalid value for required argument 'S3BucketName'") 601 } 602 opts = internal.PkgResourceDefaultOpts(opts) 603 var resource Trail 604 err := ctx.RegisterResource("aws:cloudtrail/trail:Trail", name, args, &resource, opts...) 605 if err != nil { 606 return nil, err 607 } 608 return &resource, nil 609 } 610 611 // GetTrail gets an existing Trail resource's state with the given name, ID, and optional 612 // state properties that are used to uniquely qualify the lookup (nil if not required). 613 func GetTrail(ctx *pulumi.Context, 614 name string, id pulumi.IDInput, state *TrailState, opts ...pulumi.ResourceOption) (*Trail, error) { 615 var resource Trail 616 err := ctx.ReadResource("aws:cloudtrail/trail:Trail", name, id, state, &resource, opts...) 617 if err != nil { 618 return nil, err 619 } 620 return &resource, nil 621 } 622 623 // Input properties used for looking up and filtering Trail resources. 624 type trailState struct { 625 // Specifies an advanced event selector for enabling data event logging. Fields documented below. Conflicts with `eventSelector`. 626 AdvancedEventSelectors []TrailAdvancedEventSelector `pulumi:"advancedEventSelectors"` 627 // ARN of the trail. 628 Arn *string `pulumi:"arn"` 629 // Log group name using an ARN that represents the log group to which CloudTrail logs will be delivered. Note that CloudTrail requires the Log Stream wildcard. 630 CloudWatchLogsGroupArn *string `pulumi:"cloudWatchLogsGroupArn"` 631 // Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. 632 CloudWatchLogsRoleArn *string `pulumi:"cloudWatchLogsRoleArn"` 633 // Whether log file integrity validation is enabled. Defaults to `false`. 634 EnableLogFileValidation *bool `pulumi:"enableLogFileValidation"` 635 // Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause logging. 636 EnableLogging *bool `pulumi:"enableLogging"` 637 // Specifies an event selector for enabling data event logging. Fields documented below. Please note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) when configuring these. Conflicts with `advancedEventSelector`. 638 EventSelectors []TrailEventSelector `pulumi:"eventSelectors"` 639 // Region in which the trail was created. 640 HomeRegion *string `pulumi:"homeRegion"` 641 // Whether the trail is publishing events from global services such as IAM to the log files. Defaults to `true`. 642 IncludeGlobalServiceEvents *bool `pulumi:"includeGlobalServiceEvents"` 643 // Configuration block for identifying unusual operational activity. See details below. 644 InsightSelectors []TrailInsightSelector `pulumi:"insightSelectors"` 645 // Whether the trail is created in the current region or in all regions. Defaults to `false`. 646 IsMultiRegionTrail *bool `pulumi:"isMultiRegionTrail"` 647 // Whether the trail is an AWS Organizations trail. Organization trails log events for the master account and all member accounts. Can only be created in the organization master account. Defaults to `false`. 648 IsOrganizationTrail *bool `pulumi:"isOrganizationTrail"` 649 // KMS key ARN to use to encrypt the logs delivered by CloudTrail. 650 KmsKeyId *string `pulumi:"kmsKeyId"` 651 // Name of the trail. 652 Name *string `pulumi:"name"` 653 // Name of the S3 bucket designated for publishing log files. 654 // 655 // The following arguments are optional: 656 S3BucketName *string `pulumi:"s3BucketName"` 657 // S3 key prefix that follows the name of the bucket you have designated for log file delivery. 658 S3KeyPrefix *string `pulumi:"s3KeyPrefix"` 659 // Name of the Amazon SNS topic defined for notification of log file delivery. 660 SnsTopicName *string `pulumi:"snsTopicName"` 661 // Map of tags to assign to the trail. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 662 Tags map[string]string `pulumi:"tags"` 663 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 664 // 665 // Deprecated: Please use `tags` instead. 666 TagsAll map[string]string `pulumi:"tagsAll"` 667 } 668 669 type TrailState struct { 670 // Specifies an advanced event selector for enabling data event logging. Fields documented below. Conflicts with `eventSelector`. 671 AdvancedEventSelectors TrailAdvancedEventSelectorArrayInput 672 // ARN of the trail. 673 Arn pulumi.StringPtrInput 674 // Log group name using an ARN that represents the log group to which CloudTrail logs will be delivered. Note that CloudTrail requires the Log Stream wildcard. 675 CloudWatchLogsGroupArn pulumi.StringPtrInput 676 // Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. 677 CloudWatchLogsRoleArn pulumi.StringPtrInput 678 // Whether log file integrity validation is enabled. Defaults to `false`. 679 EnableLogFileValidation pulumi.BoolPtrInput 680 // Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause logging. 681 EnableLogging pulumi.BoolPtrInput 682 // Specifies an event selector for enabling data event logging. Fields documented below. Please note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) when configuring these. Conflicts with `advancedEventSelector`. 683 EventSelectors TrailEventSelectorArrayInput 684 // Region in which the trail was created. 685 HomeRegion pulumi.StringPtrInput 686 // Whether the trail is publishing events from global services such as IAM to the log files. Defaults to `true`. 687 IncludeGlobalServiceEvents pulumi.BoolPtrInput 688 // Configuration block for identifying unusual operational activity. See details below. 689 InsightSelectors TrailInsightSelectorArrayInput 690 // Whether the trail is created in the current region or in all regions. Defaults to `false`. 691 IsMultiRegionTrail pulumi.BoolPtrInput 692 // Whether the trail is an AWS Organizations trail. Organization trails log events for the master account and all member accounts. Can only be created in the organization master account. Defaults to `false`. 693 IsOrganizationTrail pulumi.BoolPtrInput 694 // KMS key ARN to use to encrypt the logs delivered by CloudTrail. 695 KmsKeyId pulumi.StringPtrInput 696 // Name of the trail. 697 Name pulumi.StringPtrInput 698 // Name of the S3 bucket designated for publishing log files. 699 // 700 // The following arguments are optional: 701 S3BucketName pulumi.StringPtrInput 702 // S3 key prefix that follows the name of the bucket you have designated for log file delivery. 703 S3KeyPrefix pulumi.StringPtrInput 704 // Name of the Amazon SNS topic defined for notification of log file delivery. 705 SnsTopicName pulumi.StringPtrInput 706 // Map of tags to assign to the trail. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 707 Tags pulumi.StringMapInput 708 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 709 // 710 // Deprecated: Please use `tags` instead. 711 TagsAll pulumi.StringMapInput 712 } 713 714 func (TrailState) ElementType() reflect.Type { 715 return reflect.TypeOf((*trailState)(nil)).Elem() 716 } 717 718 type trailArgs struct { 719 // Specifies an advanced event selector for enabling data event logging. Fields documented below. Conflicts with `eventSelector`. 720 AdvancedEventSelectors []TrailAdvancedEventSelector `pulumi:"advancedEventSelectors"` 721 // Log group name using an ARN that represents the log group to which CloudTrail logs will be delivered. Note that CloudTrail requires the Log Stream wildcard. 722 CloudWatchLogsGroupArn *string `pulumi:"cloudWatchLogsGroupArn"` 723 // Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. 724 CloudWatchLogsRoleArn *string `pulumi:"cloudWatchLogsRoleArn"` 725 // Whether log file integrity validation is enabled. Defaults to `false`. 726 EnableLogFileValidation *bool `pulumi:"enableLogFileValidation"` 727 // Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause logging. 728 EnableLogging *bool `pulumi:"enableLogging"` 729 // Specifies an event selector for enabling data event logging. Fields documented below. Please note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) when configuring these. Conflicts with `advancedEventSelector`. 730 EventSelectors []TrailEventSelector `pulumi:"eventSelectors"` 731 // Whether the trail is publishing events from global services such as IAM to the log files. Defaults to `true`. 732 IncludeGlobalServiceEvents *bool `pulumi:"includeGlobalServiceEvents"` 733 // Configuration block for identifying unusual operational activity. See details below. 734 InsightSelectors []TrailInsightSelector `pulumi:"insightSelectors"` 735 // Whether the trail is created in the current region or in all regions. Defaults to `false`. 736 IsMultiRegionTrail *bool `pulumi:"isMultiRegionTrail"` 737 // Whether the trail is an AWS Organizations trail. Organization trails log events for the master account and all member accounts. Can only be created in the organization master account. Defaults to `false`. 738 IsOrganizationTrail *bool `pulumi:"isOrganizationTrail"` 739 // KMS key ARN to use to encrypt the logs delivered by CloudTrail. 740 KmsKeyId *string `pulumi:"kmsKeyId"` 741 // Name of the trail. 742 Name *string `pulumi:"name"` 743 // Name of the S3 bucket designated for publishing log files. 744 // 745 // The following arguments are optional: 746 S3BucketName string `pulumi:"s3BucketName"` 747 // S3 key prefix that follows the name of the bucket you have designated for log file delivery. 748 S3KeyPrefix *string `pulumi:"s3KeyPrefix"` 749 // Name of the Amazon SNS topic defined for notification of log file delivery. 750 SnsTopicName *string `pulumi:"snsTopicName"` 751 // Map of tags to assign to the trail. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 752 Tags map[string]string `pulumi:"tags"` 753 } 754 755 // The set of arguments for constructing a Trail resource. 756 type TrailArgs struct { 757 // Specifies an advanced event selector for enabling data event logging. Fields documented below. Conflicts with `eventSelector`. 758 AdvancedEventSelectors TrailAdvancedEventSelectorArrayInput 759 // Log group name using an ARN that represents the log group to which CloudTrail logs will be delivered. Note that CloudTrail requires the Log Stream wildcard. 760 CloudWatchLogsGroupArn pulumi.StringPtrInput 761 // Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. 762 CloudWatchLogsRoleArn pulumi.StringPtrInput 763 // Whether log file integrity validation is enabled. Defaults to `false`. 764 EnableLogFileValidation pulumi.BoolPtrInput 765 // Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause logging. 766 EnableLogging pulumi.BoolPtrInput 767 // Specifies an event selector for enabling data event logging. Fields documented below. Please note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) when configuring these. Conflicts with `advancedEventSelector`. 768 EventSelectors TrailEventSelectorArrayInput 769 // Whether the trail is publishing events from global services such as IAM to the log files. Defaults to `true`. 770 IncludeGlobalServiceEvents pulumi.BoolPtrInput 771 // Configuration block for identifying unusual operational activity. See details below. 772 InsightSelectors TrailInsightSelectorArrayInput 773 // Whether the trail is created in the current region or in all regions. Defaults to `false`. 774 IsMultiRegionTrail pulumi.BoolPtrInput 775 // Whether the trail is an AWS Organizations trail. Organization trails log events for the master account and all member accounts. Can only be created in the organization master account. Defaults to `false`. 776 IsOrganizationTrail pulumi.BoolPtrInput 777 // KMS key ARN to use to encrypt the logs delivered by CloudTrail. 778 KmsKeyId pulumi.StringPtrInput 779 // Name of the trail. 780 Name pulumi.StringPtrInput 781 // Name of the S3 bucket designated for publishing log files. 782 // 783 // The following arguments are optional: 784 S3BucketName pulumi.StringInput 785 // S3 key prefix that follows the name of the bucket you have designated for log file delivery. 786 S3KeyPrefix pulumi.StringPtrInput 787 // Name of the Amazon SNS topic defined for notification of log file delivery. 788 SnsTopicName pulumi.StringPtrInput 789 // Map of tags to assign to the trail. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 790 Tags pulumi.StringMapInput 791 } 792 793 func (TrailArgs) ElementType() reflect.Type { 794 return reflect.TypeOf((*trailArgs)(nil)).Elem() 795 } 796 797 type TrailInput interface { 798 pulumi.Input 799 800 ToTrailOutput() TrailOutput 801 ToTrailOutputWithContext(ctx context.Context) TrailOutput 802 } 803 804 func (*Trail) ElementType() reflect.Type { 805 return reflect.TypeOf((**Trail)(nil)).Elem() 806 } 807 808 func (i *Trail) ToTrailOutput() TrailOutput { 809 return i.ToTrailOutputWithContext(context.Background()) 810 } 811 812 func (i *Trail) ToTrailOutputWithContext(ctx context.Context) TrailOutput { 813 return pulumi.ToOutputWithContext(ctx, i).(TrailOutput) 814 } 815 816 // TrailArrayInput is an input type that accepts TrailArray and TrailArrayOutput values. 817 // You can construct a concrete instance of `TrailArrayInput` via: 818 // 819 // TrailArray{ TrailArgs{...} } 820 type TrailArrayInput interface { 821 pulumi.Input 822 823 ToTrailArrayOutput() TrailArrayOutput 824 ToTrailArrayOutputWithContext(context.Context) TrailArrayOutput 825 } 826 827 type TrailArray []TrailInput 828 829 func (TrailArray) ElementType() reflect.Type { 830 return reflect.TypeOf((*[]*Trail)(nil)).Elem() 831 } 832 833 func (i TrailArray) ToTrailArrayOutput() TrailArrayOutput { 834 return i.ToTrailArrayOutputWithContext(context.Background()) 835 } 836 837 func (i TrailArray) ToTrailArrayOutputWithContext(ctx context.Context) TrailArrayOutput { 838 return pulumi.ToOutputWithContext(ctx, i).(TrailArrayOutput) 839 } 840 841 // TrailMapInput is an input type that accepts TrailMap and TrailMapOutput values. 842 // You can construct a concrete instance of `TrailMapInput` via: 843 // 844 // TrailMap{ "key": TrailArgs{...} } 845 type TrailMapInput interface { 846 pulumi.Input 847 848 ToTrailMapOutput() TrailMapOutput 849 ToTrailMapOutputWithContext(context.Context) TrailMapOutput 850 } 851 852 type TrailMap map[string]TrailInput 853 854 func (TrailMap) ElementType() reflect.Type { 855 return reflect.TypeOf((*map[string]*Trail)(nil)).Elem() 856 } 857 858 func (i TrailMap) ToTrailMapOutput() TrailMapOutput { 859 return i.ToTrailMapOutputWithContext(context.Background()) 860 } 861 862 func (i TrailMap) ToTrailMapOutputWithContext(ctx context.Context) TrailMapOutput { 863 return pulumi.ToOutputWithContext(ctx, i).(TrailMapOutput) 864 } 865 866 type TrailOutput struct{ *pulumi.OutputState } 867 868 func (TrailOutput) ElementType() reflect.Type { 869 return reflect.TypeOf((**Trail)(nil)).Elem() 870 } 871 872 func (o TrailOutput) ToTrailOutput() TrailOutput { 873 return o 874 } 875 876 func (o TrailOutput) ToTrailOutputWithContext(ctx context.Context) TrailOutput { 877 return o 878 } 879 880 // Specifies an advanced event selector for enabling data event logging. Fields documented below. Conflicts with `eventSelector`. 881 func (o TrailOutput) AdvancedEventSelectors() TrailAdvancedEventSelectorArrayOutput { 882 return o.ApplyT(func(v *Trail) TrailAdvancedEventSelectorArrayOutput { return v.AdvancedEventSelectors }).(TrailAdvancedEventSelectorArrayOutput) 883 } 884 885 // ARN of the trail. 886 func (o TrailOutput) Arn() pulumi.StringOutput { 887 return o.ApplyT(func(v *Trail) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 888 } 889 890 // Log group name using an ARN that represents the log group to which CloudTrail logs will be delivered. Note that CloudTrail requires the Log Stream wildcard. 891 func (o TrailOutput) CloudWatchLogsGroupArn() pulumi.StringPtrOutput { 892 return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.CloudWatchLogsGroupArn }).(pulumi.StringPtrOutput) 893 } 894 895 // Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. 896 func (o TrailOutput) CloudWatchLogsRoleArn() pulumi.StringPtrOutput { 897 return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.CloudWatchLogsRoleArn }).(pulumi.StringPtrOutput) 898 } 899 900 // Whether log file integrity validation is enabled. Defaults to `false`. 901 func (o TrailOutput) EnableLogFileValidation() pulumi.BoolPtrOutput { 902 return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.EnableLogFileValidation }).(pulumi.BoolPtrOutput) 903 } 904 905 // Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause logging. 906 func (o TrailOutput) EnableLogging() pulumi.BoolPtrOutput { 907 return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.EnableLogging }).(pulumi.BoolPtrOutput) 908 } 909 910 // Specifies an event selector for enabling data event logging. Fields documented below. Please note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) when configuring these. Conflicts with `advancedEventSelector`. 911 func (o TrailOutput) EventSelectors() TrailEventSelectorArrayOutput { 912 return o.ApplyT(func(v *Trail) TrailEventSelectorArrayOutput { return v.EventSelectors }).(TrailEventSelectorArrayOutput) 913 } 914 915 // Region in which the trail was created. 916 func (o TrailOutput) HomeRegion() pulumi.StringOutput { 917 return o.ApplyT(func(v *Trail) pulumi.StringOutput { return v.HomeRegion }).(pulumi.StringOutput) 918 } 919 920 // Whether the trail is publishing events from global services such as IAM to the log files. Defaults to `true`. 921 func (o TrailOutput) IncludeGlobalServiceEvents() pulumi.BoolPtrOutput { 922 return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.IncludeGlobalServiceEvents }).(pulumi.BoolPtrOutput) 923 } 924 925 // Configuration block for identifying unusual operational activity. See details below. 926 func (o TrailOutput) InsightSelectors() TrailInsightSelectorArrayOutput { 927 return o.ApplyT(func(v *Trail) TrailInsightSelectorArrayOutput { return v.InsightSelectors }).(TrailInsightSelectorArrayOutput) 928 } 929 930 // Whether the trail is created in the current region or in all regions. Defaults to `false`. 931 func (o TrailOutput) IsMultiRegionTrail() pulumi.BoolPtrOutput { 932 return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.IsMultiRegionTrail }).(pulumi.BoolPtrOutput) 933 } 934 935 // Whether the trail is an AWS Organizations trail. Organization trails log events for the master account and all member accounts. Can only be created in the organization master account. Defaults to `false`. 936 func (o TrailOutput) IsOrganizationTrail() pulumi.BoolPtrOutput { 937 return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.IsOrganizationTrail }).(pulumi.BoolPtrOutput) 938 } 939 940 // KMS key ARN to use to encrypt the logs delivered by CloudTrail. 941 func (o TrailOutput) KmsKeyId() pulumi.StringPtrOutput { 942 return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.KmsKeyId }).(pulumi.StringPtrOutput) 943 } 944 945 // Name of the trail. 946 func (o TrailOutput) Name() pulumi.StringOutput { 947 return o.ApplyT(func(v *Trail) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 948 } 949 950 // Name of the S3 bucket designated for publishing log files. 951 // 952 // The following arguments are optional: 953 func (o TrailOutput) S3BucketName() pulumi.StringOutput { 954 return o.ApplyT(func(v *Trail) pulumi.StringOutput { return v.S3BucketName }).(pulumi.StringOutput) 955 } 956 957 // S3 key prefix that follows the name of the bucket you have designated for log file delivery. 958 func (o TrailOutput) S3KeyPrefix() pulumi.StringPtrOutput { 959 return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.S3KeyPrefix }).(pulumi.StringPtrOutput) 960 } 961 962 // Name of the Amazon SNS topic defined for notification of log file delivery. 963 func (o TrailOutput) SnsTopicName() pulumi.StringPtrOutput { 964 return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.SnsTopicName }).(pulumi.StringPtrOutput) 965 } 966 967 // Map of tags to assign to the trail. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 968 func (o TrailOutput) Tags() pulumi.StringMapOutput { 969 return o.ApplyT(func(v *Trail) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 970 } 971 972 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 973 // 974 // Deprecated: Please use `tags` instead. 975 func (o TrailOutput) TagsAll() pulumi.StringMapOutput { 976 return o.ApplyT(func(v *Trail) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 977 } 978 979 type TrailArrayOutput struct{ *pulumi.OutputState } 980 981 func (TrailArrayOutput) ElementType() reflect.Type { 982 return reflect.TypeOf((*[]*Trail)(nil)).Elem() 983 } 984 985 func (o TrailArrayOutput) ToTrailArrayOutput() TrailArrayOutput { 986 return o 987 } 988 989 func (o TrailArrayOutput) ToTrailArrayOutputWithContext(ctx context.Context) TrailArrayOutput { 990 return o 991 } 992 993 func (o TrailArrayOutput) Index(i pulumi.IntInput) TrailOutput { 994 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Trail { 995 return vs[0].([]*Trail)[vs[1].(int)] 996 }).(TrailOutput) 997 } 998 999 type TrailMapOutput struct{ *pulumi.OutputState } 1000 1001 func (TrailMapOutput) ElementType() reflect.Type { 1002 return reflect.TypeOf((*map[string]*Trail)(nil)).Elem() 1003 } 1004 1005 func (o TrailMapOutput) ToTrailMapOutput() TrailMapOutput { 1006 return o 1007 } 1008 1009 func (o TrailMapOutput) ToTrailMapOutputWithContext(ctx context.Context) TrailMapOutput { 1010 return o 1011 } 1012 1013 func (o TrailMapOutput) MapIndex(k pulumi.StringInput) TrailOutput { 1014 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Trail { 1015 return vs[0].(map[string]*Trail)[vs[1].(string)] 1016 }).(TrailOutput) 1017 } 1018 1019 func init() { 1020 pulumi.RegisterInputType(reflect.TypeOf((*TrailInput)(nil)).Elem(), &Trail{}) 1021 pulumi.RegisterInputType(reflect.TypeOf((*TrailArrayInput)(nil)).Elem(), TrailArray{}) 1022 pulumi.RegisterInputType(reflect.TypeOf((*TrailMapInput)(nil)).Elem(), TrailMap{}) 1023 pulumi.RegisterOutputType(TrailOutput{}) 1024 pulumi.RegisterOutputType(TrailArrayOutput{}) 1025 pulumi.RegisterOutputType(TrailMapOutput{}) 1026 }