Skip to content
v2.278.0

AwsAuthMapping Struct ​

AwsAuth mapping.

Example ​

ts
declare const cluster: eks.Cluster;
const adminUser = new iam.User(this, 'Admin');
cluster.awsAuth.addUserMapping(adminUser, { groups: [ 'system:masters' ]});
python
# cluster: eks.Cluster

admin_user = iam.User(self, "Admin")
cluster.aws_auth.add_user_mapping(admin_user, groups=["system:masters"])
java
Cluster cluster;

User adminUser = new User(this, "Admin");
cluster.awsAuth.addUserMapping(adminUser, AwsAuthMapping.builder().groups(List.of("system:masters")).build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;

var adminUser = new User(this, "Admin");
cluster.AwsAuth.AddUserMapping(adminUser, new AwsAuthMapping { Groups = new [] { "system:masters" } });
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster

adminUser := iam.NewUser(this, jsii.String("Admin"))
cluster.awsAuth.AddUserMapping(adminUser, &AwsAuthMapping{
	Groups: []*string{
		jsii.String("system:masters"),
	},
})

Properties ​

groupsstring[]groupstyping.List[str]groupsList<String>Groupsstring[]Groups*[]*string required #
A list of groups within Kubernetes to which the role is mapped.
usernameoptionalstringusernameoptionalstrusernameoptionalStringUsernameoptionalstringUsernameoptional*string #
The user name within Kubernetes to map to the IAM role.

Default: By default, the user name is the ARN of the IAM role.