Skip to content

Commit

Permalink
Merge pull request #311 from Sage-Bionetworks-Workflows/WORKFLOWS-549…
Browse files Browse the repository at this point in the history
…-remove-IAMusers

[Workflows-549] Using IAM role in Tower to authenticate AWS services
  • Loading branch information
thomasyu888 authored Jun 10, 2024
2 parents da05be2 + 80dd558 commit ee14403
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bin/configure-tower-projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,16 +528,15 @@ def create_credentials(self) -> int:
assert cred["deleted"] is None
return cred["id"]
# Otherwise, create a new credentials entry for the project
secret_arn = self.stack["TowerForgeServiceUserAccessKeySecretArn"]
secret_arn = self.stack["TowerRoleArn"]
credentials = self.org.aws.get_secret_value(secret_arn)
data = {
"credentials": {
"name": self.stack_name,
"provider": "aws",
"keys": {
"accessKey": credentials["aws_access_key_id"],
"secretKey": credentials["aws_secret_access_key"],
"assumeRoleArn": self.stack["TowerForgeServiceRoleArn"],
"assumeRoleArn": self.stack["TowerRoleArn"],
},
"description": f"Credentials for {self.stack_name}",
}
Expand Down
3 changes: 3 additions & 0 deletions templates/tower-project.j2
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ Resources:
- !GetAtt TowerForgeBatchHeadJobRole.Arn
- !GetAtt TowerForgeBatchWorkJobRole.Arn
- !GetAtt TowerForgeServiceRole.Arn
- !GetAtt TowerRole.Arn
- !Join
- ","
- !Ref AccountAdminArns
Expand Down Expand Up @@ -374,6 +375,7 @@ Resources:
- !GetAtt TowerForgeServiceRole.Arn
- !GetAtt TowerForgeBatchHeadJobRole.Arn
- !GetAtt TowerForgeBatchWorkJobRole.Arn
- !GetAtt TowerRole.Arn
Action:
- "s3:GetBucketLocation"
- "s3:ListBucket"
Expand Down Expand Up @@ -511,6 +513,7 @@ Resources:
- !GetAtt TowerForgeServiceRole.Arn
- !GetAtt TowerForgeBatchHeadJobRole.Arn
- !GetAtt TowerForgeBatchWorkJobRole.Arn
- !GetAtt TowerRole.Arn
Action:
- "s3:GetBucketLocation"
- "s3:ListBucket"
Expand Down

0 comments on commit ee14403

Please sign in to comment.