Skip to content

Commit

Permalink
fix(core): correct return type of Fn.getAtt (aws#3559)
Browse files Browse the repository at this point in the history
* fix(core): correct return type of Fn.getAtt

This was still typed as `Token` but that has become a static helper host
a couple of versions ago. The actual return time is `IResolvable`. It
compiled in **TypeScript** since `Token` declares no instance members,
thus allowing any object to structurally cast to it -- however this
would not work in strong statically typed languages such as Java, where
this incurs an invalid cast.

* whitelist the API breaking change
  • Loading branch information
RomainMuller authored and mergify[bot] committed Aug 6, 2019
1 parent 8ffba4b commit 02ef2dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
change-return-type:@aws-cdk/core.Fn.getAtt
4 changes: 2 additions & 2 deletions packages/@aws-cdk/core/lib/cfn-fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export class Fn {
* @param attributeName The name of the resource-specific attribute whose
* value you want. See the resource's reference page for details about the
* attributes available for that resource type.
* @returns a CloudFormationToken object
* @returns an IResolvable object
*/
public static getAtt(logicalNameOfResource: string, attributeName: string): Token {
public static getAtt(logicalNameOfResource: string, attributeName: string): IResolvable {
return new FnGetAtt(logicalNameOfResource, attributeName);
}

Expand Down

0 comments on commit 02ef2dc

Please sign in to comment.