Skip to content

Commit 9102b21

Browse files
authored
Add column managed_query_results_enabled, managed_query_results_kms_key and enable_minimum_encryption_configuration in table aws_athena_workgroup (#2678)
1 parent f0035fa commit 9102b21

4 files changed

Lines changed: 105 additions & 55 deletions

File tree

aws/table_aws_athena_workgroup.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,27 @@ func tableAwsAthenaWorkGroup(_ context.Context) *plugin.Table {
149149
Hydrate: getAwsAthenaWorkGroup,
150150
Transform: transform.FromField("Configuration.ResultConfiguration.OutputLocation"),
151151
},
152+
{
153+
Name: "managed_query_results_enabled",
154+
Description: "Indicates whether Athena managed query results are enabled. If set to true, allows you to store query results in Athena owned storage.",
155+
Type: proto.ColumnType_BOOL,
156+
Hydrate: getAwsAthenaWorkGroup,
157+
Transform: transform.FromField("Configuration.ManagedQueryResultsConfiguration.Enabled"),
158+
},
159+
{
160+
Name: "managed_query_results_kms_key",
161+
Description: "The KMS key ARN used to encrypt managed query results in Athena owned storage.",
162+
Type: proto.ColumnType_STRING,
163+
Hydrate: getAwsAthenaWorkGroup,
164+
Transform: transform.FromField("Configuration.ManagedQueryResultsConfiguration.EncryptionConfiguration.KmsKey"),
165+
},
166+
{
167+
Name: "enable_minimum_encryption_configuration",
168+
Description: "Enforces a minimal level of encryption for the workgroup.",
169+
Type: proto.ColumnType_BOOL,
170+
Hydrate: getAwsAthenaWorkGroup,
171+
Transform: transform.FromField("Configuration.EnableMinimumEncryptionConfiguration"),
172+
},
152173
}),
153174
}
154175
}

docs/tables/aws_athena_workgroup.md

Lines changed: 81 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -18,98 +18,127 @@ The `aws_athena_workgroup` table in Steampipe provides you with information abou
1818
Explore the various workgroups within your AWS Athena service to gain insights into their basic details such as name, description, and creation time. This can be useful for understanding your workgroup configuration and identifying any potential areas for optimization or reorganization.
1919

2020
```sql+postgres
21-
select
22-
name,
23-
description,
24-
effective_engine_version,
25-
output_location,
26-
creation_time
27-
from
28-
aws_athena_workgroup
29-
order by
21+
select
22+
name,
23+
description,
24+
effective_engine_version,
25+
output_location,
26+
creation_time
27+
from
28+
aws_athena_workgroup
29+
order by
3030
creation_time;
3131
```
3232

3333
```sql+sqlite
34-
select
35-
name,
36-
description,
37-
effective_engine_version,
38-
output_location,
39-
creation_time
40-
from
41-
aws_athena_workgroup
42-
order by
34+
select
35+
name,
36+
description,
37+
effective_engine_version,
38+
output_location,
39+
creation_time
40+
from
41+
aws_athena_workgroup
42+
order by
4343
creation_time;
4444
```
4545

4646
### List all workgroups using engine 3
4747
Determine the areas in which workgroups are utilizing a specific version of the Athena engine. This is useful for assessing upgrade needs or understanding the distribution of engine versions across your workgroups.
4848

4949
```sql+postgres
50-
select
51-
name,
52-
description
53-
from
54-
aws_athena_workgroup
55-
where
50+
select
51+
name,
52+
description
53+
from
54+
aws_athena_workgroup
55+
where
5656
effective_engine_version = 'Athena engine version 3';
5757
```
5858

5959
```sql+sqlite
60-
select
61-
name,
62-
description
63-
from
64-
aws_athena_workgroup
65-
where
60+
select
61+
name,
62+
description
63+
from
64+
aws_athena_workgroup
65+
where
6666
effective_engine_version = 'Athena engine version 3';
6767
```
6868

6969
### Count workgroups in each region
7070
Assess the distribution of workgroups across different regions to understand workload allocation and capacity planning. This can assist in identifying regions that may be under or over-utilized.
7171

7272
```sql+postgres
73-
select
74-
region,
75-
count(*)
76-
from
77-
aws_athena_workgroup
78-
group by
73+
select
74+
region,
75+
count(*)
76+
from
77+
aws_athena_workgroup
78+
group by
7979
region;
8080
```
8181

8282
```sql+sqlite
83-
select
84-
region,
85-
count(*)
86-
from
87-
aws_athena_workgroup
88-
group by
83+
select
84+
region,
85+
count(*)
86+
from
87+
aws_athena_workgroup
88+
group by
8989
region;
9090
```
9191

9292
### List disabled workgroups
9393
Determine the areas in which workgroups are inactive, providing insights into resource usage and potential areas for optimization or re-allocation.
9494

9595
```sql+postgres
96-
select
97-
name,
98-
description,
96+
select
97+
name,
98+
description,
9999
creation_time
100-
from
101-
aws_athena_workgroup
100+
from
101+
aws_athena_workgroup
102102
where
103103
state = 'DISABLED';
104104
```
105105

106106
```sql+sqlite
107-
select
108-
name,
109-
description,
107+
select
108+
name,
109+
description,
110110
creation_time
111-
from
112-
aws_athena_workgroup
111+
from
112+
aws_athena_workgroup
113113
where
114114
state = 'DISABLED';
115+
```
116+
117+
### List workgroups without encryption at rest
118+
Detect workgroups that are not encrypting query results at rest so you can remediate resources that violate the AWS Config rule `athena-workgroup-encrypted-at-rest`.
119+
120+
```sql+postgres
121+
select
122+
name,
123+
region,
124+
encryption_option,
125+
result_configuration_kms_key
126+
from
127+
aws_athena_workgroup
128+
where
129+
encryption_option is null
130+
or encryption_option = '';
131+
```
132+
133+
```sql+sqlite
134+
select
135+
name,
136+
region,
137+
encryption_option,
138+
result_configuration_kms_key
139+
from
140+
aws_athena_workgroup
141+
where
142+
encryption_option is null
143+
or encryption_option = '';
115144
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/aws/aws-sdk-go-v2/service/apprunner v1.28.8
2222
github.com/aws/aws-sdk-go-v2/service/appstream v1.34.4
2323
github.com/aws/aws-sdk-go-v2/service/appsync v1.47.4
24-
github.com/aws/aws-sdk-go-v2/service/athena v1.40.4
24+
github.com/aws/aws-sdk-go-v2/service/athena v1.55.9
2525
github.com/aws/aws-sdk-go-v2/service/auditmanager v1.32.4
2626
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.5
2727
github.com/aws/aws-sdk-go-v2/service/backup v1.34.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ github.com/aws/aws-sdk-go-v2/service/appstream v1.34.4 h1:chEtg7jpLbd+wzNEZR5Y7i
676676
github.com/aws/aws-sdk-go-v2/service/appstream v1.34.4/go.mod h1:ornvkYF5+PhIhj13BZGWGlZyltIkYqfoPtmAnOdSORA=
677677
github.com/aws/aws-sdk-go-v2/service/appsync v1.47.4 h1:E60+xhcNh0s1M237SMIEozbjU0KHbeDXNPKuiq1o2PM=
678678
github.com/aws/aws-sdk-go-v2/service/appsync v1.47.4/go.mod h1:Sg7FbRUyjrTkbZRa62XjvTQJP3lEeEsRYBxdiKf8ZEY=
679-
github.com/aws/aws-sdk-go-v2/service/athena v1.40.4 h1:tiHIjFXSyb5DbNfnu3ql2r86s6llLdzwWAVJkPgw/I0=
680-
github.com/aws/aws-sdk-go-v2/service/athena v1.40.4/go.mod h1:6OHesqDfYPNzYI+VaXtmylYLyppuUy9SwRk4CH/pQA4=
679+
github.com/aws/aws-sdk-go-v2/service/athena v1.55.9 h1:w50cPLPIyWSzh4bqgA/h0nzRw1rnNBKfxeElfKBLON4=
680+
github.com/aws/aws-sdk-go-v2/service/athena v1.55.9/go.mod h1:jTVF/+wNGjLD94jaJxDqhWexDeH7r4zZkQ7bbboAf1I=
681681
github.com/aws/aws-sdk-go-v2/service/auditmanager v1.32.4 h1:45+KYpnG8ZKoqLkQSIg8hnU52rbBRyIYHqaSf+02P3I=
682682
github.com/aws/aws-sdk-go-v2/service/auditmanager v1.32.4/go.mod h1:WHURzIps29VZSUz9jxpGeShOhGuf/SqQmNJLs3Ytfns=
683683
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.5 h1:vhdJymxlWS2qftzLiuCjSswjXBRLGfzo/BEE9LDveBA=

0 commit comments

Comments
 (0)