mkdir teams && cd teams && mkdir platform-team && mkdir application-team
aws iam create-user --user-name platform
cd platform-team && touch index.ts
c)
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`)]
})
}
}
Explanation of the code block:
The above code block imports ArnPrincipal construct from aws-cdk-lib/aws-iam module for AWS CDK so that users can be added to the platform with IAM credentials their.
The best way is to extend a class using PlatformTeam class so that our platform/infrastucture people can manage users/roles, while developers can simply create groups using the provided arugments transmisson.
Then we pass in two arguments: name and list of IAM users.
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`)]
});
}
}
The Application Team template will do the following things:
cd .. && touch index.ts
export { TeamPlatform } from './platform-team';
export { TeamApplication } from './application-team';