This project has been archived by its maintainers, and is no longer receiving any updates.
CDK Athena WorkGroup
AWS CDK L3 construct for managing Athena WorkGroups and named queries.
Because I couldn't get @aws-cdk/aws-athena.CfnWorkGroup to work and @aws-cdk/custom-resources.AwsCustomResource 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
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,
});
Metadata
Release files for cdk-athena 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cdk-athena-3.0.0.tar.gz | 172.1 kB | Without provenance | Details for cdk-athena-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cdk_athena-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for cdk_athena-3.0.0-py3-none-any.whl |
Total release size: 342.6 kB
Release files / cdk-athena-3.0.0.tar.gz
| Download URL | cdk-athena-3.0.0.tar.gz |
|---|---|
| Size | 172.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e217e16977a4553570314ca3e066336ecde3eb73e713b985299c38d48d7006a2
|
|
BLAKE2b-256 checksum How to use checksums |
8d41a2e6b3038491fefea0736ac7704229581b511addfd2c39e7cfe1945805ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.3
|
Release files / cdk_athena-3.0.0-py3-none-any.whl
| Download URL | cdk_athena-3.0.0-py3-none-any.whl |
|---|---|
| Size | 170.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
736be628e66fcfea9b923ed35cbf16fb9808057ac551169a98a104e7ee0731f5
|
|
BLAKE2b-256 checksum How to use checksums |
eb454a72fc3ad24506a93a4b464679ac15149eed985b1cb29253b6ecf8ea777d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.3
|
Security for cdk-athena 3.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.