An open API service indexing awesome lists of open source software.

https://github.com/dod-iac/terraform-aws-athena-iam-policy

IAM Policy that allows use of AWS Athena
https://github.com/dod-iac/terraform-aws-athena-iam-policy

athena aws iam terraform

Last synced: 7 months ago
JSON representation

IAM Policy that allows use of AWS Athena

Awesome Lists containing this project

README

          

## Usage

Creates an IAM policy that allows use of AWS Athena.

```hcl
module "athena_iam_policy" {
source = "dod-iac/athena-iam-policy/aws"

databases = [aws_glue_catalog_database.main.arn]
name = format("%s-athena-user-%s", var.application, var.environment)
result_buckets = [aws_s3_bucket.results.arn]
require_mfa = true
source_buckets = [aws_s3_bucket.source.arn]
source_keys = ["*"]
workgroups = [aws_athena_workgroup.main.arn]
}
```

## Terraform Version

Terraform 0.13. Pin module version to ~> 1.0.0 . Submit pull-requests to master branch.

Terraform 0.11 and 0.12 are not supported.

## License

This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. However, because the project utilizes code licensed from contributors and other third parties, it therefore is licensed under the MIT License. See LICENSE file for more information.

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.12 |
| [aws](#requirement\_aws) | >= 2.55.0 |

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 2.55.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_iam_policy.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_account_alias.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_account_alias) | data source |
| [aws_iam_policy_document.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [allow\_delete\_named\_query](#input\_allow\_delete\_named\_query) | If true, allows the deletion of named queries. | `bool` | `false` | no |
| [databases](#input\_databases) | The ARNs of the databases that can be used. Use ["*"] to allow all databases. | `list(string)` | n/a | yes |
| [description](#input\_description) | The description of the AWS IAM policy. Defaults to "The policy for [NAME]." | `string` | `""` | no |
| [name](#input\_name) | The name of the AWS IAM policy. | `string` | n/a | yes |
| [require\_mfa](#input\_require\_mfa) | If true, actions require multi-factor authentication. | `string` | n/a | yes |
| [result\_buckets](#input\_result\_buckets) | The ARNs of the AWS S3 buckets the store the results of the Athena queries. Use ["*"] to allow all buckets. | `list(string)` | n/a | yes |
| [source\_buckets](#input\_source\_buckets) | The ARNs of the AWS S3 buckets that store the source data. Use ["*"] to allow all buckets. | `list(string)` | n/a | yes |
| [source\_keys](#input\_source\_keys) | The ARNs of the AWS KMS keys that can be used to decrypt source data files. Use ["*"] to allow all keys. | `list(string)` | `[]` | no |
| [workgroups](#input\_workgroups) | The ARNs of the AWS Athena workgroups that can be used. Use ["*"] to allow all workgroups. | `list(string)` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| [arn](#output\_arn) | The Amazon Resource Name (ARN) of the AWS IAM policy. |
| [id](#output\_id) | The id of the AWS IAM policy. |
| [name](#output\_name) | The name of the AWS IAM policy. |