AwsAuth
Manages mapping between IAM users and roles to Kubernetes RBAC configuration.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_eks as eks } from 'aws-cdk-lib';
declare const cluster: eks.Cluster;
const awsAuth = new eks.AwsAuth(this, 'MyAwsAuth', {
cluster: cluster,
});
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_eks as eks
# cluster: eks.Cluster
aws_auth = eks.AwsAuth(self, "MyAwsAuth",
cluster=cluster
)
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EKS;
Cluster cluster;
var awsAuth = new AwsAuth(this, "MyAwsAuth", new AwsAuthProps {
Cluster = cluster
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var cluster Cluster
awsAuth := awscdk.Aws_eks.NewAwsAuth(this, jsii.String("MyAwsAuth"), &AwsAuthProps{
Cluster: cluster,
})
Initializer
new AwsAuth(scope: Construct, id: string, props: AwsAuthProps)
AwsAuth(scope: Construct, id: str, props: AwsAuthProps)
new AwsAuth(Construct scope, String id, AwsAuthProps props)
new AwsAuth(Construct scope, string id, AwsAuthProps props)
NewAwsAuth(Scope Construct, Id *string, Props AwsAuthProps)
Construct Props
Properties
Methods
addAccount(accountId: string): voiddef add_account(self, account_id: str) -> Nonepublic void addAccount(String accountId)public void AddAccount(string accountId)func AddAccount(AccountId *string)#1 parameter
Parameters
accountIdaccount_idaccountIdaccountIdAccountId— account number.
addMastersRole(role: IRole, username?: string): voiddef add_masters_role(self, role: IRole, username: typing.Optional[str] = None) -> Nonepublic void addMastersRole(IRole role, String username)public void AddMastersRole(IRole role, string? username = null)func AddMastersRole(Role IRole, Username *string)#2 parameters
Parameters
roleroleroleroleRole— The IAM role to add.usernameusernameusernameusernameUsername— Optional user (defaults to the role ARN).
addRoleMapping(role: IRole, mapping: AwsAuthMapping): voiddef add_role_mapping(self, role: IRole, mapping: AwsAuthMapping) -> Nonepublic void addRoleMapping(IRole role, AwsAuthMapping mapping)public void AddRoleMapping(IRole role, AwsAuthMapping mapping)func AddRoleMapping(Role IRole, Mapping AwsAuthMapping)#2 parameters
Parameters
roleroleroleroleRole— The IAM role to map.mappingmappingmappingmappingMapping— Mapping to k8s user name and groups.
addUserMapping(user: IUser, mapping: AwsAuthMapping): voiddef add_user_mapping(self, user: IUser, mapping: AwsAuthMapping) -> Nonepublic void addUserMapping(IUser user, AwsAuthMapping mapping)public void AddUserMapping(IUser user, AwsAuthMapping mapping)func AddUserMapping(User IUser, Mapping AwsAuthMapping)#2 parameters
Parameters
useruseruseruserUser— The IAM user to map.mappingmappingmappingmappingMapping— Mapping to k8s user name and groups.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.
1 parameter · returns
Parameters
mixinsmixinsmixinsmixinsMixins— The mixins to apply.
Returns: This construct for chaining