@byaga/cdk-patterns 0.9.1 → 0.9.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.
@@ -9,6 +9,7 @@ export declare class DeployStack extends Stack {
9
9
  };
10
10
  stage: string;
11
11
  name: string;
12
+ project: string;
12
13
  genName(...name: string[]): string;
13
14
  genStackName(stackName: string, ...name: string[]): string;
14
15
  genId(...name: string[]): string;
@@ -6,6 +6,7 @@ class DeployStack extends aws_cdk_lib_1.Stack {
6
6
  registry = {};
7
7
  stage;
8
8
  name;
9
+ project;
9
10
  genName(...name) {
10
11
  return DeployStack.genStackResourceName(this.name, name.filter(n => !!n).join('-'), this.stage);
11
12
  }
@@ -37,8 +38,11 @@ class DeployStack extends aws_cdk_lib_1.Stack {
37
38
  const stack = this;
38
39
  stack.name = props.stackName || '';
39
40
  stack.stage = stage;
40
- stack.tags.setTag('Stage', stage);
41
- stack.tags.setTag('Stack', this.genName('ui-stack'));
41
+ stack.project = props.project;
42
+ stack.tags.setTag('stage', stage);
43
+ stack.tags.setTag('stack', this.genName('ui-stack'));
44
+ stack.tags.setTag('project', props.project);
45
+ stack.tags.setTag('owner', props.owner);
42
46
  }
43
47
  get(type, name) {
44
48
  const items = this.registry[type];
@@ -2,7 +2,7 @@ import { DeployStack } from "./DeployStack";
2
2
  import { IStringParameter } from "aws-cdk-lib/aws-ssm";
3
3
  import { IGrantable } from "aws-cdk-lib/aws-iam";
4
4
  import { IKey } from "aws-cdk-lib/aws-kms";
5
- interface SsmParameterOptions {
5
+ export interface SsmParameterOptions {
6
6
  decryptWithKey?: IKey;
7
7
  parameterGroup?: string;
8
8
  }
@@ -16,4 +16,3 @@ export declare class SsmParameter {
16
16
  get stringValue(): string;
17
17
  getParameter(): IStringParameter;
18
18
  }
19
- export {};
@@ -9,9 +9,10 @@ function applyHoneycombToLambda(stack, props) {
9
9
  honeyCombLayer = aws_lambda_1.LayerVersion.fromLayerVersionArn(stack, stack.genId('hc-layer'), `arn:aws:lambda:${stack.region}:702835727665:layer:honeycomb-lambda-extension-x86_64-v11-1-1:1`);
10
10
  const layers = props.layers ? [...props.layers] : [];
11
11
  const environment = props.environment || {};
12
+ const options = { parameterGroup: stack.project };
12
13
  layers.push(honeyCombLayer);
13
- environment.LIBHONEY_API_KEY = new SsmParameter_1.SsmParameter(stack, `/honeycomb/api-key`).stringValue;
14
- environment.LIBHONEY_DATASET = new SsmParameter_1.SsmParameter(stack, `/honeycomb/dataset`).stringValue;
14
+ environment.LIBHONEY_API_KEY = new SsmParameter_1.SsmParameter(stack, `/honeycomb/api-key`, options).stringValue;
15
+ environment.LIBHONEY_DATASET = new SsmParameter_1.SsmParameter(stack, `/honeycomb/dataset`, options).stringValue;
15
16
  environment.LOGS_API_DISABLE_PLATFORM_MSGS = "true";
16
17
  return {
17
18
  ...props,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byaga/cdk-patterns",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Collection of common patterns used when making AWS CloudFormation templates using CDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",