The following arguments are supported:
resource "aws_s3_bucket" "hoge" {
bucket = "tf-test"
}
resource "aws_kms_key" "test" {
deletion_window_in_days = 7
description = "Athena KMS Key"
}
resource "aws_athena_workgroup" "test" {
name = "example"
configuration {
result_configuration {
encryption_configuration {
encryption_option = "SSE_KMS"
kms_key_arn = aws_kms_key.test.arn
}
}
}
}
resource "aws_athena_database" "hoge" {
name = "users"
bucket = aws_s3_bucket.hoge.id
}
resource "aws_athena_named_query" "foo" {
name = "bar"
workgroup = aws_athena_workgroup.test.id
database = aws_athena_database.hoge.name
query = "SELECT * FROM ${aws_athena_database.hoge.name} limit 10;"
}
create-named-query
--name <value>
[--description <value>]
--database <value>
--query-string <value>
[--client-request-token <value>]
[--work-group <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
aws athena create-named-query \
--name "SEA to JFK delayed flights Jan 2016" \
--description "Both arrival and departure delayed more than 10 minutes." \
--database sampledb \
--query-string "SELECT flightdate, carrier, flightnum, origin, dest, depdelayminutes, arrdelayminutes FROM sampledb.flights_parquet WHERE yr = 2016 AND month = 1 AND origin = '\"SEA\"' AND dest = '\"JFK\"' AND depdelayminutes > 10 AND arrdelayminutes > 10" \
--work-group AthenaAdmin
--
Categorized by Availability, Security & Compliance and Cost