Created
October 11, 2020 15:17
-
-
Save fredericbarthelet/8e809fb728e363abac5905c29af5e536 to your computer and use it in GitHub Desktop.
AWS intrinsic function resolution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
CloudFormationResource, | |
CloudFormationResources, | |
} from 'serverless/aws'; | |
import { findKey } from 'lodash'; | |
interface CloudFormationReference { | |
Ref: string; | |
} | |
export const ref = ( | |
resources: CloudFormationResources, | |
referencedResource: CloudFormationResource, | |
): CloudFormationReference => { | |
return { | |
Ref: findKey(resources, (resource) => referencedResource === resource), | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment