agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IProjectRef } from '../../aws-codebuild';
import type { IRole } from '../../aws-iam';
import type { IScheduleTarget } from '../../aws-scheduler';
/**
* Use an AWS CodeBuild as a target for AWS EventBridge Scheduler.
*/
export declare class CodeBuildStartBuild extends ScheduleTargetBase implements IScheduleTarget {
private readonly project;
constructor(project: IProjectRef, props?: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeBuildStartBuild=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},aws_iam_1=()=>{var tmp=require("../../aws-iam");return aws_iam_1=()=>tmp,tmp};class CodeBuildStartBuild extends target_1().ScheduleTargetBase{project;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.CodeBuildStartBuild",version:"2.252.0"};constructor(project,props={}){super(props,project.projectRef.projectArn),this.project=project;try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_codebuild_IProjectRef(project),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CodeBuildStartBuild),error}}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}role.addToPrincipalPolicy(new(aws_iam_1()).PolicyStatement({actions:["codebuild:StartBuild"],resources:[this.project.projectRef.projectArn]}))}}exports.CodeBuildStartBuild=CodeBuildStartBuild;

View File

@@ -0,0 +1,13 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type { IScheduleTarget } from '../../aws-scheduler';
import type { IPipelineRef } from '../../interfaces/generated/aws-codepipeline-interfaces.generated';
/**
* Use an AWS CodePipeline pipeline as a target for AWS EventBridge Scheduler.
*/
export declare class CodePipelineStartPipelineExecution extends ScheduleTargetBase implements IScheduleTarget {
private readonly pipeline;
constructor(pipeline: IPipelineRef, props?: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodePipelineStartPipelineExecution=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},aws_codepipeline_1=()=>{var tmp=require("../../aws-codepipeline");return aws_codepipeline_1=()=>tmp,tmp},aws_iam_1=()=>{var tmp=require("../../aws-iam");return aws_iam_1=()=>tmp,tmp};class CodePipelineStartPipelineExecution extends target_1().ScheduleTargetBase{pipeline;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.CodePipelineStartPipelineExecution",version:"2.252.0"};constructor(pipeline,props={}){super(props,pipelineArn(pipeline)),this.pipeline=pipeline;try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_codepipeline_IPipelineRef(pipeline),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CodePipelineStartPipelineExecution),error}}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}role.addToPrincipalPolicy(new(aws_iam_1()).PolicyStatement({actions:["codepipeline:StartPipelineExecution"],resources:[pipelineArn(this.pipeline)]}))}}exports.CodePipelineStartPipelineExecution=CodePipelineStartPipelineExecution;function pipelineArn(pipeline){return isIPipeline(pipeline)?pipeline.pipelineArn:aws_codepipeline_1().CfnPipeline.arnForPipeline(pipeline)}function isIPipeline(pipeline){return"pipelineArn"in pipeline}

View File

@@ -0,0 +1,166 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import * as ec2 from '../../aws-ec2';
import * as ecs from '../../aws-ecs';
import type { IRole } from '../../aws-iam';
import type { ISchedule, IScheduleTarget, ScheduleTargetConfig } from '../../aws-scheduler';
/**
* Metadata that you apply to a resource to help categorize and organize the resource. Each tag consists of a key and an optional value, both of which you define.
*/
export interface Tag {
/**
* Key is the name of the tag
*/
readonly key: string;
/**
* Value is the metadata contents of the tag
*/
readonly value: string;
}
/**
* Parameters for scheduling ECS Run Task (common to EC2 and Fargate launch types).
*/
export interface EcsRunTaskBaseProps extends ScheduleTargetBaseProps {
/**
* The task definition to use for scheduled tasks.
*
* Note: this must be TaskDefinition, and not ITaskDefinition,
* as it requires properties that are not known for imported task definitions
* If you want to run a RunTask with an imported task definition,
* consider using a Universal target.
*/
readonly taskDefinition: ecs.TaskDefinition;
/**
* The capacity provider strategy to use for the task.
*
* @default - No capacity provider strategy
*/
readonly capacityProviderStrategies?: ecs.CapacityProviderStrategy[];
/**
* The subnets associated with the task. These subnets must all be in the same VPC.
* The task will be launched in these subnets.
*
* @default - all private subnets of the VPC are selected.
*/
readonly vpcSubnets?: ec2.SubnetSelection;
/**
* The security groups associated with the task. These security groups must all be in the same VPC.
* Controls inbound and outbound network access for the task.
*
* @default - The security group for the VPC is used.
*/
readonly securityGroups?: ec2.ISecurityGroup[];
/**
* Specifies whether to enable Amazon ECS managed tags for the task.
* @default - false
*/
readonly enableEcsManagedTags?: boolean;
/**
* Whether to enable execute command functionality for the containers in this task.
* If true, this enables execute command functionality on all containers in the task.
*
* @default - false
*/
readonly enableExecuteCommand?: boolean;
/**
* Specifies an ECS task group for the task.
*
* @default - No group
*/
readonly group?: string;
/**
* Specifies whether to propagate the tags from the task definition to the task.
* If no value is specified, the tags are not propagated.
*
* @default - No tag propagation
*/
readonly propagateTags?: boolean;
/**
* The reference ID to use for the task.
*
* @default - No reference ID.
*/
readonly referenceId?: string;
/**
* The metadata that you apply to the task to help you categorize and organize them.
* Each tag consists of a key and an optional value, both of which you define.
*
* @default - No tags
*/
readonly tags?: Tag[];
/**
* The number of tasks to create based on TaskDefinition.
*
* @default 1
*/
readonly taskCount?: number;
}
/**
* Properties for scheduling an ECS Fargate Task.
*/
export interface FargateTaskProps extends EcsRunTaskBaseProps {
/**
* Specifies whether the task's elastic network interface receives a public IP address.
* If true, the task will receive a public IP address and be accessible from the internet.
* Should only be set to true when using public subnets.
*
* @default - true if the subnet type is PUBLIC, otherwise false
*/
readonly assignPublicIp?: boolean;
/**
* Specifies the platform version for the task.
* Specify only the numeric portion of the platform version, such as 1.1.0.
* Platform versions determine the underlying runtime environment for the task.
*
* @default - LATEST
*/
readonly platformVersion?: ecs.FargatePlatformVersion;
}
/**
* Properties for scheduling an ECS Task on EC2.
*/
export interface Ec2TaskProps extends EcsRunTaskBaseProps {
/**
* The rules that must be met in order to place a task on a container instance.
*
* @default - No placement constraints.
*/
readonly placementConstraints?: ecs.PlacementConstraint[];
/**
* The algorithm for selecting container instances for task placement.
*
* @default - No placement strategies.
*/
readonly placementStrategies?: ecs.PlacementStrategy[];
}
/**
* Schedule an ECS Task using AWS EventBridge Scheduler.
*/
export declare abstract class EcsRunTask extends ScheduleTargetBase implements IScheduleTarget {
protected readonly cluster: ecs.ICluster;
protected readonly props: EcsRunTaskBaseProps;
constructor(cluster: ecs.ICluster, props: EcsRunTaskBaseProps);
protected addTargetActionToRole(role: IRole): void;
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig;
}
/**
* Schedule an ECS Task on Fargate using AWS EventBridge Scheduler.
*/
export declare class EcsRunFargateTask extends EcsRunTask {
private readonly subnetSelection?;
private readonly assignPublicIp?;
private readonly platformVersion?;
private readonly capacityProviderStrategies?;
constructor(cluster: ecs.ICluster, props: FargateTaskProps);
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig;
}
/**
* Schedule an ECS Task on EC2 using AWS EventBridge Scheduler.
*/
export declare class EcsRunEc2Task extends EcsRunTask {
private readonly capacityProviderStrategies?;
private readonly placementConstraints?;
private readonly placementStrategies?;
constructor(cluster: ecs.ICluster, props: Ec2TaskProps);
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,52 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type * as events from '../../aws-events';
import type { IRole } from '../../aws-iam';
import type { IScheduleTarget, ISchedule, ScheduleTargetInput, ScheduleTargetConfig } from '../../aws-scheduler';
/**
* An entry to be sent to EventBridge
*
* @see https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEventsRequestEntry.html
*/
export interface EventBridgePutEventsEntry {
/**
* The event body
*
* Can either be provided as an object or as a JSON-serialized string
* @example
*
* ScheduleTargetInput.fromText('{"instance-id": "i-1234567890abcdef0", "state": "terminated"}');
* ScheduleTargetInput.fromObject({ Message: 'Hello from a friendly event :)' });
*/
readonly detail: ScheduleTargetInput;
/**
* Used along with the source field to help identify the fields and values expected in the detail field
*
* For example, events by CloudTrail have detail type "AWS API Call via CloudTrail"
* @see https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html
*/
readonly detailType: string;
/**
* The event bus the entry will be sent to.
*
*/
readonly eventBus: events.IEventBus;
/**
* The service or application that caused this event to be generated
*
* Example value: `com.example.service`
*
* @see https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html
*/
readonly source: string;
}
/**
* Send an event to an AWS EventBridge by AWS EventBridge Scheduler.
*/
export declare class EventBridgePutEvents extends ScheduleTargetBase implements IScheduleTarget {
private readonly entry;
private readonly props;
constructor(entry: EventBridgePutEventsEntry, props?: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EventBridgePutEvents=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class EventBridgePutEvents extends target_1().ScheduleTargetBase{entry;props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.EventBridgePutEvents",version:"2.252.0"};constructor(entry,props={}){super(props,entry.eventBus.eventBusArn),this.entry=entry,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_EventBridgePutEventsEntry(entry),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,EventBridgePutEvents),error}if(this.props.input)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ScheduleTargetBasePropsInput`,"ScheduleTargetBaseProps.input is not supported for EventBridgePutEvents. Please use entry.detail instead.")}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.entry.eventBus.grantPutEventsTo(role)}bindBaseTargetConfig(_schedule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_ISchedule(_schedule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindBaseTargetConfig),error}return{...super.bindBaseTargetConfig(_schedule),input:this.entry.detail,eventBridgeParameters:{detailType:this.entry.detailType,source:this.entry.source}}}}exports.EventBridgePutEvents=EventBridgePutEvents;

View File

@@ -0,0 +1,13 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type { IDeliveryStream } from '../../aws-kinesisfirehose';
import type { IScheduleTarget } from '../../aws-scheduler';
/**
* Use an Amazon Data Firehose as a target for AWS EventBridge Scheduler.
*/
export declare class FirehosePutRecord extends ScheduleTargetBase implements IScheduleTarget {
private readonly deliveryStream;
constructor(deliveryStream: IDeliveryStream, props?: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FirehosePutRecord=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},aws_iam_1=()=>{var tmp=require("../../aws-iam");return aws_iam_1=()=>tmp,tmp};class FirehosePutRecord extends target_1().ScheduleTargetBase{deliveryStream;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.FirehosePutRecord",version:"2.252.0"};constructor(deliveryStream,props={}){super(props,deliveryStream.deliveryStreamArn),this.deliveryStream=deliveryStream;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_kinesisfirehose_IDeliveryStream(deliveryStream),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,FirehosePutRecord),error}}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}role.addToPrincipalPolicy(new(aws_iam_1()).PolicyStatement({actions:["firehose:PutRecord"],resources:[this.deliveryStream.deliveryStreamArn]}))}}exports.FirehosePutRecord=FirehosePutRecord;

View File

@@ -0,0 +1,14 @@
export * from './codebuild-start-build';
export * from './codepipeline-start-pipeline-execution';
export * from './event-bridge-put-events';
export * from './ecs-run-task';
export * from './inspector-start-assessment-run';
export * from './firehose-put-record';
export * from './kinesis-stream-put-record';
export * from './lambda-invoke';
export * from './sage-maker-start-pipeline-execution';
export * from './sns-publish';
export * from './sqs-send-message';
export * from './stepfunctions-start-execution';
export * from './target';
export * from './universal';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type { IScheduleTarget } from '../../aws-scheduler';
import type { IAssessmentTemplateRef } from '../../interfaces/generated/aws-inspector-interfaces.generated';
/**
* Use an Amazon Inspector as a target for AWS EventBridge Scheduler.
*/
export declare class InspectorStartAssessmentRun extends ScheduleTargetBase implements IScheduleTarget {
constructor(template: IAssessmentTemplateRef, props?: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InspectorStartAssessmentRun=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},aws_iam_1=()=>{var tmp=require("../../aws-iam");return aws_iam_1=()=>tmp,tmp};class InspectorStartAssessmentRun extends target_1().ScheduleTargetBase{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.InspectorStartAssessmentRun",version:"2.252.0"};constructor(template,props={}){super(props,template.assessmentTemplateRef.assessmentTemplateArn);try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_inspector_IAssessmentTemplateRef(template),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,InspectorStartAssessmentRun),error}}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}role.addToPrincipalPolicy(new(aws_iam_1()).PolicyStatement({actions:["inspector:StartAssessmentRun"],resources:["*"]}))}}exports.InspectorStartAssessmentRun=InspectorStartAssessmentRun;

View File

@@ -0,0 +1,28 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type * as kinesis from '../../aws-kinesis';
import type { ISchedule, IScheduleTarget, ScheduleTargetConfig } from '../../aws-scheduler';
/**
* Properties for a Kinesis Data Streams Target
*/
export interface KinesisStreamPutRecordProps extends ScheduleTargetBaseProps {
/**
* The shard to which EventBridge Scheduler sends the event.
*
* The length must be between 1 and 256.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-kinesisparameters.html
*/
readonly partitionKey: string;
}
/**
* Use an Amazon Kinesis Data Streams as a target for AWS EventBridge Scheduler.
*/
export declare class KinesisStreamPutRecord extends ScheduleTargetBase implements IScheduleTarget {
private readonly stream;
private readonly props;
constructor(stream: kinesis.IStream, props: KinesisStreamPutRecordProps);
protected addTargetActionToRole(role: IRole): void;
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KinesisStreamPutRecord=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class KinesisStreamPutRecord extends target_1().ScheduleTargetBase{stream;props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.KinesisStreamPutRecord",version:"2.252.0"};constructor(stream,props){super(props,stream.streamArn),this.stream=stream,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_kinesis_IStream(stream),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_KinesisStreamPutRecordProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,KinesisStreamPutRecord),error}if(!core_1().Token.isUnresolved(props.partitionKey)&&(props.partitionKey.length<1||props.partitionKey.length>256))throw new(core_1()).ValidationError((0,literal_string_1().lit)`PartitionKeyLength`,`partitionKey length must be between 1 and 256, got ${props.partitionKey.length}`,stream)}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.stream.grant(role,"kinesis:PutRecord","kinesis:PutRecords"),this.stream.encryptionKey?.grant(role,"kms:GenerateDataKey*")}bindBaseTargetConfig(_schedule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_ISchedule(_schedule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindBaseTargetConfig),error}return{...super.bindBaseTargetConfig(_schedule),kinesisParameters:{partitionKey:this.props.partitionKey}}}}exports.KinesisStreamPutRecord=KinesisStreamPutRecord;

View File

@@ -0,0 +1,13 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type * as lambda from '../../aws-lambda';
import type { IScheduleTarget } from '../../aws-scheduler';
/**
* Use an AWS Lambda function as a target for AWS EventBridge Scheduler.
*/
export declare class LambdaInvoke extends ScheduleTargetBase implements IScheduleTarget {
private readonly func;
constructor(func: lambda.IFunction, props?: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaInvoke=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp};class LambdaInvoke extends target_1().ScheduleTargetBase{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.LambdaInvoke",version:"2.252.0"};func;constructor(func,props={}){super(props,func.functionArn);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_IFunction(func),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,LambdaInvoke),error}this.func=func}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.func.grantInvoke(role)}}exports.LambdaInvoke=LambdaInvoke;

View File

@@ -0,0 +1,43 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type { IPipeline } from '../../aws-sagemaker';
import type { ISchedule, IScheduleTarget, ScheduleTargetConfig } from '../../aws-scheduler';
/**
* Properties for a pipeline parameter
*/
export interface SageMakerPipelineParameter {
/**
* Name of parameter to start execution of a SageMaker Model Building Pipeline.
*/
readonly name: string;
/**
* Value of parameter to start execution of a SageMaker Model Building Pipeline.
*/
readonly value: string;
}
/**
* Properties for a SageMaker Target
*/
export interface SageMakerStartPipelineExecutionProps extends ScheduleTargetBaseProps {
/**
* List of parameter names and values to use when executing the SageMaker Model Building Pipeline.
*
* The length must be between 0 and 200.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-sagemakerpipelineparameters.html#cfn-scheduler-schedule-sagemakerpipelineparameters-pipelineparameterlist
*
* @default - no pipeline parameter list
*/
readonly pipelineParameterList?: SageMakerPipelineParameter[];
}
/**
* Use a SageMaker pipeline as a target for AWS EventBridge Scheduler.
*/
export declare class SageMakerStartPipelineExecution extends ScheduleTargetBase implements IScheduleTarget {
private readonly pipeline;
private readonly props;
constructor(pipeline: IPipeline, props?: SageMakerStartPipelineExecutionProps);
protected addTargetActionToRole(role: IRole): void;
protected bindBaseTargetConfig(schedule: ISchedule): ScheduleTargetConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SageMakerStartPipelineExecution=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class SageMakerStartPipelineExecution extends target_1().ScheduleTargetBase{pipeline;props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.SageMakerStartPipelineExecution",version:"2.252.0"};constructor(pipeline,props={}){super(props,pipeline.pipelineArn),this.pipeline=pipeline,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_sagemaker_IPipeline(pipeline),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_SageMakerStartPipelineExecutionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SageMakerStartPipelineExecution),error}if(props.pipelineParameterList!==void 0&&props.pipelineParameterList.length>200)throw new(core_1()).ValidationError((0,literal_string_1().lit)`PipelineParameterListLength`,`pipelineParameterList length must be between 0 and 200, got ${props.pipelineParameterList.length}`,pipeline)}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.pipeline.grantStartPipelineExecution(role)}bindBaseTargetConfig(schedule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_ISchedule(schedule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindBaseTargetConfig),error}const sageMakerPipelineParameters=this.props.pipelineParameterList?{pipelineParameterList:this.props.pipelineParameterList.map(param=>({name:param.name,value:param.value}))}:void 0;return{...super.bindBaseTargetConfig(schedule),sageMakerPipelineParameters}}}exports.SageMakerStartPipelineExecution=SageMakerStartPipelineExecution;

View File

@@ -0,0 +1,13 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type { IScheduleTarget } from '../../aws-scheduler';
import type * as sns from '../../aws-sns';
/**
* Use an Amazon SNS topic as a target for AWS EventBridge Scheduler.
*/
export declare class SnsPublish extends ScheduleTargetBase implements IScheduleTarget {
private readonly topic;
constructor(topic: sns.ITopic, props?: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SnsPublish=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp};class SnsPublish extends target_1().ScheduleTargetBase{topic;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.SnsPublish",version:"2.252.0"};constructor(topic,props={}){super(props,topic.topicArn),this.topic=topic;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_sns_ITopic(topic),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SnsPublish),error}}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.topic.grantPublish(role)}}exports.SnsPublish=SnsPublish;

View File

@@ -0,0 +1,33 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type { ISchedule, IScheduleTarget, ScheduleTargetConfig } from '../../aws-scheduler';
import type * as sqs from '../../aws-sqs';
/**
* Properties for a SQS Queue Target
*/
export interface SqsSendMessageProps extends ScheduleTargetBaseProps {
/**
* The FIFO message group ID to use as the target.
*
* This must be specified when the target is a FIFO queue. If you specify
* a FIFO queue as a target, the queue must have content-based deduplication enabled.
*
* A length of `messageGroupId` must be between 1 and 128.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-sqsparameters.html#cfn-scheduler-schedule-sqsparameters-messagegroupid
*
* @default - no message group ID
*/
readonly messageGroupId?: string;
}
/**
* Use an Amazon SQS Queue as a target for AWS EventBridge Scheduler.
*/
export declare class SqsSendMessage extends ScheduleTargetBase implements IScheduleTarget {
private readonly queue;
private readonly props;
constructor(queue: sqs.IQueue, props?: SqsSendMessageProps);
protected addTargetActionToRole(role: IRole): void;
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SqsSendMessage=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class SqsSendMessage extends target_1().ScheduleTargetBase{queue;props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.SqsSendMessage",version:"2.252.0"};constructor(queue,props={}){super(props,queue.queueArn),this.queue=queue,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_sqs_IQueue(queue),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_SqsSendMessageProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SqsSendMessage),error}if(props.messageGroupId!==void 0){if(!core_1().Token.isUnresolved(props.messageGroupId)&&(props.messageGroupId.length<1||props.messageGroupId.length>128))throw new(core_1()).ValidationError((0,literal_string_1().lit)`MessageGroupIdLength`,`messageGroupId length must be between 1 and 128, got ${props.messageGroupId.length}`,queue);if(!queue.fifo)throw new(core_1()).ValidationError((0,literal_string_1().lit)`TargetQueueMessageGroupId`,"target must be a FIFO queue if messageGroupId is specified",queue);if(!queue.node.defaultChild.contentBasedDeduplication)throw new(core_1()).ValidationError((0,literal_string_1().lit)`ContentBasedDeduplicationTrueTarget`,"contentBasedDeduplication must be true if the target is a FIFO queue",queue)}else if(queue.fifo)throw new(core_1()).ValidationError((0,literal_string_1().lit)`MessageGroupIdSpecifiedTarget`,"messageGroupId must be specified if the target is a FIFO queue",queue)}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.queue.grant(role,"sqs:SendMessage"),this.queue.encryptionMasterKey?.grant(role,"kms:Decrypt","kms:GenerateDataKey*")}bindBaseTargetConfig(_schedule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_ISchedule(_schedule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindBaseTargetConfig),error}return{...super.bindBaseTargetConfig(_schedule),sqsParameters:{messageGroupId:this.props.messageGroupId}}}}exports.SqsSendMessage=SqsSendMessage;

View File

@@ -0,0 +1,13 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import type { IScheduleTarget } from '../../aws-scheduler';
import type { IStateMachine } from '../../aws-stepfunctions';
/**
* Use an AWS Step function as a target for AWS EventBridge Scheduler.
*/
export declare class StepFunctionsStartExecution extends ScheduleTargetBase implements IScheduleTarget {
private readonly stateMachine;
constructor(stateMachine: IStateMachine, props: ScheduleTargetBaseProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StepFunctionsStartExecution=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp};class StepFunctionsStartExecution extends target_1().ScheduleTargetBase{stateMachine;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.StepFunctionsStartExecution",version:"2.252.0"};constructor(stateMachine,props){super(props,stateMachine.stateMachineArn),this.stateMachine=stateMachine;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IStateMachine(stateMachine),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,StepFunctionsStartExecution),error}}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.stateMachine.grantStartExecution(role)}}exports.StepFunctionsStartExecution=StepFunctionsStartExecution;

View File

@@ -0,0 +1,80 @@
import * as iam from '../../aws-iam';
import type { ISchedule, ScheduleTargetConfig, ScheduleTargetInput } from '../../aws-scheduler';
import type * as sqs from '../../aws-sqs';
import { Duration } from '../../core';
/**
* Base properties for a Schedule Target
*/
export interface ScheduleTargetBaseProps {
/**
* An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
*
* If none provided templates target will automatically create an IAM role with all the minimum necessary
* permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
* will grant minimal required permissions.
*
* @default - created by target
*/
readonly role?: iam.IRole;
/**
* The SQS queue to be used as deadLetterQueue.
*
* The events not successfully delivered are automatically retried for a specified period of time,
* depending on the retry policy of the target.
* If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
*
* @default - no dead-letter queue
*/
readonly deadLetterQueue?: sqs.IQueue;
/**
* Input passed to the target.
*
* @default - no input.
*/
readonly input?: ScheduleTargetInput;
/**
* The maximum age of a request that Scheduler sends to a target for processing.
*
* Minimum value of 60.
* Maximum value of 86400.
*
* @default Duration.hours(24)
*/
readonly maxEventAge?: Duration;
/**
* The maximum number of times to retry when the target returns an error.
*
* Minimum value of 0.
* Maximum value of 185.
*
* @default 185
*/
readonly retryAttempts?: number;
}
/**
* Base class for Schedule Targets
*/
export declare abstract class ScheduleTargetBase {
private readonly baseProps;
protected readonly targetArn: string;
constructor(baseProps: ScheduleTargetBaseProps, targetArn: string);
protected abstract addTargetActionToRole(role: iam.IRole): void;
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig;
/**
* Create a return a Schedule Target Configuration for the given schedule
* @returns a Schedule Target Configuration
*/
bind(schedule: ISchedule): ScheduleTargetConfig;
/**
* Get or create the Role for the EventBridge Scheduler event
*
* If a role already exists, it will be returned. This ensures that if multiple
* schedules have the same target, they will share a role.
*/
private createOrGetScheduleTargetRole;
/**
* Allow schedule to send events with failed invocation to an Amazon SQS queue.
*/
private addDeadLetterQueueActionToRole;
private renderRetryPolicy;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ScheduleTargetBase=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},helpers_internal_1=()=>{var tmp=require("../../core/lib/helpers-internal");return helpers_internal_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class ScheduleTargetBase{baseProps;targetArn;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.ScheduleTargetBase",version:"2.252.0"};constructor(baseProps,targetArn){this.baseProps=baseProps,this.targetArn=targetArn;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_ScheduleTargetBaseProps(baseProps)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ScheduleTargetBase),error}}bindBaseTargetConfig(_schedule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_ISchedule(_schedule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindBaseTargetConfig),error}const role=this.baseProps.role??this.createOrGetScheduleTargetRole(_schedule,this.targetArn);return this.addTargetActionToRole(role),this.baseProps.deadLetterQueue&&this.addDeadLetterQueueActionToRole(role,this.baseProps.deadLetterQueue),{arn:this.targetArn,role,deadLetterConfig:this.baseProps.deadLetterQueue?{arn:this.baseProps.deadLetterQueue.queueArn}:void 0,retryPolicy:this.renderRetryPolicy(this.baseProps.maxEventAge,this.baseProps.retryAttempts),input:this.baseProps.input}}bind(schedule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_ISchedule(schedule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return this.bindBaseTargetConfig(schedule)}createOrGetScheduleTargetRole(schedule,targetArn){const stack=core_1().Stack.of(schedule),arn=core_1().Token.isUnresolved(targetArn)?JSON.stringify(stack.resolve(targetArn)):targetArn,id="SchedulerRoleForTarget-"+(0,helpers_internal_1().md5hash)(arn).slice(0,6),existingRole=stack.node.tryFindChild(id),principal=new(iam()).ServicePrincipal("scheduler.amazonaws.com",{conditions:{StringEquals:{"aws:SourceAccount":schedule.env.account,"aws:SourceArn":schedule.scheduleGroup?.scheduleGroupArn??core_1().Stack.of(schedule).formatArn({service:"scheduler",resource:"schedule-group",region:schedule.env.region,account:schedule.env.account,resourceName:schedule.scheduleGroup?.scheduleGroupName??"default"})}}});return existingRole?(existingRole.assumeRolePolicy?.addStatements(new(iam()).PolicyStatement({effect:iam().Effect.ALLOW,principals:[principal],actions:["sts:AssumeRole"]})),existingRole):new(iam()).Role(stack,id,{roleName:core_1().PhysicalName.GENERATE_IF_NEEDED,assumedBy:principal})}addDeadLetterQueueActionToRole(role,queue){role.addToPrincipalPolicy(new(iam()).PolicyStatement({actions:["sqs:SendMessage"],resources:[queue.queueArn]}))}renderRetryPolicy(maximumEventAge,maximumRetryAttempts){const maxMaxAge=core_1().Duration.days(1).toSeconds(),minMaxAge=core_1().Duration.minutes(1).toSeconds();let maxAge=maxMaxAge;if(maximumEventAge){if(maxAge=maximumEventAge.toSeconds({integral:!0}),maxAge>maxMaxAge)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MaximumEvent`,"Maximum event age is 1 day");if(maxAge<minMaxAge)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MinimumEventMinute`,"Minimum event age is 1 minute")}let maxAttempts=185;if(typeof maximumRetryAttempts<"u"){if(maximumRetryAttempts<0)throw Error("Number of retry attempts should be greater or equal than 0");if(maximumRetryAttempts>185)throw Error("Number of retry attempts should be less or equal than 185");maxAttempts=maximumRetryAttempts}return{maximumEventAgeInSeconds:maxAge,maximumRetryAttempts:maxAttempts}}}exports.ScheduleTargetBase=ScheduleTargetBase;

View File

@@ -0,0 +1,42 @@
import type { ScheduleTargetBaseProps } from './target';
import { ScheduleTargetBase } from './target';
import type { IRole } from '../../aws-iam';
import { PolicyStatement } from '../../aws-iam';
import type { IScheduleTarget } from '../../aws-scheduler';
/**
* Properties for a Universal Target
*/
export interface UniversalTargetProps extends ScheduleTargetBaseProps {
/**
* The AWS service to call.
*
* This must be in lowercase.
*/
readonly service: string;
/**
* The API action to call. Must be camelCase.
*
* You cannot use read-only API actions such as common GET operations.
*
* @see https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html#unsupported-api-actions
*/
readonly action: string;
/**
* The IAM policy statements needed to invoke the target. These statements are attached to the Scheduler's role.
*
* Note that the default may not be the correct actions as not all AWS services follows the same IAM action pattern, or there may be more actions needed to invoke the target.
*
* @default - Policy with `service:action` action only.
*/
readonly policyStatements?: PolicyStatement[];
}
/**
* Use a wider set of AWS API as a target for AWS EventBridge Scheduler.
*
* @see https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html
*/
export declare class Universal extends ScheduleTargetBase implements IScheduleTarget {
private readonly props;
constructor(props: UniversalTargetProps);
protected addTargetActionToRole(role: IRole): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Universal=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},aws_iam_1=()=>{var tmp=require("../../aws-iam");return aws_iam_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},helpers_internal_1=()=>{var tmp=require("../../custom-resources/lib/helpers-internal");return helpers_internal_1=()=>tmp,tmp};const NOT_SUPPORTED_ACTION_PREFIX=["get","describe","list","poll","receive","search","scan","query","select","read","lookup","discover","validate","batchGet","batchDescribe","batchRead","transactGet","adminGet","adminList","testMigration","retrieve","testConnection","translateDocument","isAuthorized","invokeModel"];class Universal extends target_1().ScheduleTargetBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.Universal",version:"2.252.0"};constructor(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_UniversalTargetProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Universal),error}const service=props.service,action=props.action;if(!core_1().Token.isUnresolved(service)&&service!==service.toLowerCase())throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeServiceLowercase`,`API service must be lowercase, got: ${service}`);if(!core_1().Token.isUnresolved(action)&&!action.startsWith(action[0]?.toLowerCase()))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeActionCamelcase`,`API action must be camelCase, got: ${action}`);if(!core_1().Token.isUnresolved(action)&&NOT_SUPPORTED_ACTION_PREFIX.some(prefix=>action.startsWith(prefix)))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ReadOnlyActionSupportedEventbridge`,`Read-only API action is not supported by EventBridge Scheduler: ${service}:${action}`);const arn=`arn:${core_1().Aws.PARTITION}:scheduler:::aws-sdk:${service}:${action}`;super(props,arn),this.props=props}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}if(!this.props.policyStatements?.length){core_1().Annotations.of(role).addWarningV2("@aws-cdk/aws-scheduler-targets:defaultWildcardResourcePolicy","Default policy with * for resources is used. Use custom policy for better security posture."),role.addToPrincipalPolicy(new(aws_iam_1()).PolicyStatement({actions:[(0,helpers_internal_1().awsSdkToIamAction)(this.props.service,this.props.action)],resources:["*"]}));return}for(const statement of this.props.policyStatements)role.addToPrincipalPolicy(statement)}}exports.Universal=Universal;