Skip to content

chore(CFN): Changes for TestVectors #653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Mar 20, 2024
54 changes: 52 additions & 2 deletions cfn/ESDK-Python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ Resources:
ReportBuildStatus: false
Type: "GITHUB"
Artifacts:
Type: "NO_ARTIFACTS"
Type: "S3"
Location: !GetAtt GeneratedVectorsArtifactsS3Bucket.BucketName
Name: "/"
Cache:
Type: "NO_CACHE"
Environment:
Expand Down Expand Up @@ -175,6 +177,7 @@ Resources:
- !Ref CodeBuildBasePolicy
- !Ref SecretsManagerPolicy
- !Ref CodeBuildCISTSAllow
- !Ref GeneratedVectorsArtifactsS3BucketPolicy

CodeBuildCIServiceRole:
Type: "AWS::IAM::Role"
Expand All @@ -187,7 +190,9 @@ Resources:
- !Ref CryptoToolsKMS
- !Ref CodeBuildCIBatchPolicy
- !Ref CodeBuildBasePolicy
- !Ref SecretsManagerCIPolicy
- !Ref CodeBuildCISTSAllow
- !Ref GeneratedVectorsArtifactsS3BucketPolicy

CodeBuildBatchPolicy:
Type: "AWS::IAM::ManagedPolicy"
Expand Down Expand Up @@ -304,7 +309,27 @@ Resources:
"Effect": "Allow",
"Resource": [
"arn:aws:secretsmanager:us-west-2:587316601012:secret:TestPyPiCryptoTools-SxeLBh",
"arn:aws:secretsmanager:us-west-2:587316601012:secret:PyPiAdmin-ZWyd1T"
"arn:aws:secretsmanager:us-west-2:587316601012:secret:PyPiAdmin-ZWyd1T",
"arn:aws:secretsmanager:us-west-2:587316601012:secret:Github/aws-crypto-tools-ci-bot-AGUB3U"
],
"Action": "secretsmanager:GetSecretValue"
}
]
}

SecretsManagerCIPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
ManagedPolicyName: !Sub "CryptoTools-SecretsManagerCI-${ProjectName}-release"
Path: "/service-role/"
PolicyDocument: !Sub |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Resource": [
"arn:aws:secretsmanager:us-west-2:587316601012:secret:Github/aws-crypto-tools-ci-bot-AGUB3U"
],
"Action": "secretsmanager:GetSecretValue"
}
Expand Down Expand Up @@ -358,3 +383,28 @@ Resources:
}
]
}

GeneratedVectorsArtifactsS3Bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: generated-vectors-artifacts-bucket
LifecycleConfiguration:
Rules:
- Id: Expire artifacts in 14 days
Status: Enabled
ExpirationInDays: 14

GeneratedVectorsArtifactsS3BucketPolicy:
Type: 'AWS::IAM::ManagedPolicy'
Properties:
ManagedPolicyName: Generated-Vectors-Artifacts-S3-Bucket-Policy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- 's3:PutObject'
- 's3:GetObject'
- 's3:DeleteObject'
Resource:
- !Join [ "", [ !GetAtt GeneratedVectorsArtifactsS3Bucket.Arn, '/*'] ]
Loading