-
Notifications
You must be signed in to change notification settings - Fork 17
/
BucketAttributes.go
81 lines (78 loc) · 3.53 KB
/
BucketAttributes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package awss3
import (
"github.com/aws/aws-cdk-go/awscdk/v2/awsiam"
"github.com/aws/aws-cdk-go/awscdk/v2/awskms"
)
// A reference to a bucket outside this stack.
//
// Example:
// var myLambda function
//
// bucket := s3.Bucket_FromBucketAttributes(this, jsii.String("ImportedBucket"), &BucketAttributes{
// BucketArn: jsii.String("arn:aws:s3:::my-bucket"),
// })
//
// // now you can just call methods on the bucket
// bucket.AddEventNotification(s3.EventType_OBJECT_CREATED, s3n.NewLambdaDestination(myLambda), &NotificationKeyFilter{
// Prefix: jsii.String("home/myusername/*"),
// })
//
type BucketAttributes struct {
// The account this existing bucket belongs to.
// Default: - it's assumed the bucket belongs to the same account as the scope it's being imported into.
//
Account *string `field:"optional" json:"account" yaml:"account"`
// The ARN of the bucket.
//
// At least one of bucketArn or bucketName must be
// defined in order to initialize a bucket ref.
BucketArn *string `field:"optional" json:"bucketArn" yaml:"bucketArn"`
// The domain name of the bucket.
// Default: - Inferred from bucket name.
//
BucketDomainName *string `field:"optional" json:"bucketDomainName" yaml:"bucketDomainName"`
// The IPv6 DNS name of the specified bucket.
BucketDualStackDomainName *string `field:"optional" json:"bucketDualStackDomainName" yaml:"bucketDualStackDomainName"`
// The name of the bucket.
//
// If the underlying value of ARN is a string, the
// name will be parsed from the ARN. Otherwise, the name is optional, but
// some features that require the bucket name such as auto-creating a bucket
// policy, won't work.
BucketName *string `field:"optional" json:"bucketName" yaml:"bucketName"`
// The regional domain name of the specified bucket.
BucketRegionalDomainName *string `field:"optional" json:"bucketRegionalDomainName" yaml:"bucketRegionalDomainName"`
// Force the format of the website URL of the bucket.
//
// This should be true for
// regions launched since 2014.
// Default: - inferred from available region information, `false` otherwise.
//
// Deprecated: The correct website url format can be inferred automatically from the bucket `region`.
// Always provide the bucket region if the `bucketWebsiteUrl` will be used.
// Alternatively provide the full `bucketWebsiteUrl` manually.
BucketWebsiteNewUrlFormat *bool `field:"optional" json:"bucketWebsiteNewUrlFormat" yaml:"bucketWebsiteNewUrlFormat"`
// The website URL of the bucket (if static web hosting is enabled).
// Default: - Inferred from bucket name and region.
//
BucketWebsiteUrl *string `field:"optional" json:"bucketWebsiteUrl" yaml:"bucketWebsiteUrl"`
// KMS encryption key associated with this bucket.
// Default: - no encryption key.
//
EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
// If this bucket has been configured for static website hosting.
// Default: false.
//
IsWebsite *bool `field:"optional" json:"isWebsite" yaml:"isWebsite"`
// The role to be used by the notifications handler.
// Default: - a new role will be created.
//
NotificationsHandlerRole awsiam.IRole `field:"optional" json:"notificationsHandlerRole" yaml:"notificationsHandlerRole"`
// The region this existing bucket is in.
//
// Features that require the region (e.g. `bucketWebsiteUrl`) won't fully work
// if the region cannot be correctly inferred.
// Default: - it's assumed the bucket is in the same region as the scope it's being imported into.
//
Region *string `field:"optional" json:"region" yaml:"region"`
}