mkdir teams && cd teams && mkdir platform-team && mkdir application-team

aws iam create-user --user-name platform

cd platform-team && touch index.ts

import { ArnPrincipal } from "aws-cdk-lib/aws-iam";
import { PlatformTeam } from '@aws-quickstart/eks-blueprints';
export class TeamPlatform extends PlatformTeam {
constructor(accountID: string) {
super({
name: "platform",
users: [new ArnPrincipal(`arn:aws:iam::${accountID}:user/platform`)]
})
}
}
Giải thích đoạn code block:
Code block ở trên nhập ArnPrincipal construct từ mô-đun aws-cdk-lib/aws-iam cho AWS CDK để có thể thêm người dùng vào platform bằng thông tin đăng nhập IAM của họ.
Cách tốt nhất là mở rộng một class bằng cách sử dụng PlatformTeam class để những người thuộc platform/infrastucture của chúng ta có thể quản lý users/roles, trong khi các developer có thể chỉ cần tạo group bằng cách sử dụng các arugments được truyền vào.
Sau đó, chúng ta chuyển vào hai arugment: name và danh sách IAM user.

aws iam create-user --user-name application

cd ../application-team && touch index.ts

import { ArnPrincipal } from 'aws-cdk-lib/aws-iam';
import { ApplicationTeam } from '@aws-quickstart/eks-blueprints';
export class TeamApplication extends ApplicationTeam {
constructor(name: string, accountID: string) {
super({
name: name,
users: [new ArnPrincipal(`arn:aws:iam::${accountID}:user/application`)]
});
}
}
Application Team template sẽ thực hiện những việc sau:

cd .. && touch index.ts

export { TeamPlatform } from './platform-team';
export { TeamApplication } from './application-team';
