|
| 1 | + |
| 2 | +GlueScriptsExecutionRole: |
| 3 | + Type: AWS::IAM::Role |
| 4 | + Properties: |
| 5 | + RoleName: !Sub ${Environment}-dap-glue-scripts-execution-role |
| 6 | + AssumeRolePolicyDocument: |
| 7 | + Version: 2012-10-17 |
| 8 | + Statement: |
| 9 | + - Effect: Allow |
| 10 | + Principal: |
| 11 | + Service: |
| 12 | + - glue.amazonaws.com |
| 13 | + Action: |
| 14 | + - sts:AssumeRole |
| 15 | + Path: / |
| 16 | + Policies: |
| 17 | + - PolicyName: !Sub ${Environment}-dap-glue-scripts-execution-policy |
| 18 | + PolicyDocument: |
| 19 | + Version: 2012-10-17 |
| 20 | + Statement: |
| 21 | + - Effect: Allow |
| 22 | + Resource: arn:aws:s3:::* |
| 23 | + Action: |
| 24 | + - s3:Get* |
| 25 | + - s3:Put* |
| 26 | + - s3:List* |
| 27 | + - s3:ListBucketMultipartUploads |
| 28 | + - s3:AbortMultipartUpload |
| 29 | + - s3:CreateBucket |
| 30 | + - s3:ListBucket |
| 31 | + - s3:GetBucketLocation |
| 32 | + - s3:ListMultipartUploadParts |
| 33 | + |
| 34 | + - Effect: Allow |
| 35 | + Resource: arn:aws:logs:*:*:* |
| 36 | + Action: |
| 37 | + - logs:CreateLogGroup |
| 38 | + - logs:CreateLogStream |
| 39 | + - logs:PutLogEvents |
| 40 | + - logs:CreateLogDelivery |
| 41 | + - logs:GetLogDelivery |
| 42 | + - logs:UpdateLogDelivery |
| 43 | + - logs:DeleteLogDelivery |
| 44 | + - logs:ListLogDeliveries |
| 45 | + - logs:PutResourcePolicy |
| 46 | + - logs:DescribeResourcePolicies |
| 47 | + - logs:DescribeLogGroups |
| 48 | + - logs:AssociateKmsKey |
| 49 | + |
| 50 | + - Effect: Allow |
| 51 | + Resource: '*' |
| 52 | + Action: |
| 53 | + - athena:GetTableMetadata |
| 54 | + - athena:ListEngineVersions |
| 55 | + - athena:ListDataCatalogs |
| 56 | + - athena:ListDatabases |
| 57 | + - athena:GetDatabase |
| 58 | + - athena:ListTableMetadata |
| 59 | + - athena:ListWorkGroups |
| 60 | + |
| 61 | + - Effect: Allow |
| 62 | + Resource: |
| 63 | + - !Sub 'arn:aws:athena:${AWS::Region}:${AWS::AccountId}:workgroup/${Environment}-dap-txma-processing' |
| 64 | + - !Sub 'arn:aws:athena:${AWS::Region}:${AWS::AccountId}:workgroup/primary' |
| 65 | + - !Sub 'arn:aws:athena:${AWS::Region}:${AWS::AccountId}:datacatalog/*' |
| 66 | + Action: |
| 67 | + - athena:CreatePreparedStatement |
| 68 | + - athena:StartQueryExecution |
| 69 | + - athena:GetQueryResultsStream |
| 70 | + - athena:UpdatePreparedStatement |
| 71 | + - athena:GetQueryResults |
| 72 | + - athena:DeletePreparedStatement |
| 73 | + - athena:DeleteNamedQuery |
| 74 | + - athena:GetNamedQuery |
| 75 | + - athena:GetPreparedStatement |
| 76 | + - athena:ListQueryExecutions |
| 77 | + - athena:ListNamedQueries |
| 78 | + - athena:GetWorkGroup |
| 79 | + - athena:CreateNamedQuery |
| 80 | + - athena:StopQueryExecution |
| 81 | + - athena:GetQueryExecution |
| 82 | + - athena:BatchGetNamedQuery |
| 83 | + - athena:ListPreparedStatements |
| 84 | + - athena:BatchGetQueryExecution |
| 85 | + - athena:getDataCatalog |
| 86 | + |
| 87 | + - Effect: Allow |
| 88 | + Resource: |
| 89 | + - !Sub 'arn:aws:glue:${AWS::Region}:${AWS::AccountId}:catalog' |
| 90 | + - !Sub 'arn:aws:glue:${AWS::Region}:${AWS::AccountId}:database/*' |
| 91 | + - !Sub 'arn:aws:glue:${AWS::Region}:${AWS::AccountId}:table/*' |
| 92 | + Action: |
| 93 | + - glue:CreateDatabase |
| 94 | + - glue:GetDatabase |
| 95 | + - glue:GetDatabases |
| 96 | + - glue:UpdateDatabase |
| 97 | + - glue:DeleteDatabase |
| 98 | + - glue:CreateTable |
| 99 | + - glue:UpdateTable |
| 100 | + - glue:GetTable |
| 101 | + - glue:GetTables |
| 102 | + - glue:DeleteTable |
| 103 | + - glue:BatchDeleteTable |
| 104 | + - glue:BatchCreatePartition |
| 105 | + - glue:CreatePartition |
| 106 | + - glue:UpdatePartition |
| 107 | + - glue:GetPartition |
| 108 | + - glue:GetPartitions |
| 109 | + - glue:BatchGetPartition |
| 110 | + - glue:DeletePartition |
| 111 | + - glue:BatchDeletePartition |
| 112 | + |
| 113 | + - Effect: Allow |
| 114 | + Resource: |
| 115 | + - !Sub 'arn:aws:redshift-serverless:${AWS::Region}:${AWS::AccountId}:workgroup/*' |
| 116 | + Action: |
| 117 | + - redshift-data:BatchExecuteStatement |
| 118 | + - redshift-data:ExecuteStatement |
| 119 | + - redshift-serverless:GetCredentials |
| 120 | + |
| 121 | + - Effect: Allow |
| 122 | + Resource: |
| 123 | + - '*' |
| 124 | + Action: |
| 125 | + - redshift-data:GetStatementResult |
| 126 | + - redshift-data:DescribeStatement |
| 127 | + - redshift-data:ListStatements |
| 128 | + |
| 129 | + - Effect: Allow |
| 130 | + Resource: |
| 131 | + - '*' |
| 132 | + Action: |
| 133 | + - kms:* |
| 134 | + |
| 135 | + - Effect: Allow |
| 136 | + Resource: |
| 137 | + - '*' |
| 138 | + Action: |
| 139 | + - glue:GetConnection |
| 140 | + |
| 141 | + - Effect: Allow |
| 142 | + Resource: |
| 143 | + - '*' |
| 144 | + Action: |
| 145 | + - ec2:Describe* |
| 146 | + |
| 147 | + - Effect: Allow |
| 148 | + Resource: |
| 149 | + - '*' |
| 150 | + Action: |
| 151 | + - ec2:CreateNetworkInterface |
| 152 | + - ec2:Describe* |
| 153 | + - ec2:AssignPrivateIpAddresses |
| 154 | + - ec2:UnassignPrivateIpAddresses |
| 155 | + - ec2:CreateTags |
| 156 | + - secretsmanager:GetSecretValue |
| 157 | + |
| 158 | + - Effect: Allow |
| 159 | + Resource: |
| 160 | + - '*' |
| 161 | + Action: |
| 162 | + - glue:GetSecurityConfiguration |
| 163 | + |
| 164 | +RawStageTransformProcessPythonGlueJob: |
| 165 | + Type: AWS::Glue::Job |
| 166 | + Properties: |
| 167 | + Command: |
| 168 | + Name: pythonshell |
| 169 | + PythonVersion: '3.9' |
| 170 | + ScriptLocation: !Sub s3://some_bucket/txma/raw_to_stage/raw_to_stage_process_glue_job.py |
| 171 | + DefaultArguments: |
| 172 | + '--JOB_NAME': !Sub ${Environment}-dap-raw-stage-transform-process |
| 173 | + '--LOG_LEVEL': 'INFO' |
| 174 | + '--additional-python-modules': 'awswrangler,aws_lambda_powertools' |
| 175 | + '--config_bucket': 'some_bucket' |
| 176 | + '--config_key_path': 'txma/raw_stage_optimisation_solution/configuration_rules/raw_to_stage_config_rules.json' |
| 177 | + '--raw_database': !Sub ${Environment}-txma-raw |
| 178 | + '--raw_source_table': 'txma-refactored' |
| 179 | + '--stage_bucket': some_bucket |
| 180 | + '--stage_database': !Sub ${Environment}-txma-stage |
| 181 | + '--stage_target_table': 'txma_stage_layer' |
| 182 | + '--stage_target_key_value_table': 'txma_stage_layer_key_values' |
| 183 | + '--txma_raw_dedup_view_key_path': 'txma/raw_stage_optimisation_solution/athena_db_object/txma_raw_dedup_view.sql' |
| 184 | + '--workgroup': !Sub ${Environment}-dap-txma-processing |
| 185 | + '--TempDir': s3://some_buckett/raw_stage_optimisation_processing/temporary/ |
| 186 | + 'library-set': 'analytics' |
| 187 | + '--extra-py-files': 'some_bucket/txma/raw_to_stage/raw_to_stage_etl_modules-0.1.0-py3-none-any.whl' |
| 188 | + ExecutionProperty: |
| 189 | + MaxConcurrentRuns: 1 |
| 190 | + MaxRetries: 0 |
| 191 | + MaxCapacity: 1 |
| 192 | + Name: !Sub ${Environment}-dap-raw-stage-transform-process |
| 193 | + Role: !Ref GlueScriptsExecutionRole |
0 commit comments