Skip to content

Commit

Permalink
refactor: rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
badmintoncryer committed Mar 15, 2024
1 parent 4202ce8 commit 57bdf9d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const createScheduleTask1 = new EventBridgeSchedulerCreateScheduleTask(stack, 'c
scheduleExpression: 'rate(1 minute)',
timezone: 'UTC',
enabled: true,
targetArn: targetQueue.queueArn,
target: targetQueue.queueArn,
role: schedulerRole,
retryPolicy: {
maximumRetryAttempts: 2,
Expand All @@ -54,7 +54,7 @@ const createScheduleTask1 = new EventBridgeSchedulerCreateScheduleTask(stack, 'c
const createScheduleTask2 = new EventBridgeSchedulerCreateScheduleTask(stack, 'createSchedule2', {
scheduleName: 'TestSchedule2',
scheduleExpression: 'rate(1 minute)',
targetArn: targetQueue.queueArn,
target: targetQueue.queueArn,
role: schedulerRole,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export enum ActionAfterCompletion {
/**
* Properties for creating an AWS EventBridge Scheduler schedule
*/
export interface CreateScheduleProps extends sfn.TaskStateBaseProps {
export interface EventBridgeSchedulerCreateScheduleTaskProps extends sfn.TaskStateBaseProps {
/**
* Schedule name
*/
Expand Down Expand Up @@ -115,7 +115,7 @@ export interface CreateScheduleProps extends sfn.TaskStateBaseProps {
*
* @see https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets.html
*/
readonly targetArn: string;
readonly target: string;

/**
* The IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.
Expand Down Expand Up @@ -171,7 +171,7 @@ export class EventBridgeSchedulerCreateScheduleTask extends sfn.TaskStateBase {

private readonly integrationPattern: sfn.IntegrationPattern;

constructor(scope: Construct, id: string, private readonly props: CreateScheduleProps) {
constructor(scope: Construct, id: string, private readonly props: EventBridgeSchedulerCreateScheduleTaskProps) {
super(scope, id, props);

this.validateProps(props);
Expand Down Expand Up @@ -222,7 +222,7 @@ export class EventBridgeSchedulerCreateScheduleTask extends sfn.TaskStateBase {
StartDate: this.props.startDate ? this.props.startDate.toISOString() : undefined,
State: (this.props.enabled ?? true) ? 'ENABLED' : 'DISABLED',
Target: {
Arn: this.props.targetArn,
Arn: this.props.target,
RoleArn: this.props.role.roleArn,
Input: this.props.input,
RetryPolicy: this.props.retryPolicy ? {
Expand All @@ -237,7 +237,7 @@ export class EventBridgeSchedulerCreateScheduleTask extends sfn.TaskStateBase {
};
}

private validateProps(props: CreateScheduleProps) {
private validateProps(props: EventBridgeSchedulerCreateScheduleTaskProps) {
if (
props.clientToken !== undefined &&
!Token.isUnresolved(props.clientToken) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Create Schedule', () => {
const createScheduleTask = new tasks.EventBridgeSchedulerCreateScheduleTask(stack, 'createSchedule', {
scheduleName: 'TestSchedule',
scheduleExpression: 'rate(1 minute)',
targetArn: targetQueue.queueArn,
target: targetQueue.queueArn,
role: schedulerRole,
});

Expand Down Expand Up @@ -179,7 +179,7 @@ describe('Create Schedule', () => {
scheduleExpression: 'rate(1 minute)',
timezone: 'UTC',
enabled: true,
targetArn: targetQueue.queueArn,
target: targetQueue.queueArn,
role: schedulerRole,
retryPolicy: {
maximumRetryAttempts: 2,
Expand Down Expand Up @@ -340,7 +340,7 @@ describe('Create Schedule', () => {
new tasks.EventBridgeSchedulerCreateScheduleTask(stack, 'createSchedule', {
scheduleName: 'TestSchedule',
scheduleExpression: 'rate(1 minute)',
targetArn: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
target: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
role: schedulerRole,
clientToken,
});
Expand All @@ -353,7 +353,7 @@ describe('Create Schedule', () => {
new tasks.EventBridgeSchedulerCreateScheduleTask(stack, 'createSchedule', {
scheduleName: 'TestSchedule',
scheduleExpression: 'rate(1 minute)',
targetArn: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
target: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
role: schedulerRole,
description: invalidDescription,
});
Expand All @@ -367,7 +367,7 @@ describe('Create Schedule', () => {
new tasks.EventBridgeSchedulerCreateScheduleTask(stack, 'createSchedule', {
scheduleName: 'TestSchedule',
scheduleExpression: 'rate(1 minute)',
targetArn: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
target: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
role: schedulerRole,
flexibleTimeWindow,
});
Expand All @@ -381,7 +381,7 @@ describe('Create Schedule', () => {
new tasks.EventBridgeSchedulerCreateScheduleTask(stack, 'createSchedule', {
scheduleName: 'TestSchedule',
scheduleExpression: 'rate(1 minute)',
targetArn: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
target: 'arn:aws:sqs:us-east-1:123456789012:queue-name',
role: schedulerRole,
groupName,
});
Expand Down

0 comments on commit 57bdf9d

Please sign in to comment.