terruvim-core-test 0.0.1 → 0.0.2

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.
@@ -116,7 +116,7 @@ function loadProviders(config) {
116
116
  providers[name] = new aws.Provider(name, {
117
117
  region: provCfg.region,
118
118
  profile: provCfg.profile,
119
- assumeRole: provCfg.assumeRole,
119
+ assumeRoles: provCfg.assumeRole ? [provCfg.assumeRole] : undefined,
120
120
  });
121
121
  }
122
122
  return providers;
@@ -53,9 +53,9 @@ class BackupPolicy extends pulumi.ComponentResource {
53
53
  for (const accountName of Object.keys(args.accounts)) {
54
54
  const account = args.accounts[accountName];
55
55
  const accountProvider = new aws.Provider(`${accountName}Provider`, {
56
- assumeRole: {
57
- roleArn: pulumi.interpolate `arn:aws:iam::${account.id}:role/${this.assumeRoleName}`,
58
- },
56
+ assumeRoles: [{
57
+ roleArn: pulumi.interpolate `arn:aws:iam::${account.id}:role/${this.assumeRoleName}`,
58
+ }],
59
59
  allowedAccountIds: [account.id],
60
60
  }, { parent: this });
61
61
  this.createBackupVault(accountName, accountProvider);
@@ -54,7 +54,8 @@ function createListenerRule(params, provider) {
54
54
  pathPattern: { values: [params.path] }
55
55
  });
56
56
  }
57
- return new aws.lb.ListenerRule(`${params.environment}-${params.name}-rule-${params.priority}`, {
57
+ // Build rule arguments object
58
+ const ruleArgs = {
58
59
  listenerArn: params.listenerArn,
59
60
  priority: params.priority,
60
61
  actions: [
@@ -64,5 +65,15 @@ function createListenerRule(params, provider) {
64
65
  },
65
66
  ],
66
67
  conditions,
67
- }, provider ? { provider } : undefined);
68
+ };
69
+ // Add transforms if provided (using any to bypass TypeScript check for older type definitions)
70
+ if (params.transforms && params.transforms.length > 0) {
71
+ //console.log(`[createListenerRule] Adding transforms for rule priority ${params.priority}:`, JSON.stringify(params.transforms, null, 2));
72
+ ruleArgs.transforms = params.transforms;
73
+ }
74
+ else {
75
+ //console.log(`[createListenerRule] No transforms for rule priority ${params.priority}`);
76
+ }
77
+ //console.log(`[createListenerRule] Final ruleArgs for priority ${params.priority}:`, JSON.stringify(ruleArgs, null, 2));
78
+ return new aws.lb.ListenerRule(`${params.environment}-${params.name}-rule-${params.priority}`, ruleArgs, provider ? { provider } : undefined);
68
79
  }
@@ -141,14 +141,19 @@ class ServiceFactory extends resourceFactory_1.ResourceFactory {
141
141
  if (enableTargetGroup && enableAlbListenerRules && tg) {
142
142
  const listenerRulePriority = (0, getDeterministicPriority_1.getDeterministicPriority)(config.id, configuration.priority);
143
143
  if (Array.isArray(configuration.albListenerRules) && configuration.albListenerRules.length > 0) {
144
- listenerRules = configuration.albListenerRules.map((rule, idx) => tg ? (0, createListenerRule_1.createListenerRule)({
145
- name: configuration.name,
146
- environment: meta.environment,
147
- listenerArn: inputs.albListenerArn,
148
- priority: rule.priority || (0, getDeterministicPriority_1.getDeterministicPriority)(`${config.id}-${idx}`),
149
- targetGroupArn: tg.arn,
150
- conditions: rule.conditions
151
- }, provider) : undefined).filter(Boolean);
144
+ //console.log(`[ecsServiceFactory] Processing ${configuration.albListenerRules.length} ALB listener rules for service: ${configuration.name}`);
145
+ listenerRules = configuration.albListenerRules.map((rule, idx) => {
146
+ //console.log(`[ecsServiceFactory] Rule ${idx} RAW from config:`, JSON.stringify(rule, null, 2));
147
+ return tg ? (0, createListenerRule_1.createListenerRule)({
148
+ name: configuration.name,
149
+ environment: meta.environment,
150
+ listenerArn: inputs.albListenerArn,
151
+ priority: rule.priority || (0, getDeterministicPriority_1.getDeterministicPriority)(`${config.id}-${idx}`),
152
+ targetGroupArn: tg.arn,
153
+ conditions: rule.conditions,
154
+ transforms: rule.transforms // Pass through transforms configuration (AWS native format)
155
+ }, provider) : undefined;
156
+ }).filter(Boolean);
152
157
  }
153
158
  else {
154
159
  if (tg) {
@@ -166,9 +166,9 @@ class OrganizationFactory extends resourceFactory_1.ResourceFactory {
166
166
  const roleName = providerConfig.roleName;
167
167
  this.providers[providerConfig.name] = new aws.Provider(providerConfig.name, {
168
168
  allowedAccountIds: [accountId],
169
- assumeRole: {
170
- roleArn: pulumi.interpolate `arn:aws:iam::${accountId}:role/${roleName}`,
171
- },
169
+ assumeRoles: [{
170
+ roleArn: pulumi.interpolate `arn:aws:iam::${accountId}:role/${roleName}`,
171
+ }],
172
172
  });
173
173
  }
174
174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terruvim-core-test",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Core logic for Terruvim framework TEST",
5
5
  "private": false,
6
6
  "main": "dist/src/core/entrypoint.js",
@@ -31,7 +31,6 @@
31
31
  "@aws-sdk/client-s3": "^3.837.0",
32
32
  "@aws-sdk/client-sns": "^3.835.0",
33
33
  "@aws-sdk/lib-dynamodb": "^3.835.0",
34
- "@pulumi/aws": "^6.83.0",
35
34
  "@pulumi/aws-apigateway": "^2.6.2",
36
35
  "@pulumi/awsx": "^2.22.0",
37
36
  "@pulumi/cloud-aws": "^0.40.2",
@@ -60,7 +59,11 @@
60
59
  "pcloudinit": "^0.1.0",
61
60
  "superagent": "^10.2.1"
62
61
  },
62
+ "peerDependencies": {
63
+ "@pulumi/aws": ">=7.16.0"
64
+ },
63
65
  "devDependencies": {
66
+ "@pulumi/aws": "^7.16.0",
64
67
  "@types/aws-lambda": "^8.10.150",
65
68
  "@types/jest": "^30.0.0",
66
69
  "@types/js-yaml": "^4.0.9",
@@ -68,4 +71,4 @@
68
71
  "@types/mustache": "^4.2.6",
69
72
  "typescript": "^5.3.0"
70
73
  }
71
- }
74
+ }