Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AWS intrinsic function resolution
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