GithubHelp home page GithubHelp logo

dbt-athena / dbt-athena-infra Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 14 KB

AWS infrastructure for dbt-athena automated and integration testing

Makefile 4.06% JavaScript 8.28% TypeScript 87.66%

dbt-athena-infra's Introduction

dbt-athena-infra

AWS infrastructure for dbt-athena automated and integration testing.

This is currently deployed on an AWS Account which is under the direct responsibility of @mattiamatrix.

dbt-athena-infra's People

Contributors

mattiamatrix avatar nicor88 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dbt-athena-infra's Issues

No role to ensure dbt-athena works against restrictive permissions

Re: dbt-athena/dbt-athena#302

This issue lays out a more restrictive permissions setup for Athena that does not allow direct access to S3. I've created an IAM Role & Policy that captures what I think those permissions are. Besides documentation, running a applicable subset of the functional tests against this role should give much greater confidence that the functionality works in the real world.

Resources:
  DbtRestrictiveRole:
    Type: AWS::IAM::Role
    Properties:
      RoleName: DbtAthenaRestricted
      AssumeRolePolicyDocument: {
          "Version" : "2012-10-17",
          "Statement": [ {
            "Effect": "Allow",
            "Principal": {
                "AWS": !Join [ ":", ["arn", "aws", "iam", "", !Ref "AWS::AccountId", "root"]]
            },
            "Action": [ "sts:AssumeRole" ]
          } ]
      }
      Description: Minimal permissions policy to run dbt-athena
      Policies:
        - PolicyName: DbtRestrictive
          PolicyDocument: {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Action": [
                        "athena:ListDataCatalogs",
                        "athena:GetDataCatalog",
                        "athena:ListDatabases",
                        "athena:GetDatabase",
                        "athena:StartQueryExecution",
                        "athena:StopQueryExecution",
                        "athena:GetQueryExecution",
                        "athena:GetQueryResults",
                        "athena:GetWorkGroup",
                        "athena:BatchGetQueryExecution"
                    ],
                    "Effect": "Allow",
                    "Resource": "*",
                    "Sid": "AthenaPermissions"
                },
                {
                    "Action": [
                        "glue:CreateTable",
                        "glue:UpdateTable",
                        "glue:DeleteTable",
                        "glue:GetDatabases",
                        "glue:GetDatabase",
                        "glue:GetTable",
                        "glue:GetTables"
                    ],
                    "Effect": "Allow",
                    "Resource": "*",
                    "Sid": "GlueAthenaPermissions"
                },
                {
                    "Action": [
                        "glue:CreateDatabase",
                        "glue:DeleteDatabase"
                    ],
                    "Effect": "Allow",
                    "Resource": "*",
                    "Sid": "FuncTestPermissions"
                },
                {
                    "Action": [
                        "s3:ListBucket",
                        "s3:GetBucketLocation",
                        "s3:GetObject",
                        "s3:ListBucketMultipartUploads",
                        "s3:ListMultipartUploadParts",
                        "s3:AbortMultipartUpload",
                        "s3:PutObject",
                        "s3:DeleteObject"
                    ],
                    "Effect": "Allow",
                    "Resource": "*",
                    "Sid": "S3ViaAthenaPermissions",
                    "Condition": {
                        "ForAnyValue:StringEquals": {
                            "aws:CalledVia": "athena.amazonaws.com"
                        }
                    }
                }
            ]
        }

Add spark work group

Description

Add a spark work group in the same catalog as the current work group that executes functional tests.

Additional information

Preferred name of the work group: spark
Preferred engine config: lowest possible
Preferred session timeout: 1 hour.

Note: Do not create them in multiple catalogs since Athena spark does not have multi catalog support yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.