log group name
parent
da63ee8112
commit
781cfc8354
|
|
@ -716,6 +716,12 @@ class CloudRunnerOptions {
|
||||||
const input = CloudRunnerOptions.getInput(`watchToEnd`);
|
const input = CloudRunnerOptions.getInput(`watchToEnd`);
|
||||||
return !input || input === 'true';
|
return !input || input === 'true';
|
||||||
}
|
}
|
||||||
|
static get retainWorkspaces() {
|
||||||
|
return CloudRunnerOptions.getInput(`retainWorkspaces`) || false;
|
||||||
|
}
|
||||||
|
static get retainWorkspacesMax() {
|
||||||
|
return Number(CloudRunnerOptions.getInput(`retainWorkspacesMax`)) || 5;
|
||||||
|
}
|
||||||
static ToEnvVarFormat(input) {
|
static ToEnvVarFormat(input) {
|
||||||
if (input.toUpperCase() === input) {
|
if (input.toUpperCase() === input) {
|
||||||
return input;
|
return input;
|
||||||
|
|
@ -1242,6 +1248,7 @@ class AWSJobStack {
|
||||||
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
||||||
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
||||||
});
|
});
|
||||||
|
const logGroupName = `${this.baseStackName}/${taskDefStackName}`;
|
||||||
const parameters = [
|
const parameters = [
|
||||||
{
|
{
|
||||||
ParameterKey: 'EnvironmentName',
|
ParameterKey: 'EnvironmentName',
|
||||||
|
|
@ -1255,6 +1262,10 @@ class AWSJobStack {
|
||||||
ParameterKey: 'ServiceName',
|
ParameterKey: 'ServiceName',
|
||||||
ParameterValue: taskDefStackName,
|
ParameterValue: taskDefStackName,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ParameterKey: 'LogGroupName',
|
||||||
|
ParameterValue: logGroupName,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ParameterKey: 'Command',
|
ParameterKey: 'Command',
|
||||||
ParameterValue: 'echo "this template should be overwritten when running a task"',
|
ParameterValue: 'echo "this template should be overwritten when running a task"',
|
||||||
|
|
@ -1966,6 +1977,10 @@ Parameters:
|
||||||
Type: String
|
Type: String
|
||||||
Default: example
|
Default: example
|
||||||
Description: A name for the service
|
Description: A name for the service
|
||||||
|
LogGroupName:
|
||||||
|
Type: String
|
||||||
|
Default: example
|
||||||
|
Description: A name for the log groups in cloud watch
|
||||||
ImageUrl:
|
ImageUrl:
|
||||||
Type: String
|
Type: String
|
||||||
Default: nginx
|
Default: nginx
|
||||||
|
|
@ -2023,7 +2038,7 @@ Resources:
|
||||||
LogGroup:
|
LogGroup:
|
||||||
Type: 'AWS::Logs::LogGroup'
|
Type: 'AWS::Logs::LogGroup'
|
||||||
Properties:
|
Properties:
|
||||||
LogGroupName: !Ref ServiceName
|
LogGroupName: !Ref LogGroupName
|
||||||
Metadata:
|
Metadata:
|
||||||
'AWS::CloudFormation::Designer':
|
'AWS::CloudFormation::Designer':
|
||||||
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
||||||
|
|
@ -2033,7 +2048,7 @@ Resources:
|
||||||
FilterPattern: ''
|
FilterPattern: ''
|
||||||
RoleArn:
|
RoleArn:
|
||||||
'Fn::ImportValue': !Sub '${'${EnvironmentName}'}:CloudWatchIAMRole'
|
'Fn::ImportValue': !Sub '${'${EnvironmentName}'}:CloudWatchIAMRole'
|
||||||
LogGroupName: !Ref ServiceName
|
LogGroupName: !Ref LogGroupName
|
||||||
DestinationArn:
|
DestinationArn:
|
||||||
'Fn::GetAtt':
|
'Fn::GetAtt':
|
||||||
- KinesisStream
|
- KinesisStream
|
||||||
|
|
@ -2102,7 +2117,7 @@ Resources:
|
||||||
LogConfiguration:
|
LogConfiguration:
|
||||||
LogDriver: awslogs
|
LogDriver: awslogs
|
||||||
Options:
|
Options:
|
||||||
awslogs-group: !Ref ServiceName
|
awslogs-group: !Ref LogGroupName
|
||||||
awslogs-region: !Ref 'AWS::Region'
|
awslogs-region: !Ref 'AWS::Region'
|
||||||
awslogs-stream-prefix: !Ref ServiceName
|
awslogs-stream-prefix: !Ref ServiceName
|
||||||
DependsOn:
|
DependsOn:
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -163,6 +163,14 @@ class CloudRunnerOptions {
|
||||||
return !input || input === 'true';
|
return !input || input === 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get retainWorkspaces(): boolean {
|
||||||
|
return CloudRunnerOptions.getInput(`retainWorkspaces`) || false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get retainWorkspacesMax(): number {
|
||||||
|
return Number(CloudRunnerOptions.getInput(`retainWorkspacesMax`)) || 5;
|
||||||
|
}
|
||||||
|
|
||||||
public static ToEnvVarFormat(input: string) {
|
public static ToEnvVarFormat(input: string) {
|
||||||
if (input.toUpperCase() === input) {
|
if (input.toUpperCase() === input) {
|
||||||
return input;
|
return input;
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ export class AWSJobStack {
|
||||||
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
||||||
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
||||||
});
|
});
|
||||||
|
const logGroupName = `${this.baseStackName}/${taskDefStackName}`;
|
||||||
const parameters = [
|
const parameters = [
|
||||||
{
|
{
|
||||||
ParameterKey: 'EnvironmentName',
|
ParameterKey: 'EnvironmentName',
|
||||||
|
|
@ -82,6 +83,10 @@ export class AWSJobStack {
|
||||||
ParameterKey: 'ServiceName',
|
ParameterKey: 'ServiceName',
|
||||||
ParameterValue: taskDefStackName,
|
ParameterValue: taskDefStackName,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ParameterKey: 'LogGroupName',
|
||||||
|
ParameterValue: logGroupName,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ParameterKey: 'Command',
|
ParameterKey: 'Command',
|
||||||
ParameterValue: 'echo "this template should be overwritten when running a task"',
|
ParameterValue: 'echo "this template should be overwritten when running a task"',
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ Parameters:
|
||||||
Type: String
|
Type: String
|
||||||
Default: example
|
Default: example
|
||||||
Description: A name for the service
|
Description: A name for the service
|
||||||
|
LogGroupName:
|
||||||
|
Type: String
|
||||||
|
Default: example
|
||||||
|
Description: A name for the log groups in cloud watch
|
||||||
ImageUrl:
|
ImageUrl:
|
||||||
Type: String
|
Type: String
|
||||||
Default: nginx
|
Default: nginx
|
||||||
|
|
@ -68,7 +72,7 @@ Resources:
|
||||||
LogGroup:
|
LogGroup:
|
||||||
Type: 'AWS::Logs::LogGroup'
|
Type: 'AWS::Logs::LogGroup'
|
||||||
Properties:
|
Properties:
|
||||||
LogGroupName: !Ref ServiceName
|
LogGroupName: !Ref LogGroupName
|
||||||
Metadata:
|
Metadata:
|
||||||
'AWS::CloudFormation::Designer':
|
'AWS::CloudFormation::Designer':
|
||||||
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
||||||
|
|
@ -78,7 +82,7 @@ Resources:
|
||||||
FilterPattern: ''
|
FilterPattern: ''
|
||||||
RoleArn:
|
RoleArn:
|
||||||
'Fn::ImportValue': !Sub '${'${EnvironmentName}'}:CloudWatchIAMRole'
|
'Fn::ImportValue': !Sub '${'${EnvironmentName}'}:CloudWatchIAMRole'
|
||||||
LogGroupName: !Ref ServiceName
|
LogGroupName: !Ref LogGroupName
|
||||||
DestinationArn:
|
DestinationArn:
|
||||||
'Fn::GetAtt':
|
'Fn::GetAtt':
|
||||||
- KinesisStream
|
- KinesisStream
|
||||||
|
|
@ -147,7 +151,7 @@ Resources:
|
||||||
LogConfiguration:
|
LogConfiguration:
|
||||||
LogDriver: awslogs
|
LogDriver: awslogs
|
||||||
Options:
|
Options:
|
||||||
awslogs-group: !Ref ServiceName
|
awslogs-group: !Ref LogGroupName
|
||||||
awslogs-region: !Ref 'AWS::Region'
|
awslogs-region: !Ref 'AWS::Region'
|
||||||
awslogs-stream-prefix: !Ref ServiceName
|
awslogs-stream-prefix: !Ref ServiceName
|
||||||
DependsOn:
|
DependsOn:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue