Skip to content

Commit d9a12f9

Browse files
authored
Merge pull request #16 from aws-samples/saestag
SAES Metrics tags
2 parents f541ce4 + 1fa73a9 commit d9a12f9

16 files changed

+76
-10
lines changed

server/lib/bootstrap-template/control-plane-stack.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import path = require('path');
55
import { StaticSite } from './static-site';
66
import { ControlPlaneNag } from '../cdknag/control-plane-nag';
77
import * as sbt from '@cdklabs/sbt-aws';
8+
import { addTemplateTag } from '../utilities/helper-functions';
89

910
interface ControlPlaneStackProps extends cdk.StackProps {
1011
systemAdminRoleName: string
@@ -20,7 +21,7 @@ export class ControlPlaneStack extends cdk.Stack {
2021

2122
constructor (scope: Construct, id: string, props: ControlPlaneStackProps) {
2223
super(scope, id, props);
23-
24+
addTemplateTag(this, 'ControlPlaneStack');
2425
const accessLogsBucket = new cdk.aws_s3.Bucket(this, 'AccessLogsBucket', {
2526
enforceSSL: true,
2627
autoDeleteObjects: true,

server/lib/bootstrap-template/core-appplane-stack.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as fs from 'fs';
77
import { UserInterface } from './user-interface';
88
import { CoreAppPlaneNag } from '../cdknag/core-app-plane-nag';
99
import * as sbt from '@cdklabs/sbt-aws';
10+
import { addTemplateTag } from '../utilities/helper-functions';
1011

1112
interface CoreAppPlaneStackProps extends cdk.StackProps {
1213
eventManager: sbt.IEventManager
@@ -19,6 +20,7 @@ export class CoreAppPlaneStack extends cdk.Stack {
1920
public readonly tenantMappingTable: Table;
2021
constructor (scope: Construct, id: string, props: CoreAppPlaneStackProps) {
2122
super(scope, id, props);
23+
addTemplateTag(this, 'CoreAppPlaneStack');
2224

2325
const systemAdminEmail = props.systemAdminEmail;
2426

server/lib/bootstrap-template/static-site-distro.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
44
import * as s3 from 'aws-cdk-lib/aws-s3';
55
import { Construct } from 'constructs';
66
import { RemovalPolicy } from 'aws-cdk-lib';
7+
import { addTemplateTag } from '../utilities/helper-functions';
78

89
export interface StaticSiteDistroProps {
910
readonly allowedMethods: string[]
@@ -16,6 +17,7 @@ export class StaticSiteDistro extends Construct {
1617

1718
constructor (scope: Construct, id: string, props: StaticSiteDistroProps) {
1819
super(scope, id);
20+
addTemplateTag(this, 'StaticSiteDistro');
1921
const { distribution, appBucket } = this.createStaticSite(
2022
id,
2123
props.allowedMethods,

server/lib/bootstrap-template/static-site.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
88
import * as kms from 'aws-cdk-lib/aws-kms';
99
import { Construct } from 'constructs';
1010
import { RemovalPolicy } from 'aws-cdk-lib';
11+
import { addTemplateTag } from '../utilities/helper-functions';
1112

1213
export interface StaticSiteProps {
1314
readonly name: string
@@ -28,7 +29,7 @@ export class StaticSite extends Construct {
2829

2930
constructor (scope: Construct, id: string, props: StaticSiteProps) {
3031
super(scope, id);
31-
32+
addTemplateTag(this, 'StaticSite');
3233
const defaultBranchName = props.defaultBranchName ?? 'main';
3334
const repository = new codecommit.Repository(this, `${id}Repository`, {
3435
repositoryName: props.name,

server/lib/shared-infra/api-gateway.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { type CustomApiKey } from '../interfaces/custom-api-key';
99
import { LogGroup } from 'aws-cdk-lib/aws-logs';
1010
import { Construct } from 'constructs';
1111
import { Duration } from 'aws-cdk-lib';
12+
import { addTemplateTag } from '../utilities/helper-functions';
1213

1314
interface ApiGatewayProps {
1415
lambdaEcsSaaSLayers: lambda.LayerVersion
@@ -28,7 +29,7 @@ export class ApiGateway extends Construct {
2829
public readonly requestValidator: apigateway.RequestValidator;
2930
constructor (scope: Construct, id: string, props: ApiGatewayProps) {
3031
super(scope, id);
31-
32+
addTemplateTag(this, 'ApiGateway');
3233
// 👇Create ACM Permission Policy
3334
const basicAuthorizerExecutionRole = new cdk.aws_iam.PolicyDocument({
3435
statements: [

server/lib/shared-infra/api-methods.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
22
import { type ApiGateway } from './api-gateway';
33
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
44
import { Construct } from 'constructs';
5+
import { addTemplateTag } from '../utilities/helper-functions';
56

67
export interface ApiMethodsProps {
78
serviceName: string
@@ -13,7 +14,7 @@ export interface ApiMethodsProps {
1314
export class ApiMethods extends Construct {
1415
constructor (scope: Construct, id: string, props: ApiMethodsProps) {
1516
super(scope, id);
16-
17+
addTemplateTag(this, 'ApiMethods');
1718
const integration = new apigateway.Integration({
1819
type: apigateway.IntegrationType.HTTP_PROXY,
1920
uri: `http://${props.nlb.loadBalancerDnsName}/${props.serviceName}`,

server/lib/shared-infra/shared-infra-stack.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { SharedInfraNag } from '../cdknag/shared-infra-nag';
1515
import { ApiGateway } from './api-gateway';
1616
import { type ApiKeySSMParameterNames } from '../interfaces/api-key-ssm-parameter-names';
1717
import { TenantApiKey } from './tenant-api-key';
18+
import { addTemplateTag } from '../utilities/helper-functions';
1819

1920
export interface SharedInfraProps extends cdk.StackProps {
2021
isPooledDeploy: boolean
@@ -39,7 +40,7 @@ export class SharedInfraStack extends cdk.Stack {
3940

4041
constructor (scope: Construct, id: string, props: SharedInfraProps) {
4142
super(scope, id);
42-
43+
addTemplateTag(this, 'SharedInfraStack');
4344
const azs = cdk.Fn.getAzs(this.region);
4445
// 스택의 리전에 있는 모든 가용 영역 목록 가져오기
4546

server/lib/shared-infra/tenant-api-key.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Construct } from 'constructs';
22
import { ApiKey } from 'aws-cdk-lib/aws-apigateway';
33
import { StringParameter } from 'aws-cdk-lib/aws-ssm';
4+
import { addTemplateTag } from '../utilities/helper-functions';
45

56
interface TenantApiKeyProps {
67
apiKeyValue: string
@@ -13,6 +14,7 @@ export class TenantApiKey extends Construct {
1314
apiKeyValue: string;
1415
constructor (scope: Construct, id: string, props: TenantApiKeyProps) {
1516
super(scope, id);
17+
addTemplateTag(this, 'TenantApiKey');
1618
this.apiKeyValue = props.apiKeyValue;
1719

1820
this.apiKey = new ApiKey(this, 'apiKey', {

server/lib/shared-infra/usage-plans.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Construct } from 'constructs';
22
import { ApiKey, Period, type RestApi, type UsagePlan } from 'aws-cdk-lib/aws-apigateway';
3+
import { addTemplateTag } from '../utilities/helper-functions';
34

45
interface UsagePlansProps {
56
apiGateway: RestApi
@@ -18,7 +19,7 @@ export class UsagePlans extends Construct {
1819
public readonly usagePlanSystemAdmin: UsagePlan;
1920
constructor (scope: Construct, id: string, props: UsagePlansProps) {
2021
super(scope, id);
21-
22+
addTemplateTag(this, 'UsagePlans');
2223
this.usagePlanBasicTier = props.apiGateway.addUsagePlan('UsagePlanBasicTier', {
2324
quota: {
2425
limit: 1000,

server/lib/tenant-template/ecs-cluster.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import getTimeString, { getHashCode } from '../utilities/helper-functions';
1414
import { type ContainerInfo } from '../interfaces/container-info';
1515
import { type RproxyInfo } from '../interfaces/rproxy-info';
1616
import { CustomEniTrunking } from './eni-trunking';
17+
import { addTemplateTag } from '../utilities/helper-functions';
1718

1819
export interface EcsClusterProps extends cdk.NestedStackProps {
1920
stageName: string
@@ -39,7 +40,7 @@ export class EcsCluster extends cdk.NestedStack {
3940

4041
constructor (scope: Construct, id: string, props: EcsClusterProps) {
4142
super(scope, id, props);
42-
43+
addTemplateTag(this, 'EcsClusterStack');
4344
const tenantId = props.tenantId;
4445
const timeStr = getTimeString();
4546
this.isEc2Tier = props.isEc2Tier;

0 commit comments

Comments
 (0)