従来のL1
{}new sns.CfnSubscription(this, 'Subscription', {
topicArn: 'arn:aws:sns:...:topic-name',
└─ 文字列しか受け取れず、型安全性が低い
})
新しいL1
{}new sns.CfnSubscription(this, 'StringSub', {
topicArn: 'arn:aws:sns:...:topic-name',
└─ 従来通り文字列はOK
})
new sns.CfnSubscription(this, 'L1Sub', {
topicArn: l1Topic,
└─ L1コンストラクト(CfnTopic)が渡せる!!
})
new sns.CfnSubscription(this, 'L2Sub', {
topicArn: l2Topic,
└─ L2コンストラクト(Topic)も渡せる!!
})
StringとReference Interfaceが引数型として許容されている