typescript aws
parent
10ffbfe57e
commit
405e0265d6
|
|
@ -36,7 +36,7 @@ Resources:
|
||||||
Action: "sts:AssumeRole"
|
Action: "sts:AssumeRole"
|
||||||
Path: "/"
|
Path: "/"
|
||||||
Policies:
|
Policies:
|
||||||
- PolicyName: !Sub "DeleteLambdaExRole-${BUILDID}"
|
- PolicyName: "DeleteLambdaExRole-${BUILDID}"
|
||||||
PolicyDocument:
|
PolicyDocument:
|
||||||
Version: "2012-10-17"
|
Version: "2012-10-17"
|
||||||
Statement:
|
Statement:
|
||||||
|
|
@ -55,7 +55,7 @@ Resources:
|
||||||
DependsOn:
|
DependsOn:
|
||||||
- DeleteCFNLambdaExecutionRole
|
- DeleteCFNLambdaExecutionRole
|
||||||
Properties:
|
Properties:
|
||||||
FunctionName: !Sub "DeleteCFNLambda-${BUILDID}"
|
FunctionName: "DeleteCFNLambda-${BUILDID}"
|
||||||
Code:
|
Code:
|
||||||
ZipFile: |
|
ZipFile: |
|
||||||
import boto3
|
import boto3
|
||||||
|
|
@ -101,7 +101,7 @@ Resources:
|
||||||
PermissionForDeleteCFNLambda:
|
PermissionForDeleteCFNLambda:
|
||||||
Type: "AWS::Lambda::Permission"
|
Type: "AWS::Lambda::Permission"
|
||||||
Properties:
|
Properties:
|
||||||
FunctionName: !Sub "DeleteCFNLambda-${BUILDID}"
|
FunctionName: "DeleteCFNLambda-${BUILDID}"
|
||||||
Action: "lambda:InvokeFunction"
|
Action: "lambda:InvokeFunction"
|
||||||
Principal: "events.amazonaws.com"
|
Principal: "events.amazonaws.com"
|
||||||
SourceArn: !GetAtt DeleteStackEventRule.Arn
|
SourceArn: !GetAtt DeleteStackEventRule.Arn
|
||||||
|
|
@ -117,7 +117,7 @@ Resources:
|
||||||
Action: "sts:AssumeRole"
|
Action: "sts:AssumeRole"
|
||||||
Path: "/"
|
Path: "/"
|
||||||
Policies:
|
Policies:
|
||||||
- PolicyName: !Sub "BasicLambdaExecutionRole-${BUILDID}"
|
- PolicyName: "BasicLambdaExecutionRole-${BUILDID}"
|
||||||
PolicyDocument:
|
PolicyDocument:
|
||||||
Version: "2012-10-17"
|
Version: "2012-10-17"
|
||||||
Statement:
|
Statement:
|
||||||
|
|
@ -130,7 +130,7 @@ Resources:
|
||||||
GenerateCronExpLambda:
|
GenerateCronExpLambda:
|
||||||
Type: "AWS::Lambda::Function"
|
Type: "AWS::Lambda::Function"
|
||||||
Properties:
|
Properties:
|
||||||
FunctionName: !Sub "MakeCronLambda-${BUILDID}"
|
FunctionName: "MakeCronLambda-${BUILDID}"
|
||||||
Code:
|
Code:
|
||||||
ZipFile: |
|
ZipFile: |
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,6 @@ class AWS {
|
||||||
.toString()
|
.toString()
|
||||||
.replace(/[^\da-z]/gi, '');
|
.replace(/[^\da-z]/gi, '');
|
||||||
const taskDefStackNameTTL = taskDefStackName + "-ttl";
|
const taskDefStackNameTTL = taskDefStackName + "-ttl";
|
||||||
core.info('Creating build job resources');
|
|
||||||
const taskDefCloudFormation = fs.readFileSync(`${__dirname}/task-def-formation.yml`, 'utf8');
|
const taskDefCloudFormation = fs.readFileSync(`${__dirname}/task-def-formation.yml`, 'utf8');
|
||||||
yield CF.createStack({
|
yield CF.createStack({
|
||||||
StackName: taskDefStackName,
|
StackName: taskDefStackName,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -220,7 +220,6 @@ class AWS {
|
||||||
.toString()
|
.toString()
|
||||||
.replace(/[^\da-z]/gi, '');
|
.replace(/[^\da-z]/gi, '');
|
||||||
const taskDefStackNameTTL = taskDefStackName+"-ttl";
|
const taskDefStackNameTTL = taskDefStackName+"-ttl";
|
||||||
core.info('Creating build job resources');
|
|
||||||
const taskDefCloudFormation = fs.readFileSync(`${__dirname}/task-def-formation.yml`, 'utf8');
|
const taskDefCloudFormation = fs.readFileSync(`${__dirname}/task-def-formation.yml`, 'utf8');
|
||||||
await CF.createStack({
|
await CF.createStack({
|
||||||
StackName: taskDefStackName,
|
StackName: taskDefStackName,
|
||||||
|
|
@ -286,8 +285,8 @@ class AWS {
|
||||||
StackName: taskDefStackName,
|
StackName: taskDefStackName,
|
||||||
}).promise();
|
}).promise();
|
||||||
|
|
||||||
const baseResources = await CF.describeStackResources({ StackName: taskDefStackName }).promise();
|
|
||||||
|
|
||||||
|
const baseResources = await CF.describeStackResources({ StackName: taskDefStackName }).promise();
|
||||||
|
|
||||||
const clusterName = baseResources.StackResources?.find(
|
const clusterName = baseResources.StackResources?.find(
|
||||||
(x) => x.LogicalResourceId === 'ECSCluster',
|
(x) => x.LogicalResourceId === 'ECSCluster',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue