/
awscdk_ArnComponents.go
57 lines (54 loc) · 2.63 KB
/
awscdk_ArnComponents.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
// Version 2 of the AWS Cloud Development Kit library
package awscdk
// Example:
// subZone := route53.NewPublicHostedZone(this, jsii.String("SubZone"), &publicHostedZoneProps{
// zoneName: jsii.String("sub.someexample.com"),
// })
//
// // import the delegation role by constructing the roleArn
// delegationRoleArn := awscdk.stack.of(this).formatArn(&arnComponents{
// region: jsii.String(""),
// // IAM is global in each partition
// service: jsii.String("iam"),
// account: jsii.String("parent-account-id"),
// resource: jsii.String("role"),
// resourceName: jsii.String("MyDelegationRole"),
// })
// delegationRole := iam.role.fromRoleArn(this, jsii.String("DelegationRole"), delegationRoleArn)
//
// // create the record
// // create the record
// route53.NewCrossAccountZoneDelegationRecord(this, jsii.String("delegate"), &crossAccountZoneDelegationRecordProps{
// delegatedZone: subZone,
// parentHostedZoneName: jsii.String("someexample.com"),
// // or you can use parentHostedZoneId
// delegationRole: delegationRole,
// })
//
type ArnComponents struct {
// Resource type (e.g. "table", "autoScalingGroup", "certificate"). For some resource types, e.g. S3 buckets, this field defines the bucket name.
Resource *string `field:"required" json:"resource" yaml:"resource"`
// The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipline').
Service *string `field:"required" json:"service" yaml:"service"`
// The ID of the AWS account that owns the resource, without the hyphens.
//
// For example, 123456789012. Note that the ARNs for some resources don't
// require an account number, so this component might be omitted.
Account *string `field:"optional" json:"account" yaml:"account"`
// The specific ARN format to use for this ARN value.
ArnFormat ArnFormat `field:"optional" json:"arnFormat" yaml:"arnFormat"`
// The partition that the resource is in.
//
// For standard AWS regions, the
// partition is aws. If you have resources in other partitions, the
// partition is aws-partitionname. For example, the partition for resources
// in the China (Beijing) region is aws-cn.
Partition *string `field:"optional" json:"partition" yaml:"partition"`
// The region the resource resides in.
//
// Note that the ARNs for some resources
// do not require a region, so this component might be omitted.
Region *string `field:"optional" json:"region" yaml:"region"`
// Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as ``"*"``. This is service-dependent.
ResourceName *string `field:"optional" json:"resourceName" yaml:"resourceName"`
}