Skip to content

Commit 87819d1

Browse files
authored
chore: Update Release to use token (#347)
1 parent caaabdc commit 87819d1

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

cfn/release.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Resources:
188188
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-CI-xjAvTM",
189189
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-CI-Credentials-eBrSNB",
190190
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Github/aws-crypto-tools-ci-bot-AGUB3U",
191-
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Sonatype-Team-Account-0tWvZm",
191+
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Sonatype-User-Token-zK61bM",
192192
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-Release-haLIjZ",
193193
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-Release-Credentials-WgJanS"
194194
],
@@ -214,7 +214,7 @@ Resources:
214214
"arn:aws:kms:*:658956600833:alias/*"
215215
],
216216
"Action": [
217-
"kms:Encrypt",
217+
"kms:Encrypt",
218218
"kms:Decrypt",
219219
"kms:GenerateDataKey"
220220
]
@@ -308,25 +308,26 @@ Resources:
308308
S3ECReleaseTestKMSKeyPolicy:
309309
Type: 'AWS::IAM::ManagedPolicy'
310310
Properties:
311+
ManagedPolicyName: S3EC-Release-Test-KMS-Key-Policy
311312
PolicyDocument:
312313
Version: "2012-10-17"
313314
Statement:
314315
- Effect: "Allow"
315316
Resource:
316-
- Sub! "arn:aws:kms:*:${AWS::AccountId}:key/${S3ECReleaseTestingKMSKeyID}"
317-
- Sub! "arn:aws:kms:*:${AWS::AccountId}:${S3ECReleaseKMSKeyAlias}"
317+
- !Sub "arn:aws:kms:*:${AWS::AccountId}:key/${S3ECReleaseTestingKMSKeyID}"
318+
- !Sub "arn:aws:kms:*:${AWS::AccountId}:${S3ECReleaseKMSKeyAlias}"
318319
Action:
319320
- "kms:Encrypt"
320321
- "kms:Decrypt"
321322
- "kms:GenerateDataKey"
322323
- "kms:GenerateDataKeyPair"
324+
# This effect may need to be commented out for a new deployment.
325+
# There is a relationship between the alternate role,
326+
# and the Codebuild service role.
327+
# By turning this into a 2-stage deployment, this simplifies things.
323328
- Effect: Allow
324329
Action: sts:AssumeRole
325-
Resource:
326-
Fn::GetAtt: [ S3ECReleaseTestRoleAlternate, Arn ]
327-
328-
329-
ManagedPolicyName: S3EC-Release-Test-KMS-Key-Policy
330+
Resource: !Sub "arn:aws:iam::${AWS::AccountId}:role/service-role/S3EC-Release-test-role-alternate"
330331

331332
S3ECReleaseKMSKeyPolicyAlternate:
332333
Type: 'AWS::IAM::ManagedPolicy'
@@ -360,7 +361,7 @@ Resources:
360361
Statement:
361362
- Effect: "Allow"
362363
Principal:
363-
Service: codebuild.amazonaws.com
364+
AWS: !GetAtt CodeBuildServiceRoleRelease.Arn
364365
Action:
365366
- "sts:AssumeRole"
366367
Description: >-

codebuild/release/release-prod.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ env:
1010
secrets-manager:
1111
GPG_KEY: Maven-GPG-Keys-Release-Credentials:Keyname
1212
GPG_PASS: Maven-GPG-Keys-Release-Credentials:Passphrase
13-
SONA_USERNAME: Sonatype-Team-Account:Username
14-
SONA_PASSWORD: Sonatype-Team-Account:Password
13+
SONA_USERNAME: Sonatype-User-Token:username
14+
SONA_PASSWORD: Sonatype-User-Token:password
1515

1616
phases:
1717
install:

0 commit comments

Comments
 (0)