-
Notifications
You must be signed in to change notification settings - Fork 17
/
AliasProps.go
46 lines (43 loc) · 1.63 KB
/
AliasProps.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
package awskms
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
)
// Construction properties for a KMS Key Alias object.
//
// Example:
// // Passing an encrypted replication bucket created in a different stack.
// app := awscdk.NewApp()
// replicationStack := awscdk.Newstack(app, jsii.String("ReplicationStack"), &StackProps{
// Env: &Environment{
// Region: jsii.String("us-west-1"),
// },
// })
// key := kms.NewKey(replicationStack, jsii.String("ReplicationKey"))
// alias := kms.NewAlias(replicationStack, jsii.String("ReplicationAlias"), &AliasProps{
// // aliasName is required
// AliasName: awscdk.PhysicalName_GENERATE_IF_NEEDED(),
// TargetKey: key,
// })
// replicationBucket := s3.NewBucket(replicationStack, jsii.String("ReplicationBucket"), &BucketProps{
// BucketName: awscdk.PhysicalName_GENERATE_IF_NEEDED(),
// EncryptionKey: alias,
// })
//
type AliasProps struct {
// The name of the alias.
//
// The name must start with alias followed by a
// forward slash, such as alias/. You can't specify aliases that begin with
// alias/AWS. These aliases are reserved.
AliasName *string `field:"required" json:"aliasName" yaml:"aliasName"`
// The ID of the key for which you are creating the alias.
//
// Specify the key's
// globally unique identifier or Amazon Resource Name (ARN). You can't
// specify another alias.
TargetKey IKey `field:"required" json:"targetKey" yaml:"targetKey"`
// Policy to apply when the alias is removed from this stack.
// Default: - The alias will be deleted.
//
RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"`
}