cdk-athena-3.0.0
توضیحات
CDK Construct for creating Athena resources
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cdk-athena-3.0.0 |
| نام | cdk-athena |
| نسخه کتابخانه | 3.0.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Daniel Schroeder |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/udondan/cdk-athena |
| آدرس اینترنتی | https://pypi.org/project/cdk-athena/ |
| مجوز | Apache-2.0 |
# CDK Athena WorkGroup
[](https://github.com/udondan/cdk-athena)
[](https://github.com/udondan/cdk-athena/actions?query=workflow%3ATest)
[](https://github.com/udondan/cdk-athena/blob/master/LICENSE)
[](https://constructs.dev/packages/cdk-athena)
[](https://www.npmjs.com/package/cdk-athena)
[](https://pypi.org/project/cdk-athena/)

[](https://www.npmjs.com/package/cdk-athena)
[](https://pypi.org/project/cdk-athena/)
[AWS CDK](https://aws.amazon.com/cdk/) L3 construct for managing Athena [WorkGroups](https://docs.aws.amazon.com/athena/latest/ug/manage-queries-control-costs-with-workgroups.html) and named queries.
Because I couldn't get [@aws-cdk/aws-athena.CfnWorkGroup](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-athena.CfnWorkGroup.html) to work and [@aws-cdk/custom-resources.AwsCustomResource](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_custom-resources.AwsCustomResource.html) has no support for tags.
## Installation
This package has peer dependencies, which need to be installed along in the expected version.
For TypeScript/NodeJS, add these to your `dependencies` in `package.json`. For Python, add these to your `requirements.txt`:
* cdk-ec2-key-pair
* aws-cdk-lib (^2.0.0)
* constructs (^10.0.0)
## CDK compatibility
* Version 3.x is compatible with the CDK v2.
* Version 2.x is compatible with the CDK v1. There won't be regular updates for this.
## Usage
```python
const workgroup = new WorkGroup(this, 'WorkGroup', {
name: 'TheName', // required
desc: 'Some description',
publishCloudWatchMetricsEnabled: true,
enforceWorkGroupConfiguration: true,
requesterPaysEnabled: true,
bytesScannedCutoffPerQuery: 11000000,
resultConfiguration: {
outputLocation: `s3://some-bucket/prefix`,
encryptionConfiguration: {
encryptionOption: EncryptionOption.SSE_S3,
},
},
});
const query = new NamedQuery(this, 'a-query', {
name: 'A Test Query',
database: 'audit',
desc: 'This is the description',
queryString: `
SELECT
count(*) AS assumed,
split(useridentity.principalid, ':')[2] AS user,
resources[1].arn AS role
FROM cloudtrail_logs
WHERE
eventname='AssumeRole' AND
useridentity.principalid is NOT NULL AND
useridentity.principalid LIKE '%@%'
GROUP BY
split(useridentity.principalid,':')[2],
resources[1].arn
`,
workGroup: workgroup,
});
cdk.Tag.add(workgroup, 'HelloTag', 'ok');
new cdk.CfnOutput(this, 'WorkGroupArn', {
value: workgroup.arn,
});
new cdk.CfnOutput(this, 'WorkGroupName', {
value: workgroup.name,
});
new cdk.CfnOutput(this, 'QueryId', {
value: query.id,
});
```
نیازمندی
| مقدار | نام |
|---|---|
| <3.0.0,>=2.0.0 | aws-cdk-lib |
| <11.0.0,>=10.0.0 | constructs |
| <2.0.0,>=1.58.0 | jsii |
| >=0.0.3 | publication |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| ~=3.7 | Python |
نحوه نصب
نصب پکیج whl cdk-athena-3.0.0:
pip install cdk-athena-3.0.0.whl
نصب پکیج tar.gz cdk-athena-3.0.0:
pip install cdk-athena-3.0.0.tar.gz