kinesis and subscription filter for logs creation skipped when watchToEnd false
parent
0730f1a883
commit
a9063229da
|
|
@ -1437,6 +1437,9 @@ class AWSJobStack {
|
||||||
taskDefCloudFormation = taskDefCloudFormation.replace(`ContainerMemory:
|
taskDefCloudFormation = taskDefCloudFormation.replace(`ContainerMemory:
|
||||||
Default: 2048`, `ContainerMemory:
|
Default: 2048`, `ContainerMemory:
|
||||||
Default: ${Number.parseInt(memory)}`);
|
Default: ${Number.parseInt(memory)}`);
|
||||||
|
if (cloud_runner_options_1.default.watchCloudRunnerToEnd) {
|
||||||
|
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '#template resources logstream', task_definition_formation_1.TaskDefinitionFormation.streamLogs);
|
||||||
|
}
|
||||||
for (const secret of secrets) {
|
for (const secret of secrets) {
|
||||||
secret.ParameterKey = `${buildGuid.replace(/[^\dA-Za-z]/g, '')}${secret.ParameterKey.replace(/[^\dA-Za-z]/g, '')}`;
|
secret.ParameterKey = `${buildGuid.replace(/[^\dA-Za-z]/g, '')}${secret.ParameterKey.replace(/[^\dA-Za-z]/g, '')}`;
|
||||||
if (typeof secret.ParameterValue == 'number') {
|
if (typeof secret.ParameterValue == 'number') {
|
||||||
|
|
@ -1447,10 +1450,7 @@ class AWSJobStack {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p1 - input', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getParameterTemplate(secret.ParameterKey));
|
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p1 - input', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getParameterTemplate(secret.ParameterKey));
|
||||||
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '#template resources', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretTemplate(`${secret.ParameterKey}`));
|
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '#template resources secrets', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretTemplate(`${secret.ParameterKey}`));
|
||||||
if (cloud_runner_options_1.default.watchCloudRunnerToEnd) {
|
|
||||||
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '#template resources', task_definition_formation_1.TaskDefinitionFormation.streamLogs);
|
|
||||||
}
|
|
||||||
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p3 - container def', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey));
|
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p3 - container def', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey));
|
||||||
}
|
}
|
||||||
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
||||||
|
|
@ -2456,7 +2456,10 @@ Resources:
|
||||||
Metadata:
|
Metadata:
|
||||||
'AWS::CloudFormation::Designer':
|
'AWS::CloudFormation::Designer':
|
||||||
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
||||||
# template resources
|
# template resources secrets
|
||||||
|
|
||||||
|
# template resources logstream
|
||||||
|
|
||||||
TaskDefinition:
|
TaskDefinition:
|
||||||
Type: 'AWS::ECS::TaskDefinition'
|
Type: 'AWS::ECS::TaskDefinition'
|
||||||
Properties:
|
Properties:
|
||||||
|
|
@ -2512,7 +2515,8 @@ Resources:
|
||||||
DependsOn:
|
DependsOn:
|
||||||
- LogGroup
|
- LogGroup
|
||||||
`;
|
`;
|
||||||
TaskDefinitionFormation.streamLogs = ` SubscriptionFilter:
|
TaskDefinitionFormation.streamLogs = `
|
||||||
|
SubscriptionFilter:
|
||||||
Type: 'AWS::Logs::SubscriptionFilter'
|
Type: 'AWS::Logs::SubscriptionFilter'
|
||||||
Properties:
|
Properties:
|
||||||
FilterPattern: ''
|
FilterPattern: ''
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -41,6 +41,13 @@ export class AWSJobStack {
|
||||||
`ContainerMemory:
|
`ContainerMemory:
|
||||||
Default: ${Number.parseInt(memory)}`,
|
Default: ${Number.parseInt(memory)}`,
|
||||||
);
|
);
|
||||||
|
if (CloudRunnerOptions.watchCloudRunnerToEnd) {
|
||||||
|
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
||||||
|
taskDefCloudFormation,
|
||||||
|
'#template resources logstream',
|
||||||
|
TaskDefinitionFormation.streamLogs,
|
||||||
|
);
|
||||||
|
}
|
||||||
for (const secret of secrets) {
|
for (const secret of secrets) {
|
||||||
secret.ParameterKey = `${buildGuid.replace(/[^\dA-Za-z]/g, '')}${secret.ParameterKey.replace(
|
secret.ParameterKey = `${buildGuid.replace(/[^\dA-Za-z]/g, '')}${secret.ParameterKey.replace(
|
||||||
/[^\dA-Za-z]/g,
|
/[^\dA-Za-z]/g,
|
||||||
|
|
@ -60,16 +67,9 @@ export class AWSJobStack {
|
||||||
);
|
);
|
||||||
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
||||||
taskDefCloudFormation,
|
taskDefCloudFormation,
|
||||||
'#template resources',
|
'#template resources secrets',
|
||||||
AWSCloudFormationTemplates.getSecretTemplate(`${secret.ParameterKey}`),
|
AWSCloudFormationTemplates.getSecretTemplate(`${secret.ParameterKey}`),
|
||||||
);
|
);
|
||||||
if (CloudRunnerOptions.watchCloudRunnerToEnd) {
|
|
||||||
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
|
||||||
taskDefCloudFormation,
|
|
||||||
'#template resources',
|
|
||||||
TaskDefinitionFormation.streamLogs,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
||||||
taskDefCloudFormation,
|
taskDefCloudFormation,
|
||||||
'p3 - container def',
|
'p3 - container def',
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,10 @@ Resources:
|
||||||
Metadata:
|
Metadata:
|
||||||
'AWS::CloudFormation::Designer':
|
'AWS::CloudFormation::Designer':
|
||||||
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
id: aece53ae-b82d-4267-bc16-ed964b05db27
|
||||||
# template resources
|
# template resources secrets
|
||||||
|
|
||||||
|
# template resources logstream
|
||||||
|
|
||||||
TaskDefinition:
|
TaskDefinition:
|
||||||
Type: 'AWS::ECS::TaskDefinition'
|
Type: 'AWS::ECS::TaskDefinition'
|
||||||
Properties:
|
Properties:
|
||||||
|
|
@ -132,7 +135,8 @@ Resources:
|
||||||
DependsOn:
|
DependsOn:
|
||||||
- LogGroup
|
- LogGroup
|
||||||
`;
|
`;
|
||||||
public static streamLogs = ` SubscriptionFilter:
|
public static streamLogs = `
|
||||||
|
SubscriptionFilter:
|
||||||
Type: 'AWS::Logs::SubscriptionFilter'
|
Type: 'AWS::Logs::SubscriptionFilter'
|
||||||
Properties:
|
Properties:
|
||||||
FilterPattern: ''
|
FilterPattern: ''
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue