Class CfnAccessEntry
- All Implemented Interfaces:
IInspectable,IAccessEntryRef,IEnvironmentAware,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
An access entry allows an IAM principal to access your cluster. Access entries can replace the need to maintain entries in the aws-auth ConfigMap for authentication. You have the following options for authorizing an IAM principal to access Kubernetes objects on your cluster: Kubernetes role-based access control (RBAC), Amazon EKS, or both. Kubernetes RBAC authorization requires you to create and manage Kubernetes Role , ClusterRole , RoleBinding , and ClusterRoleBinding objects, in addition to managing access entries. If you use Amazon EKS authorization exclusively, you don't need to create and manage Kubernetes Role , ClusterRole , RoleBinding , and ClusterRoleBinding objects.
For more information about access entries, see Access entries in the Amazon EKS User Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.eks.*;
CfnAccessEntry cfnAccessEntry = CfnAccessEntry.Builder.create(this, "MyCfnAccessEntry")
.clusterName("clusterName")
.principalArn("principalArn")
// the properties below are optional
.accessPolicies(List.of(AccessPolicyProperty.builder()
.accessScope(AccessScopeProperty.builder()
.type("type")
// the properties below are optional
.namespaces(List.of("namespaces"))
.build())
.policyArn("policyArn")
.build()))
.kubernetesGroups(List.of("kubernetesGroups"))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.type("type")
.username("username")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn access policy includes permissions that allow Amazon EKS to authorize an IAM principal to work with Kubernetes objects on your cluster.static interfaceThe scope of anAccessPolicythat's associated to anAccessEntry.static final classA fluent builder forCfnAccessEntry.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.eks.IAccessEntryRef
IAccessEntryRef.Jsii$Default, IAccessEntryRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAccessEntry(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAccessEntry(software.amazon.jsii.JsiiObjectRef objRef) CfnAccessEntry(software.constructs.Construct scope, String id, CfnAccessEntryProps props) Create a newAWS::EKS::AccessEntry. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForAccessEntry(IAccessEntryRef resource) A reference to a AccessEntry resource.The access policies to associate to the access entry.The ARN of the access entry.Tag Manager which manages the tags for this resource.The name of your cluster.The value fornamethat you've specified forkind: Groupas asubjectin a KubernetesRoleBindingorClusterRoleBindingobject.The ARN of the IAM principal for theAccessEntry.getTags()Metadata that assists with categorization and organization.getType()The type of the new access entry.The username to authenticate to Kubernetes with.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnAccessEntry.renderProperties(Map<String, Object> props) voidsetAccessPolicies(List<Object> value) The access policies to associate to the access entry.voidsetAccessPolicies(IResolvable value) The access policies to associate to the access entry.voidsetClusterName(String value) The name of your cluster.voidsetKubernetesGroups(List<String> value) The value fornamethat you've specified forkind: Groupas asubjectin a KubernetesRoleBindingorClusterRoleBindingobject.voidsetPrincipalArn(String value) The ARN of the IAM principal for theAccessEntry.voidMetadata that assists with categorization and organization.voidThe type of the new access entry.voidsetUsername(String value) The username to authenticate to Kubernetes with.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAccessEntry
protected CfnAccessEntry(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAccessEntry
protected CfnAccessEntry(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAccessEntry
@Stability(Stable) public CfnAccessEntry(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAccessEntryProps props) Create a newAWS::EKS::AccessEntry.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForAccessEntry
@Stability(Stable) @NotNull public static String arnForAccessEntry(@NotNull IAccessEntryRef resource) - Parameters:
resource- This parameter is required.
-
isCfnAccessEntry
Checks whether the given object is a CfnAccessEntry.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAccessEntryRef
A reference to a AccessEntry resource.- Specified by:
getAccessEntryRefin interfaceIAccessEntryRef
-
getAttrAccessEntryArn
The ARN of the access entry. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getClusterName
The name of your cluster. -
setClusterName
The name of your cluster. -
getPrincipalArn
The ARN of the IAM principal for theAccessEntry. -
setPrincipalArn
The ARN of the IAM principal for theAccessEntry. -
getAccessPolicies
The access policies to associate to the access entry.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnAccessEntry.AccessPolicyProperty> -
setAccessPolicies
The access policies to associate to the access entry. -
setAccessPolicies
The access policies to associate to the access entry. -
getKubernetesGroups
The value fornamethat you've specified forkind: Groupas asubjectin a KubernetesRoleBindingorClusterRoleBindingobject. -
setKubernetesGroups
The value fornamethat you've specified forkind: Groupas asubjectin a KubernetesRoleBindingorClusterRoleBindingobject. -
getTags
Metadata that assists with categorization and organization. -
setTags
Metadata that assists with categorization and organization. -
getType
The type of the new access entry. -
setType
The type of the new access entry. -
getUsername
The username to authenticate to Kubernetes with. -
setUsername
The username to authenticate to Kubernetes with.
-