2020-05-14 17:43:12 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-05-21 19:23:33 +02:00
|
|
|
"github.com/pulumi/pulumi-aws/sdk/go/aws/s3"
|
2020-05-14 17:43:12 +02:00
|
|
|
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
pulumi.Run(func(ctx *pulumi.Context) error {
|
2020-05-21 19:23:33 +02:00
|
|
|
logs, err := s3.NewBucket(ctx, "logs", nil)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
bucket, err := s3.NewBucket(ctx, "bucket", &s3.BucketArgs{
|
|
|
|
Loggings: s3.BucketLoggingArray{
|
|
|
|
&s3.BucketLoggingArgs{
|
|
|
|
TargetBucket: logs.Bucket,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2020-05-14 17:43:12 +02:00
|
|
|
return nil
|
|
|
|
})
|
|
|
|
}
|