// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as stepfunctions from '@aws-cdk/aws-stepfunctions';
import * as stepfunctions_tasks from '@aws-cdk/aws-stepfunctions-tasks';
declare const input: any;
declare const stateMachine: stepfunctions.StateMachine;
const startExecution = new stepfunctions_tasks.StartExecution(stateMachine, /* all optional props */ {
input: {
inputKey: input,
},
integrationPattern: stepfunctions.ServiceIntegrationPattern.FIRE_AND_FORGET,
name: 'name',
});
const startQueryExecutionJob = new tasks.AthenaStartQueryExecution(this, 'Start Athena Query', {
queryString: sfn.JsonPath.stringAt('$.queryString'),
queryExecutionContext: {
databaseName: 'mydatabase',
},
resultConfiguration: {
encryptionConfiguration: {
encryptionOption: tasks.EncryptionOption.S3_MANAGED,
},
outputLocation: {
bucketName: 'query-results-bucket',
objectKey: 'folder',
},
},
});
const getQueryExecutionJob = new tasks.AthenaGetQueryExecution(this, 'Get Query Execution', {
queryExecutionId: sfn.JsonPath.stringAt('$.QueryExecutionId'),
});
import { AthenaClient, StartQueryExecutionCommand } from "@aws-sdk/client-athena"; // ES Modules import
// const { AthenaClient, StartQueryExecutionCommand } = require("@aws-sdk/client-athena"); // CommonJS import
const client = new AthenaClient(config);
const command = new StartQueryExecutionCommand(input);
const response = await client.send(command);