Skip to content

Commit

Permalink
Fix hard coded AWS Partition
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulRehman Faraj committed Jan 22, 2025
1 parent 9f4b464 commit 0cb37e0
Show file tree
Hide file tree
Showing 41 changed files with 74 additions and 74 deletions.
4 changes: 2 additions & 2 deletions athena-aws-cmdb/athena-aws-cmdb-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -137,6 +137,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
2 changes: 1 addition & 1 deletion athena-clickhouse/athena-clickhouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down
4 changes: 2 additions & 2 deletions athena-cloudera-hive/athena-cloudera-hive-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -160,6 +160,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-cloudera-impala/athena-cloudera-impala-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -160,6 +160,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -131,6 +131,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-cloudwatch/athena-cloudwatch-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -135,6 +135,6 @@ Resources:
- Action:
- kms:GenerateDataKey
Effect: Allow
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-cloudwatch/athena-cloudwatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Resources:
Properties:
PermissionsBoundary: !If [ HasPermissionsBoundary, !Ref PermissionsBoundaryARN, !Ref "AWS::NoValue" ]
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -150,6 +150,6 @@ Resources:
- Action:
- kms:GenerateDataKey
Effect: Allow
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KMSKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KMSKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-datalakegen2/athena-datalakegen2-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -168,6 +168,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-db2-as400/athena-db2-as400-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -169,6 +169,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-db2/athena-db2-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -169,6 +169,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-docdb/athena-docdb-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -159,6 +159,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-dynamodb/athena-dynamodb-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -142,6 +142,6 @@ Resources:
- Action:
- kms:GenerateDataKey
Effect: Allow
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-dynamodb/athena-dynamodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Resources:
Properties:
PermissionsBoundary: !If [ HasPermissionsBoundary, !Ref PermissionsBoundaryARN, !Ref "AWS::NoValue" ]
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -156,6 +156,6 @@ Resources:
- Action:
- kms:GenerateDataKey
Effect: Allow
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KMSKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KMSKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-elasticsearch/athena-elasticsearch-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -170,6 +170,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-gcs/athena-gcs-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -149,6 +149,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-google-bigquery/athena-google-bigquery-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -167,6 +167,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
4 changes: 2 additions & 2 deletions athena-hbase/athena-hbase-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -159,6 +159,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -166,6 +166,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
2 changes: 1 addition & 1 deletion athena-kafka/athena-kafka.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Resources:
Properties:
PermissionsBoundary: !If [ HasPermissionsBoundary, !Ref PermissionsBoundaryARN, !Ref "AWS::NoValue" ]
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down
4 changes: 2 additions & 2 deletions athena-msk/athena-msk-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -158,6 +158,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
2 changes: 1 addition & 1 deletion athena-msk/athena-msk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Resources:
Properties:
PermissionsBoundary: !If [ HasPermissionsBoundary, !Ref PermissionsBoundaryARN, !Ref "AWS::NoValue" ]
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down
4 changes: 2 additions & 2 deletions athena-mysql/athena-mysql-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -162,6 +162,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
2 changes: 1 addition & 1 deletion athena-mysql/athena-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down
4 changes: 2 additions & 2 deletions athena-neptune/athena-neptune-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
Expand Down Expand Up @@ -163,6 +163,6 @@ Resources:
- Effect: Allow
Action:
- kms:GenerateDataKey
Resource: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Resource: !Sub "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${KmsKeyId}"
Roles:
- !Ref FunctionRole
Loading

0 comments on commit 0cb37e0

Please sign in to comment.