class AccessEntry (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EKS.AccessEntry |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseks#AccessEntry |
Java | software.amazon.awscdk.services.eks.AccessEntry |
Python | aws_cdk.aws_eks.AccessEntry |
TypeScript (source) | aws-cdk-lib » aws_eks » AccessEntry |
Implements
IConstruct
, IDependable
, IResource
, IAccess
Represents an access entry in an Amazon EKS cluster.
An access entry defines the permissions and scope for a user or role to access an Amazon EKS cluster.
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 accessPolicy: eks.AccessPolicy;
declare const cluster: eks.Cluster;
const accessEntry = new eks.AccessEntry(this, 'MyAccessEntry', {
accessPolicies: [accessPolicy],
cluster: cluster,
principal: 'principal',
// the properties below are optional
accessEntryName: 'accessEntryName',
accessEntryType: eks.AccessEntryType.STANDARD,
});
Initializer
new AccessEntry(scope: Construct, id: string, props: AccessEntryProps)
Parameters
- scope
Construct
- id
string
- props
Access
Entry Props
Construct Props
Name | Type | Description |
---|---|---|
access | IAccess [] | The access policies that define the permissions and scope for the access entry. |
cluster | ICluster | The Amazon EKS cluster to which the access entry applies. |
principal | string | The Amazon Resource Name (ARN) of the principal (user or role) to associate the access entry with. |
access | string | The name of the AccessEntry. |
access | Access | The type of the AccessEntry. |
accessPolicies
Type:
IAccess
[]
The access policies that define the permissions and scope for the access entry.
cluster
Type:
ICluster
The Amazon EKS cluster to which the access entry applies.
principal
Type:
string
The Amazon Resource Name (ARN) of the principal (user or role) to associate the access entry with.
accessEntryName?
Type:
string
(optional, default: No access entry name is provided)
The name of the AccessEntry.
accessEntryType?
Type:
Access
(optional, default: STANDARD)
The type of the AccessEntry.
Properties
Name | Type | Description |
---|---|---|
access | string | The Amazon Resource Name (ARN) of the access entry. |
access | string | The name of the access entry. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
accessEntryArn
Type:
string
The Amazon Resource Name (ARN) of the access entry.
accessEntryName
Type:
string
The name of the access entry.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
Name | Description |
---|---|
add | Add the access policies for this entry. |
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Imports an AccessEntry from its attributes. |
AccessPolicies(newAccessPolicies)
addpublic addAccessPolicies(newAccessPolicies: IAccessPolicy[]): void
Parameters
- newAccessPolicies
IAccess
Policy []
— - The new access policies to add.
Add the access policies for this entry.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
AccessEntryAttributes(scope, id, attrs)
static frompublic static fromAccessEntryAttributes(scope: Construct, id: string, attrs: AccessEntryAttributes): IAccessEntry
Parameters
- scope
Construct
— - The parent construct. - id
string
— - The ID of the imported construct. - attrs
Access
— - The attributes of the access entry to import.Entry Attributes
Returns
Imports an AccessEntry
from its attributes.