@studion/infra-code-blocks 2.0.0-alpha.5 → 2.0.0-alpha.7

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.
Files changed (70) hide show
  1. package/dist/components/cloudfront/index.d.ts.map +1 -1
  2. package/dist/components/cloudfront/index.js +19 -24
  3. package/dist/components/database/builder.d.ts +2 -3
  4. package/dist/components/database/builder.d.ts.map +1 -1
  5. package/dist/components/database/builder.js +12 -12
  6. package/dist/components/database/database-replica.d.ts.map +1 -1
  7. package/dist/components/database/database-replica.js +1 -0
  8. package/dist/components/database/index.d.ts +9 -5
  9. package/dist/components/database/index.d.ts.map +1 -1
  10. package/dist/components/database/index.js +30 -30
  11. package/dist/components/grafana/builder.d.ts +21 -0
  12. package/dist/components/grafana/builder.d.ts.map +1 -0
  13. package/dist/components/grafana/builder.js +57 -0
  14. package/dist/components/grafana/connections/amp-connection.d.ts +23 -0
  15. package/dist/components/grafana/connections/amp-connection.d.ts.map +1 -0
  16. package/dist/components/grafana/connections/amp-connection.js +73 -0
  17. package/dist/components/grafana/connections/cloudwatch-logs-connection.d.ts +18 -0
  18. package/dist/components/grafana/connections/cloudwatch-logs-connection.d.ts.map +1 -0
  19. package/dist/components/grafana/connections/cloudwatch-logs-connection.js +59 -0
  20. package/dist/components/grafana/connections/connection.d.ts +20 -0
  21. package/dist/components/grafana/connections/connection.d.ts.map +1 -0
  22. package/dist/components/grafana/connections/connection.js +57 -0
  23. package/dist/components/grafana/connections/index.d.ts +5 -0
  24. package/dist/components/grafana/connections/index.d.ts.map +1 -0
  25. package/dist/components/grafana/connections/index.js +11 -0
  26. package/dist/components/grafana/connections/xray-connection.d.ts +22 -0
  27. package/dist/components/grafana/connections/xray-connection.d.ts.map +1 -0
  28. package/dist/components/grafana/connections/xray-connection.js +76 -0
  29. package/dist/components/grafana/dashboards/builder.d.ts +22 -0
  30. package/dist/components/grafana/dashboards/builder.d.ts.map +1 -0
  31. package/dist/components/grafana/dashboards/builder.js +53 -0
  32. package/dist/components/grafana/dashboards/index.d.ts +2 -2
  33. package/dist/components/grafana/dashboards/index.d.ts.map +1 -1
  34. package/dist/components/grafana/dashboards/index.js +5 -4
  35. package/dist/components/grafana/dashboards/slo.d.ts +18 -0
  36. package/dist/components/grafana/dashboards/slo.d.ts.map +1 -0
  37. package/dist/components/grafana/dashboards/slo.js +77 -0
  38. package/dist/components/grafana/grafana.d.ts +19 -0
  39. package/dist/components/grafana/grafana.d.ts.map +1 -0
  40. package/dist/components/grafana/grafana.js +24 -0
  41. package/dist/components/grafana/index.d.ts +4 -0
  42. package/dist/components/grafana/index.d.ts.map +1 -1
  43. package/dist/components/grafana/index.js +11 -1
  44. package/dist/components/grafana/panels/availability.d.ts +15 -0
  45. package/dist/components/grafana/panels/availability.d.ts.map +1 -0
  46. package/dist/components/grafana/panels/availability.js +20 -0
  47. package/dist/components/grafana/panels/helpers.d.ts +6 -0
  48. package/dist/components/grafana/panels/helpers.d.ts.map +1 -0
  49. package/dist/components/grafana/panels/index.d.ts +6 -0
  50. package/dist/components/grafana/panels/index.d.ts.map +1 -0
  51. package/dist/components/grafana/panels/index.js +21 -0
  52. package/dist/components/grafana/panels/latency.d.ts +31 -0
  53. package/dist/components/grafana/panels/latency.d.ts.map +1 -0
  54. package/dist/components/grafana/panels/latency.js +36 -0
  55. package/dist/components/grafana/panels/success-rate.d.ts +22 -0
  56. package/dist/components/grafana/panels/success-rate.d.ts.map +1 -0
  57. package/dist/components/grafana/panels/success-rate.js +28 -0
  58. package/dist/components/grafana/panels/types.d.ts +57 -0
  59. package/dist/components/grafana/panels/types.d.ts.map +1 -0
  60. package/dist/components/web-server/index.js +1 -1
  61. package/package.json +30 -26
  62. package/dist/components/grafana/dashboards/panels.d.ts +0 -6
  63. package/dist/components/grafana/dashboards/panels.d.ts.map +0 -1
  64. package/dist/components/grafana/dashboards/types.d.ts +0 -66
  65. package/dist/components/grafana/dashboards/types.d.ts.map +0 -1
  66. package/dist/components/grafana/dashboards/web-server-slo.d.ts +0 -17
  67. package/dist/components/grafana/dashboards/web-server-slo.d.ts.map +0 -1
  68. package/dist/components/grafana/dashboards/web-server-slo.js +0 -98
  69. /package/dist/components/grafana/{dashboards/panels.js → panels/helpers.js} +0 -0
  70. /package/dist/components/grafana/{dashboards → panels}/types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/cloudfront/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,qBAAa,UAAW,SAAQ,MAAM,CAAC,iBAAiB;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC;IAC1C,cAAc,CAAC,EAAE,cAAc,CAAC;gBAG9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,IAAI,GAAE,MAAM,CAAC,wBAA6B;IA4D5C,OAAO,CAAC,yBAAyB;IAwCjC,OAAO,CAAC,gBAAgB;IAgFxB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,kBAAkB;IA0D1B,OAAO,CAAC,iBAAiB;CA4B1B;AAED,yBAAiB,UAAU,CAAC;IAC1B,MAAM,MAAM,YAAY;QACtB,EAAE,OAAO;QACT,EAAE,OAAO;QACT,MAAM,WAAW;KAClB;IAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG;QACtC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QACpC,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC;QAC/D;;;WAGG;Q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AC,OAAO,CAAC,CAAC;QACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzC,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,qBAAqB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,uBAAuB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAChD,CAAC;IAEF,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;IAEhE,MAAM,MAAM,IAAI,GAAG;QACjB;;;;;;;WAOG;QACH,SAAS,EAAE,QAAQ,EAAE,CAAC;QACtB;;;;;;;;WAQG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B;;;;;;;;;;;WAWG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAChD;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC;YAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACrC,CAAC,CAAC;KACJ,CAAC;IAEF,KAAK,YAAY,GAAG;QAClB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;;CACH"}
@@ -36,10 +36,10 @@ class CloudFront extends pulumi.ComponentResource {
36
36
  origins: this.createDistributionOrigins(behaviors),
37
37
  defaultCache: this.getCacheBehavior(defaultBehavior),
38
38
  orderedCaches: orderedBehaviors.length
39
- ? orderedBehaviors.map((it, idx) => ({
39
+ ? orderedBehaviors.map((it, idx) => this.getCacheBehavior(it, idx).apply(behavior => ({
40
40
  pathPattern: it.pathPattern,
41
- ...this.getCacheBehavior(it, idx),
42
- }))
41
+ ...behavior,
42
+ })))
43
43
  : undefined,
44
44
  domain,
45
45
  certificate: certificate || this.acmCertificate
@@ -105,27 +105,22 @@ class CloudFront extends pulumi.ComponentResource {
105
105
  bucket: behavior.bucket,
106
106
  cacheTtl: behavior.cacheTtl,
107
107
  }, { parent: this });
108
- return strategy.config;
108
+ return pulumi.output(strategy.config);
109
109
  }
110
110
  else if (isLbBehaviorType(behavior)) {
111
111
  const strategy = new lb_cache_strategy_1.LbCacheStrategy(getStrategyName('lb'), {
112
112
  pathPattern: behavior.pathPattern,
113
113
  loadBalancer: behavior.loadBalancer,
114
114
  }, { parent: this });
115
- return strategy.config;
115
+ return pulumi.output(strategy.config);
116
116
  }
117
117
  else if (isCustomBehaviorType(behavior)) {
118
- return {
118
+ return isS3Domain(behavior.domainName).apply(isS3 => ({
119
119
  targetOriginId: behavior.originId,
120
- allowedMethods: behavior.allowedMethods ?? [
121
- 'GET',
122
- 'HEAD',
123
- 'OPTIONS',
124
- 'PUT',
125
- 'POST',
126
- 'PATCH',
127
- 'DELETE',
128
- ],
120
+ allowedMethods: behavior.allowedMethods ??
121
+ (isS3
122
+ ? ['GET', 'HEAD']
123
+ : ['GET', 'HEAD', 'OPTIONS', 'PUT', 'POST', 'PATCH', 'DELETE']),
129
124
  cachedMethods: behavior.cachedMethods ?? ['GET', 'HEAD'],
130
125
  ...(behavior.compress != null && { compress: behavior.compress }),
131
126
  viewerProtocolPolicy: 'redirect-to-https',
@@ -134,20 +129,20 @@ class CloudFront extends pulumi.ComponentResource {
134
129
  .getCachePolicyOutput({ name: 'Managed-CachingDisabled' })
135
130
  .apply(p => p.id),
136
131
  originRequestPolicyId: behavior.originRequestPolicyId ??
137
- isS3Domain(behavior.domainName).apply(isS3 => aws.cloudfront
138
- .getOriginRequestPolicyOutput({
139
- name: isS3
140
- ? 'Managed-CORS-S3Origin'
141
- : 'Managed-AllViewerExceptHostHeader',
142
- })
143
- .apply(p => p.id)),
132
+ (isS3
133
+ ? undefined
134
+ : aws.cloudfront
135
+ .getOriginRequestPolicyOutput({
136
+ name: 'Managed-AllViewerExceptHostHeader',
137
+ })
138
+ .apply(p => p.id)),
144
139
  responseHeadersPolicyId: behavior.responseHeadersPolicyId ??
145
140
  aws.cloudfront
146
141
  .getResponseHeadersPolicyOutput({
147
142
  name: 'Managed-SecurityHeadersPolicy',
148
143
  })
149
144
  .apply(p => p.id),
150
- };
145
+ }));
151
146
  }
152
147
  else {
153
148
  throw new Error('Unknown CloudFront behavior encountered during mapping to distribution cache behaviors.');
@@ -205,7 +200,7 @@ class CloudFront extends pulumi.ComponentResource {
205
200
  });
206
201
  }
207
202
  createAliasRecord({ hostedZoneId, }) {
208
- return this.distribution.aliases.apply(aliases => aliases?.map((alias, index) => new aws.route53.Record(`${this.name}-cloudfront-alias-record-${index}`, {
203
+ return this.distribution.aliases.apply(aliases => aliases?.map((alias, index) => new aws.route53.Record(`${this.name}-dns-a-record-${index}`, {
209
204
  type: 'A',
210
205
  name: alias,
211
206
  zoneId: hostedZoneId,
@@ -11,8 +11,7 @@ export declare class DatabaseBuilder {
11
11
  private kmsKeyId?;
12
12
  private parameterGroupName?;
13
13
  private tags?;
14
- private createReplica?;
15
- private replicaConfig?;
14
+ private replicaConfigs;
16
15
  private enableSSMConnect?;
17
16
  private ssmConnectConfig?;
18
17
  constructor(name: string);
@@ -25,7 +24,7 @@ export declare class DatabaseBuilder {
25
24
  withKms(kmsKeyId: Database.Args['kmsKeyId']): this;
26
25
  withParameterGroup(parameterGroupName: Database.Args['parameterGroupName']): this;
27
26
  withTags(tags: Database.Args['tags']): this;
28
- withReplica(replicaConfig?: Database.Args['replicaConfig']): this;
27
+ addReplica(name: string, replicaConfig?: Database.ReplicaConfig): this;
29
28
  withSSMConnect(ssmConnectConfig?: Database.Args['ssmConnectConfig']): this;
30
29
  build(opts?: pulumi.ComponentResourceOptions): Database;
31
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","source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AC,OAAY,GAAG,IAAI;IAMvD,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI;IAMxC,cAAc,IAAI,IAAI;IAMtB,YAAY,CACjB,kBAAkB,EAAE,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,GACtD,IAAI;IAMA,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI;IAMlD,kBAAkB,CACvB,kBAAkB,EAAE,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,GACtD,IAAI;IAMA,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI;IAM3C,UAAU,CACf,IAAI,EAAE,MAAM,EACZ,aAAa,GAAE,QAAQ,CAAC,aAAkB,GACzC,IAAI;IAMA,cAAc,CACnB,gBAAgB,GAAE,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAM;IAQnD,KAAK,CAAC,IAAI,GAAE,MAAM,CAAC,wBAA6B,GAAG,QAAQ;CA4DnE"}
@@ -14,8 +14,7 @@ class DatabaseBuilder {
14
14
  kmsKeyId;
15
15
  parameterGroupName;
16
16
  tags;
17
- createReplica;
18
- replicaConfig;
17
+ replicaConfigs = new Map();
19
18
  enableSSMConnect;
20
19
  ssmConnectConfig;
21
20
  constructor(name) {
@@ -57,9 +56,8 @@ class DatabaseBuilder {
57
56
  this.tags = tags;
58
57
  return this;
59
58
  }
60
- withReplica(replicaConfig = {}) {
61
- this.createReplica = true;
62
- this.replicaConfig = replicaConfig;
59
+ addReplica(name, replicaConfig = {}) {
60
+ this.replicaConfigs.set(name, replicaConfig);
63
61
  return this;
64
62
  }
65
63
  withSSMConnect(ssmConnectConfig = {}) {
@@ -80,11 +78,14 @@ class DatabaseBuilder {
80
78
  if (this.snapshotIdentifier && this.credentialsConfig?.username) {
81
79
  throw new Error(`You can't set username when using snapshotIdentifier.`);
82
80
  }
83
- if (this.createReplica && this.replicaConfig?.enableMonitoring) {
84
- if (!this.enableMonitoring && !this.replicaConfig.monitoringRole) {
85
- throw new Error(`If you want enable monitoring on the replica instance either provide monitoring role or
86
- enable monitoring on the primary instance to reuse the same monitoring role.`);
87
- }
81
+ if (this.replicaConfigs?.size) {
82
+ this.replicaConfigs.forEach(config => {
83
+ if (config.enableMonitoring &&
84
+ !this.enableMonitoring &&
85
+ !config.monitoringRole) {
86
+ throw new Error('To enable replica monitoring, either provide a monitoring role or enable primary instance monitoring.');
87
+ }
88
+ });
88
89
  }
89
90
  if (!this.vpc) {
90
91
  throw new Error('VPC not provided. Make sure to call DatabaseBuilder.withVpc().');
@@ -99,8 +100,7 @@ class DatabaseBuilder {
99
100
  kmsKeyId: this.kmsKeyId,
100
101
  parameterGroupName: this.parameterGroupName,
101
102
  tags: this.tags,
102
- createReplica: this.createReplica,
103
- replicaConfig: this.replicaConfig,
103
+ replicaConfigs: this.replicaConfigs,
104
104
  enableSSMConnect: this.enableSSMConnect,
105
105
  ssmConnectConfig: this.ssmConnectConfig,
106
106
  }, opts);
@@ -1 +1 @@
1
- {"version":3,"file":"database-replica.d.ts","sourceRoot":"","sources":["../../../src/components/database/database-replica.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAIzC,yBAAiB,eAAe,CAAC;IAC/B,KAAY,QAAQ,GAAG;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAChC,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,wBAAwB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACjD,uBAAuB,CAAC,EAAE,MAAM,CAAC,KAAK,C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C;SACrC,CAAC,CAAC;KACJ,CAAC;CACL;AAaD,qBAAa,eAAgB,SAAQ,MAAM,CAAC,iBAAiB;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAGzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,CAAC,IAAI,EAC1B,IAAI,GAAE,MAAM,CAAC,wBAA6B;IAmB5C,OAAO,CAAC,sBAAsB;CA4C/B"}
@@ -55,6 +55,7 @@ class DatabaseReplica extends pulumi.ComponentResource {
55
55
  storageEncrypted: true,
56
56
  publiclyAccessible: false,
57
57
  skipFinalSnapshot: true,
58
+ maintenanceWindow: 'Mon:07:00-Mon:07:30',
58
59
  ...monitoringOptions,
59
60
  tags: { ...common_tags_1.commonTags, ...argsWithDefaults.tags },
60
61
  }, { parent: this, dependsOn: opts.dependsOn });
@@ -1,5 +1,4 @@
1
1
  import * as aws from '@pulumi/aws';
2
- import * as awsNative from '@pulumi/aws-native';
3
2
  import * as awsx from '@pulumi/awsx';
4
3
  import * as pulumi from '@pulumi/pulumi';
5
4
  import { DatabaseReplica } from './database-replica';
@@ -14,6 +13,7 @@ export declare namespace Database {
14
13
  allowMajorVersionUpgrade?: pulumi.Input<boolean>;
15
14
  autoMinorVersionUpgrade?: pulumi.Input<boolean>;
16
15
  applyImmediately?: pulumi.Input<boolean>;
16
+ skipFinalSnapshot?: pulumi.Input<boolean>;
17
17
  };
18
18
  type Credentials = {
19
19
  username?: pulumi.Input<string>;
@@ -24,6 +24,11 @@ export declare namespace Database {
24
24
  maxAllocatedStorage?: pulumi.Input<number>;
25
25
  };
26
26
  type ReplicaConfig = Partial<Omit<DatabaseReplica.Args, 'replicateSourceDb' | keyof DatabaseReplica.Security>> & {
27
+ /**
28
+ * Enables monitoring for the replica instance and
29
+ * reuses the same monitoring role from the primary instance
30
+ * if you don't provide a custom `monitoringRole`.
31
+ */
27
32
  enableMonitoring?: pulumi.Input<boolean>;
28
33
  };
29
34
  type SSMConnectConfig = Omit<Ec2SSMConnect.Args, 'vpc'>;
@@ -33,8 +38,7 @@ export declare namespace Database {
33
38
  snapshotIdentifier?: pulumi.Input<string>;
34
39
  parameterGroupName?: pulumi.Input<string>;
35
40
  kmsKeyId?: pulumi.Input<string>;
36
- createReplica?: pulumi.Input<boolean>;
37
- replicaConfig?: ReplicaConfig;
41
+ replicaConfigs?: Map<string, ReplicaConfig>;
38
42
  enableSSMConnect?: pulumi.Input<boolean>;
39
43
  ssmConnectConfig?: SSMConnectConfig;
40
44
  tags?: pulumi.Input<{
@@ -44,7 +48,7 @@ export declare namespace Database {
44
48
  }
45
49
  export declare class Database extends pulumi.ComponentResource {
46
50
  name: string;
47
- instance: awsNative.rds.DbInstance;
51
+ instance: aws.rds.Instance;
48
52
  vpc: pulumi.Output<awsx.ec2.Vpc>;
49
53
  dbSubnetGroup: aws.rds.SubnetGroup;
50
54
  dbSecurityGroup: aws.ec2.SecurityGroup;
@@ -52,7 +56,7 @@ export declare class Database extends pulumi.ComponentResource {
52
56
  kmsKeyId: pulumi.Output<string>;
53
57
  monitoringRole?: aws.iam.Role;
54
58
  encryptedSnapshotCopy?: aws.rds.SnapshotCopy;
55
- replica?: DatabaseReplica;
59
+ replicas?: DatabaseReplica[];
56
60
  ec2SSMConnect?: Ec2SSMConnect;
57
61
  constructor(name: string, args: Database.Args, opts?: pulumi.ComponentResourceOptions);
58
62
  private createSubnetGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/database/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EA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B;IAmB3B,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,oBAAoB;IAiC5B,OAAO,CAAC,2BAA2B;IAsBnC,OAAO,CAAC,qBAAqB;IAqB7B,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,sBAAsB;CAkD/B"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Database = void 0;
4
4
  const aws = require("@pulumi/aws");
5
- const awsNative = require("@pulumi/aws-native");
6
5
  const pulumi = require("@pulumi/pulumi");
7
6
  const common_tags_1 = require("../../shared/common-tags");
8
7
  const database_replica_1 = require("./database-replica");
@@ -12,6 +11,7 @@ const password_1 = require("../password");
12
11
  const defaults = {
13
12
  multiAz: false,
14
13
  applyImmediately: false,
14
+ skipFinalSnapshot: false,
15
15
  allocatedStorage: 20,
16
16
  maxAllocatedStorage: 100,
17
17
  instanceClass: 'db.t4g.micro',
@@ -30,7 +30,7 @@ class Database extends pulumi.ComponentResource {
30
30
  kmsKeyId;
31
31
  monitoringRole;
32
32
  encryptedSnapshotCopy;
33
- replica;
33
+ replicas;
34
34
  ec2SSMConnect;
35
35
  constructor(name, args, opts = {}) {
36
36
  super('studion:database:Database', name, {}, {
@@ -39,7 +39,7 @@ class Database extends pulumi.ComponentResource {
39
39
  });
40
40
  this.name = name;
41
41
  const argsWithDefaults = (0, merge_with_defaults_1.mergeWithDefaults)(defaults, args);
42
- const { vpc, kmsKeyId, enableMonitoring, snapshotIdentifier, createReplica, replicaConfig = {}, enableSSMConnect, ssmConnectConfig = {}, } = argsWithDefaults;
42
+ const { vpc, kmsKeyId, enableMonitoring, snapshotIdentifier, replicaConfigs, enableSSMConnect, ssmConnectConfig = {}, } = argsWithDefaults;
43
43
  this.vpc = pulumi.output(vpc);
44
44
  this.dbSubnetGroup = this.createSubnetGroup();
45
45
  this.dbSecurityGroup = this.createSecurityGroup();
@@ -55,8 +55,8 @@ class Database extends pulumi.ComponentResource {
55
55
  this.createEncryptedSnapshotCopy(snapshotIdentifier);
56
56
  }
57
57
  this.instance = this.createDatabaseInstance(argsWithDefaults);
58
- if (createReplica) {
59
- this.replica = this.createDatabaseReplica(replicaConfig);
58
+ if (replicaConfigs?.size) {
59
+ this.replicas = [...replicaConfigs.entries()].map(([name, config]) => this.createDatabaseReplica(name, config));
60
60
  }
61
61
  if (enableSSMConnect) {
62
62
  this.ec2SSMConnect = this.createEc2SSMConnect(ssmConnectConfig);
@@ -127,15 +127,16 @@ class Database extends pulumi.ComponentResource {
127
127
  kmsKeyId: this.kmsKeyId,
128
128
  }, { parent: this });
129
129
  }
130
- createDatabaseReplica(config = {}) {
131
- const monitoringRole = config.enableMonitoring
132
- ? config.monitoringRole || this.monitoringRole
130
+ createDatabaseReplica(name, config) {
131
+ const { enableMonitoring, monitoringRole, ...args } = config;
132
+ const resolvedMonitoringRole = enableMonitoring
133
+ ? monitoringRole || this.monitoringRole
133
134
  : undefined;
134
- const replica = new database_replica_1.DatabaseReplica(`${this.name}-replica`, {
135
- replicateSourceDb: this.instance.dbInstanceIdentifier.apply(id => id),
135
+ const replica = new database_replica_1.DatabaseReplica(name, {
136
+ replicateSourceDb: this.instance.identifier.apply(id => id),
136
137
  dbSecurityGroup: this.dbSecurityGroup,
137
- monitoringRole,
138
- ...config,
138
+ monitoringRole: resolvedMonitoringRole,
139
+ ...args,
139
140
  }, { parent: this, dependsOn: [this.instance] });
140
141
  return replica;
141
142
  }
@@ -146,25 +147,26 @@ class Database extends pulumi.ComponentResource {
146
147
  }, { parent: this });
147
148
  }
148
149
  createDatabaseInstance(args) {
150
+ const stack = pulumi.getStack();
149
151
  const monitoringOptions = args.enableMonitoring && this.monitoringRole
150
152
  ? {
151
153
  monitoringInterval: 60,
152
154
  monitoringRoleArn: this.monitoringRole.arn,
153
- enablePerformanceInsights: true,
155
+ performanceInsightsEnabled: true,
154
156
  performanceInsightsRetentionPeriod: 7,
155
157
  }
156
158
  : {};
157
- const instance = new awsNative.rds.DbInstance(`${this.name}-rds`, {
158
- dbInstanceIdentifier: `${this.name}-db-instance`,
159
+ const instance = new aws.rds.Instance(`${this.name}-rds`, {
160
+ identifierPrefix: `${this.name}-`,
159
161
  engine: 'postgres',
160
162
  engineVersion: args.engineVersion,
161
- dbInstanceClass: args.instanceClass,
163
+ instanceClass: args.instanceClass,
162
164
  dbName: args.dbName,
163
- masterUsername: args.username,
164
- masterUserPassword: this.password.value,
165
+ username: args.username,
166
+ password: this.password.value,
165
167
  dbSubnetGroupName: this.dbSubnetGroup.name,
166
- vpcSecurityGroups: [this.dbSecurityGroup.id],
167
- allocatedStorage: args.allocatedStorage?.toString(),
168
+ vpcSecurityGroupIds: [this.dbSecurityGroup.id],
169
+ allocatedStorage: args.allocatedStorage,
168
170
  maxAllocatedStorage: args.maxAllocatedStorage,
169
171
  multiAz: args.multiAz,
170
172
  applyImmediately: args.applyImmediately,
@@ -173,18 +175,16 @@ class Database extends pulumi.ComponentResource {
173
175
  kmsKeyId: this.kmsKeyId,
174
176
  storageEncrypted: true,
175
177
  publiclyAccessible: false,
176
- preferredMaintenanceWindow: 'Mon:07:00-Mon:07:30',
177
- preferredBackupWindow: '06:00-06:30',
178
+ skipFinalSnapshot: args.skipFinalSnapshot,
179
+ maintenanceWindow: 'Mon:07:00-Mon:07:30',
180
+ finalSnapshotIdentifier: `${this.name}-final-snapshot-${stack}`,
181
+ backupWindow: '06:00-06:30',
178
182
  backupRetentionPeriod: 14,
179
- caCertificateIdentifier: 'rds-ca-rsa2048-g1',
180
- dbParameterGroupName: args.parameterGroupName,
181
- dbSnapshotIdentifier: this.encryptedSnapshotCopy?.targetDbSnapshotIdentifier,
183
+ caCertIdentifier: 'rds-ca-rsa2048-g1',
184
+ parameterGroupName: args.parameterGroupName,
185
+ snapshotIdentifier: this.encryptedSnapshotCopy?.targetDbSnapshotIdentifier,
182
186
  ...monitoringOptions,
183
- tags: pulumi
184
- .output(args.tags)
185
- .apply(tags => [
186
- ...Object.entries({ ...common_tags_1.commonTags, ...tags }).map(([key, value]) => ({ key, value })),
187
- ]),
187
+ tags: { ...common_tags_1.commonTags, ...args.tags },
188
188
  }, { parent: this, dependsOn: [this.password] });
189
189
  return instance;
190
190
  }
@@ -0,0 +1,21 @@
1
+ import * as pulumi from '@pulumi/pulumi';
2
+ import { AMPConnection, CloudWatchLogsConnection, GrafanaConnection, XRayConnection } from './connections';
3
+ import { Grafana } from './grafana';
4
+ import type { GrafanaDashboardBuilder } from './dashboards/builder';
5
+ import { SloDashboard } from './dashboards/slo';
6
+ export declare class GrafanaBuilder {
7
+ private readonly name;
8
+ private readonly connectionBuilders;
9
+ private readonly dashboardBuilders;
10
+ private folderName?;
11
+ constructor(name: string);
12
+ withFolderName(folderName: string): this;
13
+ addAmp(name: string, args: AMPConnection.Args): this;
14
+ addCLoudWatchLogs(name: string, args: CloudWatchLogsConnection.Args): this;
15
+ addXRay(name: string, args: XRayConnection.Args): this;
16
+ addConnection(builder: GrafanaConnection.CreateConnection): this;
17
+ addSloDashboard(config: SloDashboard.Args): this;
18
+ addDashboard(dashboard: GrafanaDashboardBuilder.CreateDashboard): this;
19
+ build(opts?: pulumi.ComponentResourceOptions): Grafana;
20
+ }
21
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/components/grafana/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAsB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEpE,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAC9B;IACL,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAC7B;IACL,OAAO,CAAC,UAAU,CAAC,CAAS;gBAEhB,IAAI,EAAE,MAAM;IAIjB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAMxC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI,GAAG,IAAI;IAMpD,iBAAiB,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,wBAAwB,CAAC,IAAI,GAClC,IAAI;IAQA,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,GAAG,IAAI;IAMtD,aAAa,CAAC,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,IAAI;IAMhE,eAAe,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,GAAG,IAAI;IAMhD,YAAY,CACjB,SAAS,EAAE,uBAAuB,CAAC,eAAe,GACjD,IAAI;IAMA,KAAK,CAAC,IAAI,GAAE,MAAM,CAAC,wBAA6B,GAAG,OAAO;CAuBlE"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GrafanaBuilder = void 0;
4
+ const connections_1 = require("./connections");
5
+ const grafana_1 = require("./grafana");
6
+ const slo_1 = require("./dashboards/slo");
7
+ class GrafanaBuilder {
8
+ name;
9
+ connectionBuilders = [];
10
+ dashboardBuilders = [];
11
+ folderName;
12
+ constructor(name) {
13
+ this.name = name;
14
+ }
15
+ withFolderName(folderName) {
16
+ this.folderName = folderName;
17
+ return this;
18
+ }
19
+ addAmp(name, args) {
20
+ this.connectionBuilders.push(opts => new connections_1.AMPConnection(name, args, opts));
21
+ return this;
22
+ }
23
+ addCLoudWatchLogs(name, args) {
24
+ this.connectionBuilders.push(opts => new connections_1.CloudWatchLogsConnection(name, args, opts));
25
+ return this;
26
+ }
27
+ addXRay(name, args) {
28
+ this.connectionBuilders.push(opts => new connections_1.XRayConnection(name, args, opts));
29
+ return this;
30
+ }
31
+ addConnection(builder) {
32
+ this.connectionBuilders.push(builder);
33
+ return this;
34
+ }
35
+ addSloDashboard(config) {
36
+ this.dashboardBuilders.push((0, slo_1.createSloDashboard)(config));
37
+ return this;
38
+ }
39
+ addDashboard(dashboard) {
40
+ this.dashboardBuilders.push(dashboard);
41
+ return this;
42
+ }
43
+ build(opts = {}) {
44
+ if (!this.connectionBuilders.length) {
45
+ throw new Error('At least one connection is required. Call addConnection() to add a custom connection or use one of the existing connection builders.');
46
+ }
47
+ if (!this.dashboardBuilders.length) {
48
+ throw new Error('At least one dashboard is required. Call addDashboard() to add a custom dashboard or use one of the existing dashboard builders.');
49
+ }
50
+ return new grafana_1.Grafana(this.name, {
51
+ connectionBuilders: this.connectionBuilders,
52
+ dashboardBuilders: this.dashboardBuilders,
53
+ folderName: this.folderName,
54
+ }, opts);
55
+ }
56
+ }
57
+ exports.GrafanaBuilder = GrafanaBuilder;
@@ -0,0 +1,23 @@
1
+ import * as aws from '@pulumi/aws';
2
+ import * as pulumi from '@pulumi/pulumi';
3
+ import * as grafana from '@pulumiverse/grafana';
4
+ import { GrafanaConnection } from './connection';
5
+ export declare namespace AMPConnection {
6
+ type Args = GrafanaConnection.Args & {
7
+ endpoint: pulumi.Input<string>;
8
+ region?: string;
9
+ pluginVersion?: string;
10
+ installPlugin?: boolean;
11
+ };
12
+ }
13
+ export declare class AMPConnection extends GrafanaConnection {
14
+ readonly name: string;
15
+ readonly dataSource: grafana.oss.DataSource;
16
+ readonly rolePolicy: aws.iam.RolePolicy;
17
+ readonly plugin?: grafana.cloud.PluginInstallation;
18
+ constructor(name: string, args: AMPConnection.Args, opts?: pulumi.ComponentResourceOptions);
19
+ private createRolePolicy;
20
+ private createPlugin;
21
+ private createDataSource;
22
+ }
23
+ //# sourceMappingURL=amp-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amp-connection.d.ts","sourceRoot":"","sources":["../../../../src/components/grafana/connections/amp-connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKjD,yBAAiB,aAAa,CAAC;IAC7B,KAAY,IAAI,GAAG,iBAAiB,CAAC,IAAI,GAAG;QAC1C,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH;AAQD,qBAAa,aAAc,SAAQ,iBAAiB;IAClD,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;IACnD,SAAgB,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;IAC/C,SAAgB,MAAM,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC;gBAGxD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,CAAC,IAAI,EACxB,IAAI,GAAE,MAAM,CAAC,wBAA6B;IAsB5C,OAAO,CAAC,gBAAgB;IA0BxB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,gBAAgB;CAoBzB"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AMPConnection = void 0;
4
+ const aws = require("@pulumi/aws");
5
+ const pulumi = require("@pulumi/pulumi");
6
+ const grafana = require("@pulumiverse/grafana");
7
+ const merge_with_defaults_1 = require("../../../shared/merge-with-defaults");
8
+ const connection_1 = require("./connection");
9
+ const awsConfig = new pulumi.Config('aws');
10
+ const pluginName = 'grafana-amazonprometheus-datasource';
11
+ const defaults = {
12
+ region: awsConfig.require('region'),
13
+ pluginVersion: 'latest',
14
+ installPlugin: true,
15
+ };
16
+ class AMPConnection extends connection_1.GrafanaConnection {
17
+ name;
18
+ dataSource;
19
+ rolePolicy;
20
+ plugin;
21
+ constructor(name, args, opts = {}) {
22
+ super('studion:grafana:AMPConnection', name, args, opts);
23
+ const argsWithDefaults = (0, merge_with_defaults_1.mergeWithDefaults)(defaults, args);
24
+ this.name = name;
25
+ this.rolePolicy = this.createRolePolicy();
26
+ if (argsWithDefaults.installPlugin) {
27
+ this.plugin = this.createPlugin(argsWithDefaults.pluginVersion);
28
+ }
29
+ this.dataSource = this.createDataSource(argsWithDefaults.region, argsWithDefaults.endpoint);
30
+ this.registerOutputs();
31
+ }
32
+ createRolePolicy() {
33
+ const policy = aws.iam.getPolicyDocumentOutput({
34
+ statements: [
35
+ {
36
+ effect: 'Allow',
37
+ actions: [
38
+ 'aps:GetSeries',
39
+ 'aps:GetLabels',
40
+ 'aps:GetMetricMetadata',
41
+ 'aps:QueryMetrics',
42
+ ],
43
+ resources: ['*'],
44
+ },
45
+ ],
46
+ });
47
+ return new aws.iam.RolePolicy(`${this.name}-amp-policy`, {
48
+ role: this.role.id,
49
+ policy: policy.json,
50
+ }, { parent: this });
51
+ }
52
+ createPlugin(pluginVersion) {
53
+ return new grafana.cloud.PluginInstallation(`${this.name}-amp-plugin`, {
54
+ stackSlug: this.getStackSlug(),
55
+ slug: pluginName,
56
+ version: pluginVersion,
57
+ }, { parent: this });
58
+ }
59
+ createDataSource(region, endpoint) {
60
+ return new grafana.oss.DataSource(`${this.name}-amp-datasource`, {
61
+ name: this.dataSourceName,
62
+ type: pluginName,
63
+ url: endpoint,
64
+ jsonDataEncoded: pulumi.jsonStringify({
65
+ sigV4Auth: true,
66
+ sigV4AuthType: 'grafana_assume_role',
67
+ sigV4Region: region,
68
+ sigV4AssumeRoleArn: this.role.arn,
69
+ }),
70
+ }, { dependsOn: this.plugin ? [this.plugin] : [], parent: this });
71
+ }
72
+ }
73
+ exports.AMPConnection = AMPConnection;
@@ -0,0 +1,18 @@
1
+ import * as aws from '@pulumi/aws';
2
+ import * as pulumi from '@pulumi/pulumi';
3
+ import * as grafana from '@pulumiverse/grafana';
4
+ import { GrafanaConnection } from './connection';
5
+ export declare namespace CloudWatchLogsConnection {
6
+ type Args = GrafanaConnection.Args & {
7
+ region?: string;
8
+ };
9
+ }
10
+ export declare class CloudWatchLogsConnection extends GrafanaConnection {
11
+ readonly name: string;
12
+ readonly dataSource: grafana.oss.DataSource;
13
+ readonly rolePolicy: aws.iam.RolePolicy;
14
+ constructor(name: string, args: CloudWatchLogsConnection.Args, opts?: pulumi.ComponentResourceOptions);
15
+ private createRolePolicy;
16
+ private createDataSource;
17
+ }
18
+ //# sourceMappingURL=cloudwatch-logs-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudwatch-logs-connection.d.ts","sourceRoot":"","sources":["../../../../src/components/grafana/connections/cloudwatch-logs-connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIjD,yBAAiB,wBAAwB,CAAC;IACxC,KAAY,IAAI,GAAG,iBAAiB,CAAC,IAAI,GAAG;QAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAMD,qBAAa,wBAAyB,SAAQ,iBAAiB;IAC7D,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;IACnD,SAAgB,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;gBAG7C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,wBAAwB,CAAC,IAAI,EACnC,IAAI,GAAE,MAAM,CAAC,wBAA6B;IAc5C,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,gBAAgB;CAezB"}