Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lambda): use IRole instead of Role to allow imports #1509

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/lib/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class Alias extends FunctionBase {
/**
* Role associated with this alias
*/
public readonly role?: iam.Role | undefined;
public readonly role?: iam.IRole | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The | undefined seems superfluous.


protected readonly canCreatePermissions: boolean = true; // Not used anyway

Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-lambda/lib/lambda-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface IFunction extends cdk.IConstruct, events.IEventRuleTarget, logs
/**
* The IAM role associated with this function.
*/
readonly role?: iam.Role;
readonly role?: iam.IRole;

/**
* Whether or not this Lambda function was bound to a VPC
Expand Down Expand Up @@ -123,7 +123,7 @@ export interface FunctionImportProps {
*
* If the role is not specified, any role-related operations will no-op.
*/
role?: iam.Role;
role?: iam.IRole;

/**
* Id of the securityGroup for this Lambda, if in a VPC.
Expand All @@ -149,7 +149,7 @@ export abstract class FunctionBase extends cdk.Construct implements IFunction {
/**
* The IAM role associated with this function.
*/
public abstract readonly role?: iam.Role;
public abstract readonly role?: iam.IRole;

/**
* Whether the addPermission() call adds any permissions
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-lambda/lib/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface FunctionProps {
* @default a unique role will be generated for this lambda function.
* Both supplied and generated roles can always be changed by calling `addToRolePolicy`.
*/
role?: iam.Role;
role?: iam.IRole;

/**
* VPC network to place Lambda network interfaces
Expand Down Expand Up @@ -284,7 +284,7 @@ export class Function extends FunctionBase {
/**
* Execution role associated with this function
*/
public readonly role?: iam.Role;
public readonly role?: iam.IRole;

/**
* The runtime configured for this lambda.
Expand Down Expand Up @@ -493,7 +493,7 @@ export class Function extends FunctionBase {
export class ImportedFunction extends FunctionBase {
public readonly functionName: string;
public readonly functionArn: string;
public readonly role?: iam.Role;
public readonly role?: iam.IRole;

protected readonly canCreatePermissions = false;

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface SingletonFunctionProps extends FunctionProps {
export class SingletonFunction extends FunctionBase {
public readonly functionName: string;
public readonly functionArn: string;
public readonly role?: iam.Role | undefined;
public readonly role?: iam.IRole | undefined;
protected readonly canCreatePermissions: boolean;
private lambdaFunction: IFunction;

Expand Down