Skip to content
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

Master into development #1978

Merged
merged 27 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
06f2309
DROTH-3228 add missing webhook
sasuolanderSito May 3, 2022
207fb18
Merge pull request #1961 from finnishtransportagency/DROTH-3228_fix_p…
sasuolanderSito May 3, 2022
471bb2b
DROTH-3214 Batch system divided for prod and dev account. Added Cloud…
anttiahopeltositowise May 6, 2022
dd60d3d
DROTH-3214 Added instructions for creating stacks
anttiahopeltositowise May 6, 2022
e733faa
DROTH-3214 Divided pipeline into two. Added tags, added instructions …
anttiahopeltositowise May 11, 2022
dfd1048
DROTH-3214 Added owner and project tags, added event rule for Refresh…
anttiahopeltositowise May 11, 2022
4111747
DROTH-3214 Added missing ApplicationName parameter and Tag
anttiahopeltositowise May 11, 2022
0818834
DROTH-3214 Changed parameter names
anttiahopeltositowise May 12, 2022
1e6b50b
DROTH-3214 Fixed yaml syntax errors in lambda pipeline
anttiahopeltositowise May 12, 2022
8524f81
DROTH-3214 Fixed yaml syntax errors in batch system, added SecurityGr…
anttiahopeltositowise May 16, 2022
19cd6d9
DROTH-3214 Fixed pipeline permissions
anttiahopeltositowise May 16, 2022
0b6d370
DROTH-3214 New function name for lambda
anttiahopeltositowise May 16, 2022
331bb14
DROTH-3214 fix prod pipeline YAML, add artifact store
anttiahopeltositowise May 16, 2022
dd38ad3
DROTH-3214 add parameters to prod deployment bucket, fix YAML
anttiahopeltositowise May 16, 2022
1121eb4
Merge pull request #1962 from finnishtransportagency/DROTH-3214_run_p…
anttiahopeltositowise May 17, 2022
0468daa
DROTH-3214 added --parameters to S3 creation guide, renamed parameter
anttiahopeltositowise May 17, 2022
4671d28
DROTH-3214 fix params
anttiahopeltositowise May 17, 2022
e7c1435
Merge pull request #1966 from finnishtransportagency/DROTH-3214_run_p…
anttiahopeltositowise May 17, 2022
1839b58
DROTH-3259 enable caching QA job definition
anttiahopeltositowise May 17, 2022
fc6933a
DROTH-3259 also enable caching prod job definition
anttiahopeltositowise May 17, 2022
7e217a4
Merge pull request #1968 from finnishtransportagency/DROTH_3259_enabl…
anttiahopeltositowise May 17, 2022
dfc4c2b
DROTH-3198 Fixed roleArn in job definitions to correct new arn. Fixed…
anttiahopeltositowise May 18, 2022
9cb33da
DROTH-3198 included fix in batchSystem.yaml
anttiahopeltositowise May 18, 2022
489c68b
Merge pull request #1971 from finnishtransportagency/DROTH-3214_run_p…
anttiahopeltositowise May 18, 2022
5a66df3
DROTH-3214 Fixed JobDefinition
anttiahopeltositowise May 19, 2022
e271f4a
Merge pull request #1975 from finnishtransportagency/DROTH-3214_run_p…
anttiahopeltositowise May 19, 2022
2ea9589
Merge branch 'development' into MasterIntoDevelopment
sasuolanderSito May 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws/cloud-formation/batchSystem/DEVbatchJobDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"value": "4"
}
],
"executionRoleArn": "arn:aws:iam::475079312496:role/batchSystem-BatchTaskRole-GSUD7E3H8KV4",
"executionRoleArn": "arn:aws:iam::475079312496:role/DEV-batchSystem-BatchTaskRole-VGL42N9TANTI",
"environment": [
{
"name": "containerCPU",
Expand Down
14 changes: 7 additions & 7 deletions aws/cloud-formation/batchSystem/ProdBatchJobDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"FARGATE"
],
"containerProperties": {
"image": "475079312496.dkr.ecr.eu-west-1.amazonaws.com/digiroad2:prod",
"image": "920408837790.dkr.ecr.eu-west-1.amazonaws.com/digiroad2:prod",
"resourceRequirements" : [
{
"type": "MEMORY",
Expand All @@ -22,7 +22,7 @@
"value": "4"
}
],
"executionRoleArn": "arn:aws:iam::475079312496:role/batchSystem-BatchTaskRole-GSUD7E3H8KV4",
"executionRoleArn": "arn:aws:iam::920408837790:role/digiroad-batch-system-BatchTaskRole-NTGCBVRU7CCR",
"environment": [
{
"name": "containerCPU",
Expand Down Expand Up @@ -106,7 +106,7 @@
},
{
"name": "caching",
"value": "false"
"value": "true"
},
{
"name": "cacheHostname",
Expand All @@ -130,19 +130,19 @@
"secrets": [
{
"name": "bonecp.password",
"valueFrom": "arn:aws:ssm:eu-west-1:475079312496:parameter/prod/bonecp.password"
"valueFrom": "arn:aws:ssm:eu-west-1:920408837790:parameter/prod/bonecp.password"
},
{
"name": "oag.password",
"valueFrom": "arn:aws:ssm:eu-west-1:475079312496:parameter/prod/authentication.oag.basic.password"
"valueFrom": "arn:aws:ssm:eu-west-1:920408837790:parameter/prod/authentication.oag.basic.password"
},
{
"name": "viite.apikey",
"valueFrom": "arn:aws:ssm:eu-west-1:475079312496:parameter/prod/apikey/viite"
"valueFrom": "arn:aws:ssm:eu-west-1:920408837790:parameter/prod/apikey/viite"
},
{
"name": "vkm.apikey",
"valueFrom": "arn:aws:ssm:eu-west-1:475079312496:parameter/prod/apikey/viitekehysmuunnin"
"valueFrom": "arn:aws:ssm:eu-west-1:920408837790:parameter/prod/apikey/viitekehysmuunnin"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions aws/cloud-formation/batchSystem/QAbatchJobDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"value": "4"
}
],
"executionRoleArn": "arn:aws:iam::475079312496:role/batchSystem-BatchTaskRole-GSUD7E3H8KV4",
"executionRoleArn": "arn:aws:iam::475079312496:role/QA-batchSystem-BatchTaskRole-1QO0VDAJOYS45",
"environment": [
{
"name": "containerCPU",
Expand Down Expand Up @@ -106,7 +106,7 @@
},
{
"name": "caching",
"value": "false"
"value": "true"
},
{
"name": "cacheHostname",
Expand Down
26 changes: 0 additions & 26 deletions aws/cloud-formation/batchSystem/batch-parameter.json

This file was deleted.

82 changes: 82 additions & 0 deletions aws/cloud-formation/batchSystem/batchLambda/batchLambda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
BucketName:
Description: Name of S3 bucket for lambda code
Type: String
S3ObjectKey:
Description: Key of lambda deployment object
Type: String
EnvironmentName:
Description: Name of AWS account dev or prod
Type: String
Owner:
Description: "Owner of the of application, that these resources are created for. Used when tagging the resources"
Type: String
Project:
Description: "Project of the of application, that these resources are created for. Used when tagging the resources"
Type: String
ApplicationName:
Description: Name of the application (no whitespace or special characters)
Type: String

Resources:
BatchLambda:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket: !Ref BucketName
S3Key: !Ref S3ObjectKey
Tags:
- Key: Name
Value: !Join [ '-', [ !Ref EnvironmentName, !Ref ApplicationName, 'batchLambda' ] ]
- Key: Environment
Value: !Ref EnvironmentName
- Key: Owner
Value: !Ref Owner
- Key: Project
Value: !Ref Project
FunctionName: "Batch-Add-Jobs-To-Queue-New"
Handler: AddJobToQueue.handler
Role: !GetAtt BatchLambdaRole.Arn
Runtime: nodejs14.x

BatchLambdaRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Principal:
Service: "lambda.amazonaws.com"
Action:
- 'sts:AssumeRole'
Policies:
- PolicyName: "dev-batch-lambda-policy"
PolicyDocument:
Statement:
- Effect: "Allow"
Resource: "*"
Action:
- 'logs:CreateLogStream'
- 'logs:PutLogEvents'
- 'batch:DescribeJobs'
- 'batch:SubmitJob'
- 'batch:ListJobs'

Tags:
- Key: Name
Value: !Join [ '-', [ !Ref EnvironmentName, !Ref ApplicationName, 'batchLambdaRole' ] ]
- Key: Environment
Value: !Ref EnvironmentName
- Key: Owner
Value: !Ref Owner
- Key: Project
Value: !Ref Project

Outputs:
BatchLambdaOutput:
Description: Arn of lambda for adding jobs to queue
Value: !GetAtt BatchLambda.Arn
Export:
Name: !Sub "BatchLambdaID"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"ParameterKey": "DevBucketName",
"ParameterValue": "dev-batch-lambda-deployment-bucket"
},
{
"ParameterKey": "ProdBucketName",
"ParameterValue": "prod-batch-lambda-deployment-bucket"
},
{
"ParameterKey": "LambdaCodeS3Key",
"ParameterValue": "deployment_package.zip"
},
{
"ParameterKey": "CodeCommitRepositoryName",
"ParameterValue": "Batch-Lambda"
},
{
"ParameterKey": "CodeCommitBranch",
"ParameterValue": "master"
}
]
Loading