import * as api from '@aws-cdk/aws-apigateway';
import * as lambda from '@aws-cdk/aws-lambda';
const rule = new events.Rule(this, 'Rule', {
schedule: events.Schedule.rate(cdk.Duration.minutes(1)),
});
const fn = new lambda.Function( this, 'MyFunc', {
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_12_X,
code: lambda.Code.fromInline( 'exports.handler = e => {}' ),
} );
const restApi = new api.LambdaRestApi( this, 'MyRestAPI', { handler: fn } );
const dlq = new sqs.Queue(this, 'DeadLetterQueue');
rule.addTarget(
new targets.ApiGateway( restApi, {
path: '/*/test',
method: 'GET',
stage: 'prod',
pathParameterValues: ['path-value'],
headerParameters: {
Header1: 'header1',
},
queryStringParameters: {
QueryParam1: 'query-param-1',
},
deadLetterQueue: dlq
} ),
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cx_api from '@aws-cdk/cx-api';
import * as pipelines from '@aws-cdk/pipelines';
declare const cloudFormationStackArtifact: cx_api.CloudFormationStackArtifact;
const stackDeployment = pipelines.StackDeployment.fromArtifact(cloudFormationStackArtifact);
// create a pipeline
import * as codecommit from '@aws-cdk/aws-codecommit';
const pipeline = new codepipeline.Pipeline(this, 'Pipeline');
// add a stage
const sourceStage = pipeline.addStage({ stageName: 'Source' });
// add a source action to the stage
declare const repo: codecommit.Repository;
declare const sourceArtifact: codepipeline.Artifact;
sourceStage.addAction(new codepipeline_actions.CodeCommitSourceAction({
actionName: 'Source',
output: sourceArtifact,
repository: repo,
}));
// ... add more stages
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cloud_assembly_schema from '@aws-cdk/cloud-assembly-schema';
import * as cx_api from '@aws-cdk/cx-api';
declare const cloudAssembly: cx_api.CloudAssembly;
const cloudArtifact = cx_api.CloudArtifact.fromManifest(cloudAssembly, 'MyCloudArtifact', {
type: cloud_assembly_schema.ArtifactType.NONE,
// the properties below are optional
dependencies: ['dependencies'],
displayName: 'displayName',
environment: 'environment',
metadata: {
metadataKey: [{
type: 'type',
// the properties below are optional
data: 'data',
trace: ['trace'],
}],
},
properties: {
templateFile: 'templateFile',
// the properties below are optional
assumeRoleArn: 'assumeRoleArn',
assumeRoleExternalId: 'assumeRoleExternalId',
bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
cloudFormationExecutionRoleArn: 'cloudFormationExecutionRoleArn',
parameters: {
parametersKey: 'parameters',
},
requiresBootstrapStackVersion: 123,
stackName: 'stackName',
stackTemplateAssetObjectUrl: 'stackTemplateAssetObjectUrl',
tags: {
tagsKey: 'tags',
},
terminationProtection: false,
validateOnSynth: false,
},
});
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cx_api from '@aws-cdk/cx-api';
const cloudAssembly = new cx_api.CloudAssembly('directory');