@axway/axway-central-cli 2.30.0-rc.0 → 2.30.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,13 +48,10 @@ const InvalidMsg = {
48
48
 
49
49
  // ConfigFiles - all the config file that are used in the setup
50
50
  const ConfigFiles = exports.ConfigFiles = {
51
- ContinuousZip: 'cloudformation-continuous-discovery.zip',
52
- SynchronousZip: 'cloudformation-synchronous-discovery.zip',
53
51
  DeployAllYAML: 'amplify-agents-deploy-all.yaml',
54
- ResourcesYAML: 'amplify-agents-resources.yaml',
52
+ ResourcesYAML: 'amplify-agents-setup.yaml',
55
53
  EC2DeployYAML: 'amplify-agents-ec2.yaml',
56
54
  FargateDeployYAML: 'amplify-agents-ecs-fargate.yaml',
57
- LambdaZip: 'traceability_lambda.zip',
58
55
  AgentConfigZip: 'aws_apigw_agent_config-latest.zip',
59
56
  DAEnvVars: `${helpers.configFiles.DA_ENV_VARS}`,
60
57
  TAEnvVars: `${helpers.configFiles.TA_ENV_VARS}`,
@@ -82,6 +79,7 @@ const AWSPrompts = exports.AWSPrompts = {
82
79
  SUBNET: 'Enter the Subnet for the EC2 Instance of ECS Container',
83
80
  S3_BUCKET: 'Enter the existing S3 bucket, within your region, where the agent resources will be uploaded',
84
81
  TA_LOG_GROUP: 'Enter the log group name the traceability agent will log to',
82
+ FULL_TRANSACTION_LOGGING: 'Do you want to enable Full Transaction Logging? Please note that CloudWatch costs would increase when Full Transaction Logging is enabled',
85
83
  TA_QUEUE: 'Enter the traceability queue name',
86
84
  VPC_ID: 'Enter the VPC ID to deploy the EC2 instance to. Leave blank to create entire infrastructure'
87
85
  };
@@ -122,28 +120,6 @@ const askToCreateRoleSetup = async () => {
122
120
  default: _types.YesNo.Yes
123
121
  })) === _types.YesNo.Yes ? _types.TrueFalse.True.toLowerCase() : _types.TrueFalse.False.toLowerCase();
124
122
  };
125
- const askConfigSvcSetup = async awsAgentValues => {
126
- awsAgentValues.cloudFormationConfig.ConfigServiceSetup = (await (0, _basicPrompts.askList)({
127
- msg: AWSPrompts.CONFIG_SERVICE,
128
- choices: _types.YesNoChoices,
129
- default: _types.YesNo.Yes
130
- })) === _types.YesNo.Yes ? _types.TrueFalse.True.toLowerCase() : _types.TrueFalse.False.toLowerCase();
131
- if (awsAgentValues.cloudFormationConfig.ConfigServiceSetup === _types.TrueFalse.True.toLowerCase()) {
132
- awsAgentValues.cloudFormationConfig.ConfigBucketName = await (0, _basicPrompts.askInput)({
133
- msg: AWSPrompts.CONFIG_BUCKET,
134
- defaultValue: awsAgentValues.cloudFormationConfig.AgentResourcesBucket,
135
- validate: (0, _basicPrompts.validateRegex)(helpers.AWSRegexPatterns.AWS_REGEXP, InvalidMsg.S3_BUCKET)
136
- });
137
- if (awsAgentValues.cloudFormationConfig.ConfigBucketName !== awsAgentValues.cloudFormationConfig.AgentResourcesBucket) {
138
- awsAgentValues.cloudFormationConfig.ConfigBucketExists = (await (0, _basicPrompts.askList)({
139
- msg: AWSPrompts.CONFIG_BUCKET_EXISTS,
140
- choices: _types.YesNoChoices,
141
- default: _types.YesNo.Yes
142
- })) === _types.YesNo.Yes ? _types.TrueFalse.True.toLowerCase() : _types.TrueFalse.False.toLowerCase();
143
- }
144
- }
145
- return awsAgentValues;
146
- };
147
123
 
148
124
  // askToUsePublicIpAddress - asks a Yes/No question for setting a public IP address, returns a True/False string for CloudFormation parameters
149
125
  const askToUsePublicIpAddress = async () => {
@@ -300,27 +276,16 @@ const gatewayConnectivity = async installConfig => {
300
276
  awsAgentValues.logGroup = apiGWTrafficLogGroupName;
301
277
  awsAgentValues.cloudFormationConfig.APIGWTrafficLogGroupName = apiGWTrafficLogGroupName;
302
278
 
303
- // ConfigServiceSetup
304
- awsAgentValues = await askConfigSvcSetup(awsAgentValues);
279
+ // FullTransactionLogging
280
+ const fullTransactionLogging = (await (0, _basicPrompts.askList)({
281
+ msg: AWSPrompts.FULL_TRANSACTION_LOGGING,
282
+ choices: _types.YesNoChoices,
283
+ default: _types.YesNo.No
284
+ })) === _types.YesNo.Yes;
285
+ awsAgentValues.fullTransactionLogging = fullTransactionLogging;
305
286
 
306
- // DiscoveryQueueName
307
- const discoveryQueueName = await (0, _basicPrompts.askInput)({
308
- msg: AWSPrompts.DA_QUEUE,
309
- defaultValue: awsAgentValues.cloudFormationConfig.DiscoveryQueueName,
310
- validate: (0, _basicPrompts.validateRegex)(helpers.AWSRegexPatterns.AWS_REGEXP, InvalidMsg.SQS_QUEUE)
311
- });
312
- awsAgentValues.daQueueName = discoveryQueueName;
313
- awsAgentValues.cloudFormationConfig.DiscoveryQueueName = discoveryQueueName;
287
+ // set agent versions
314
288
  awsAgentValues.cloudFormationConfig.DiscoveryAgentVersion = installConfig.daVersion;
315
-
316
- // TraceabilityQueueName
317
- const traceabilityQueueName = await (0, _basicPrompts.askInput)({
318
- msg: AWSPrompts.TA_QUEUE,
319
- defaultValue: awsAgentValues.cloudFormationConfig.TraceabilityQueueName,
320
- validate: (0, _basicPrompts.validateRegex)(helpers.AWSRegexPatterns.AWS_REGEXP, InvalidMsg.SQS_QUEUE)
321
- });
322
- awsAgentValues.taQueueName = traceabilityQueueName;
323
- awsAgentValues.cloudFormationConfig.TraceabilityQueueName = traceabilityQueueName;
324
289
  awsAgentValues.cloudFormationConfig.TraceabilityAgentVersion = installConfig.taVersion;
325
290
 
326
291
  // Configure appropriate Gateway type
@@ -344,7 +309,7 @@ const gatewayConnectivity = async installConfig => {
344
309
  validate: (0, _basicPrompts.validateRegex)(helpers.AWSRegexPatterns.AWS_REGEXP_LOG_GROUP_NAME, InvalidMsg.LOG_GROUP)
345
310
  });
346
311
 
347
- // TraceabilityQueueName
312
+ // TraceabilityAgentLogGroupName
348
313
  awsAgentValues.cloudFormationConfig.TraceabilityAgentLogGroupName = await (0, _basicPrompts.askInput)({
349
314
  msg: AWSPrompts.TA_LOG_GROUP,
350
315
  defaultValue: awsAgentValues.cloudFormationConfig.TraceabilityAgentLogGroupName,
@@ -355,7 +320,7 @@ const gatewayConnectivity = async installConfig => {
355
320
  exports.gatewayConnectivity = gatewayConnectivity;
356
321
  const generateOutput = async installConfig => {
357
322
  const awsAgentValues = installConfig.gatewayConfig;
358
- let s3BaseFiles = [ConfigFiles.LambdaZip, ConfigFiles.DeployAllYAML, ConfigFiles.ResourcesYAML];
323
+ let s3BaseFiles = [ConfigFiles.DeployAllYAML, ConfigFiles.ResourcesYAML];
359
324
  let additionalSteps = '';
360
325
  let dockerEnvConfig = '';
361
326
  let runCommands = '';
@@ -479,26 +444,9 @@ const downloadAPIGWAgentConfigZip = async () => {
479
444
  const unzipAPIGWAgentConfigZip = async zipFile => {
480
445
  await helpers.unzip(zipFile);
481
446
  _fs.default.unlinkSync(zipFile);
482
- _fs.default.existsSync(ConfigFiles.ContinuousZip);
483
- return await unzipCFContinuousDiscoveryZip(ConfigFiles.ContinuousZip);
484
- };
485
-
486
- // Unzip Cloud Formation continuous zip
487
- const unzipCFContinuousDiscoveryZip = async zipFile => {
488
- await helpers.unzip(zipFile);
489
- try {
490
- _fs.default.unlinkSync(zipFile);
491
- // remove synchronous zip that was extracted from cloudformation-continuous-discovery.zip
492
- if (_fs.default.existsSync(ConfigFiles.SynchronousZip)) {
493
- _fs.default.unlinkSync(ConfigFiles.SynchronousZip);
494
- }
495
- } catch (e) {
496
- // May need to manually remove - cloudformation-synchronous-discovery.zip, cloudformation-continuous-discovery.zip
497
- console.log(_chalk.default.gray(`The ${ConfigFiles.ContinuousZip} and / or the ${ConfigFiles.SynchronousZip} may not have been removed.\n` + ` You can manually remove them if you wish`));
498
- }
499
447
  const isCloudFormation = _fs.default.existsSync(ConfigFiles.DeployAllYAML);
500
448
  if (!isCloudFormation) {
501
- console.log(`${ConfigFiles.DeployAllYAML} was not extracted from ${ConfigFiles.ContinuousZip}`);
449
+ console.log(`${ConfigFiles.DeployAllYAML} was not extracted from ${ConfigFiles.AgentConfigZip}`);
502
450
  return false;
503
451
  }
504
452
  return true;
@@ -566,6 +514,5 @@ const testables = exports.testables = {
566
514
  DeploymentTypes,
567
515
  AWSPrompts,
568
516
  EC2InstanceTypes,
569
- unzipCFContinuousDiscoveryZip,
570
517
  ConfigFiles
571
518
  };
@@ -27,10 +27,12 @@ class DataplaneConfig {
27
27
  }
28
28
  }
29
29
  class AWSDataplaneConfig extends DataplaneConfig {
30
- constructor(arn) {
30
+ constructor(arn, enableFullTransactionLogging) {
31
31
  super('AWS');
32
32
  _defineProperty(this, "accessLogARN", void 0);
33
+ _defineProperty(this, "fullTransactionLogging", void 0);
33
34
  this.accessLogARN = arn;
35
+ this.fullTransactionLogging = enableFullTransactionLogging;
34
36
  }
35
37
  }
36
38
  class Sampling {
@@ -102,6 +104,7 @@ class SaasAWSAgentValues extends SaasAgentValues {
102
104
  _defineProperty(this, "assumeRole", void 0);
103
105
  _defineProperty(this, "externalID", void 0);
104
106
  _defineProperty(this, "accessLogARN", void 0);
107
+ _defineProperty(this, "fullTransactionLogging", void 0);
105
108
  this.authType = AWSAuthType.ASSUME;
106
109
  this.accessKey = '';
107
110
  this.secretKey = '';
@@ -109,6 +112,7 @@ class SaasAWSAgentValues extends SaasAgentValues {
109
112
  this.assumeRole = '';
110
113
  this.externalID = '';
111
114
  this.accessLogARN = '';
115
+ this.fullTransactionLogging = false;
112
116
  }
113
117
  getAccessData() {
114
118
  let data = JSON.stringify({
@@ -143,6 +147,7 @@ const SaasPrompts = {
143
147
  ASSUME_ROLE: 'Enter the Role ARN that the agent will Assume',
144
148
  EXTERNAL_ID: 'Enter the External ID the Assume Role expects',
145
149
  ACCESS_LOG_ARN: 'Enter the ARN for the Access Log that the Discovery will add and the Traceability will use',
150
+ FULL_TRANSACTION_LOGGING: 'Do you want to enable Full Transaction Logging? Please note that CloudWatch costs would increase when Full Transaction Logging is enabled',
146
151
  DA_FREQUENCY: 'How often should the discovery run, leave blank for integrating in CI/CD process',
147
152
  TA_FREQUENCY: 'How often should the traffic collection run, leave blank for manual trigger only',
148
153
  QUEUE: 'Do you want to discover immediately after installation',
@@ -346,6 +351,11 @@ const gatewayConnectivity = async installConfig => {
346
351
  msg: SaasPrompts.ACCESS_LOG_ARN,
347
352
  validate: (0, _basicPrompts.validateRegex)(helpers.AWSRegexPatterns.AWS_ACCESS_LOG_ARN, helpers.invalidValueExampleErrMsg('access log arn', 'arn:aws:logs:region:000000000000:log-group:log-group-name'))
348
353
  });
354
+ hostedAgentValues.fullTransactionLogging = (await (0, _basicPrompts.askList)({
355
+ msg: SaasPrompts.FULL_TRANSACTION_LOGGING,
356
+ default: _types.YesNo.No,
357
+ choices: _types.YesNoChoices
358
+ })) === _types.YesNo.Yes;
349
359
  }
350
360
  }
351
361
 
@@ -407,7 +417,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
407
417
  }) : installConfig.centralConfig.ampcEnvInfo.name;
408
418
  if (installConfig.gatewayType === _types.GatewayTypes.AWS_GATEWAY) {
409
419
  if (installConfig.switches.isTaEnabled) {
410
- awsAgentValues.dataplaneConfig = new AWSDataplaneConfig(awsAgentValues.accessLogARN);
420
+ awsAgentValues.dataplaneConfig = new AWSDataplaneConfig(awsAgentValues.accessLogARN, awsAgentValues.fullTransactionLogging);
411
421
  } else {
412
422
  awsAgentValues.dataplaneConfig = new DataplaneConfig('AWS');
413
423
  }
@@ -17,31 +17,27 @@ class AWSAgentValues {
17
17
  _defineProperty(this, "accessKey", void 0);
18
18
  _defineProperty(this, "secretKey", void 0);
19
19
  _defineProperty(this, "logGroup", void 0);
20
+ _defineProperty(this, "fullTransactionLogging", void 0);
20
21
  _defineProperty(this, "region", void 0);
21
- _defineProperty(this, "daQueueName", void 0);
22
- _defineProperty(this, "taQueueName", void 0);
23
22
  _defineProperty(this, "apigwAgentConfigZipFile", void 0);
24
23
  _defineProperty(this, "centralConfig", void 0);
25
24
  _defineProperty(this, "traceabilityConfig", void 0);
26
25
  _defineProperty(this, "cloudFormationConfig", void 0);
27
26
  _defineProperty(this, "updateCloudFormationConfig", () => {
27
+ this.cloudFormationConfig.ECSCentralRegion = this.centralConfig.region;
28
28
  if (this.cloudFormationConfig.DeploymentType === 'ECS Fargate') {
29
29
  this.cloudFormationConfig.ECSCentralOrganizationID = this.centralConfig.orgId;
30
30
  this.cloudFormationConfig.ECSCentralEnvironmentName = this.centralConfig.environment;
31
31
  this.cloudFormationConfig.ECSCentralClientID = this.centralConfig.dosaAccount.clientId;
32
32
  this.cloudFormationConfig.ECSCentralDiscoveryAgentName = this.centralConfig.daAgentName;
33
33
  this.cloudFormationConfig.ECSCentralTraceabilityAgentName = this.centralConfig.taAgentName;
34
- this.cloudFormationConfig.ECSCentralURL = this.centralConfig.url;
35
- this.cloudFormationConfig.ECSCentralDeployment = this.centralConfig.deployment;
36
- this.cloudFormationConfig.ECSCentralTraceabilityHost = _types.IngestionHosts[this.centralConfig.region];
37
34
  }
38
35
  });
39
36
  this.accessKey = awsDeployment === 'Other' ? '**Insert Access Key**' : '';
40
37
  this.secretKey = awsDeployment === 'Other' ? '**Insert Secret Key**' : '';
41
38
  this.logGroup = '';
39
+ this.fullTransactionLogging = false;
42
40
  this.region = '';
43
- this.daQueueName = '';
44
- this.taQueueName = '';
45
41
  this.apigwAgentConfigZipFile = '';
46
42
  this.centralConfig = new _types.CentralAgentConfig();
47
43
  this.traceabilityConfig = new _types.TraceabilityConfig();
@@ -56,13 +52,15 @@ exports.AWSAgentValues = AWSAgentValues;
56
52
  const awsTAEnvVarTemplate = () => {
57
53
  return `# AWS configs
58
54
  AWS_REGION={{region}}
59
- AWS_QUEUENAME={{taQueueName}}
60
55
  {{#if accessKey}}
61
56
  AWS_AUTH_ACCESSKEY={{accessKey}}
62
57
  {{/if}}
63
58
  {{#if secretKey}}
64
59
  AWS_AUTH_SECRETKEY={{secretKey}}
65
60
  {{/if}}
61
+ {{#if fullTransactionLogging}}
62
+ AWS_FULLTRANSACTIONLOGGING={{fullTransactionLogging}}
63
+ {{/if}}
66
64
 
67
65
  # Amplify Central configs
68
66
  {{#if traceabilityConfig.usageReportingOffline}}
@@ -103,7 +101,6 @@ exports.awsTAEnvVarTemplate = awsTAEnvVarTemplate;
103
101
  const awsDAEnvVarTemplate = () => {
104
102
  return `# AWS configs
105
103
  AWS_REGION={{region}}
106
- AWS_QUEUENAME={{daQueueName}}
107
104
  {{#if accessKey}}
108
105
  AWS_AUTH_ACCESSKEY={{accessKey}}
109
106
  {{/if}}
@@ -485,11 +485,6 @@ class CloudFormationConfig {
485
485
  _defineProperty(this, "AgentResourcesBucket", void 0);
486
486
  _defineProperty(this, "APIGWCWRoleSetup", void 0);
487
487
  _defineProperty(this, "APIGWTrafficLogGroupName", void 0);
488
- _defineProperty(this, "ConfigServiceSetup", void 0);
489
- _defineProperty(this, "ConfigBucketName", void 0);
490
- _defineProperty(this, "ConfigBucketExists", void 0);
491
- _defineProperty(this, "DiscoveryQueueName", void 0);
492
- _defineProperty(this, "TraceabilityQueueName", void 0);
493
488
  _defineProperty(this, "DeploymentType", void 0);
494
489
  _defineProperty(this, "EC2VPCID", void 0);
495
490
  _defineProperty(this, "EC2KeyName", void 0);
@@ -502,9 +497,7 @@ class CloudFormationConfig {
502
497
  _defineProperty(this, "ECSCentralDiscoveryAgentName", void 0);
503
498
  _defineProperty(this, "ECSCentralTraceabilityAgentName", void 0);
504
499
  _defineProperty(this, "ECSCentralClientID", void 0);
505
- _defineProperty(this, "ECSCentralURL", void 0);
506
- _defineProperty(this, "ECSCentralDeployment", void 0);
507
- _defineProperty(this, "ECSCentralTraceabilityHost", void 0);
500
+ _defineProperty(this, "ECSCentralRegion", void 0);
508
501
  _defineProperty(this, "DiscoveryAgentLogGroupName", void 0);
509
502
  _defineProperty(this, "DiscoveryAgentVersion", void 0);
510
503
  _defineProperty(this, "TraceabilityAgentLogGroupName", void 0);
@@ -516,11 +509,6 @@ class CloudFormationConfig {
516
509
  this.AgentResourcesBucket = '';
517
510
  this.APIGWCWRoleSetup = 'true';
518
511
  this.APIGWTrafficLogGroupName = 'aws-apigw-traffic-logs';
519
- this.ConfigServiceSetup = 'true';
520
- this.ConfigBucketName = '';
521
- this.ConfigBucketExists = 'true';
522
- this.DiscoveryQueueName = 'aws-apigw-discovery';
523
- this.TraceabilityQueueName = 'aws-apigw-traceability';
524
512
  this.DeploymentType = 'EC2';
525
513
  this.EC2VPCID = '';
526
514
  this.EC2KeyName = '';
@@ -533,9 +521,7 @@ class CloudFormationConfig {
533
521
  this.ECSCentralClientID = '';
534
522
  this.ECSCentralDiscoveryAgentName = '';
535
523
  this.ECSCentralTraceabilityAgentName = '';
536
- this.ECSCentralURL = '';
537
- this.ECSCentralDeployment = '';
538
- this.ECSCentralTraceabilityHost = '';
524
+ this.ECSCentralRegion = '';
539
525
  this.DiscoveryAgentLogGroupName = 'amplify-discovery-agent-logs';
540
526
  this.DiscoveryAgentVersion = 'latest';
541
527
  this.TraceabilityAgentLogGroupName = 'amplify-traceability-agent-logs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.30.0-rc.0",
3
+ "version": "2.30.0-rc.3",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {