Package org.cdk8s.plus20
Class Role
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.plus20.Resource
-
- org.cdk8s.plus20.Role
-
- All Implemented Interfaces:
IApiEndpoint,IApiResource,IResource,IRole,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.59.0 (build eb02c92)", date="2022-05-18T23:19:48.653Z") @Stability(Stable) public class Role extends Resource implements IRole
Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRole.BuilderA fluent builder forRole.-
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IApiEndpoint
IApiEndpoint.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IApiResource
IApiResource.Jsii$Default
-
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IResource
IResource.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IRole
IRole.Jsii$Default, IRole.Jsii$Proxy
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRole(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedRole(software.amazon.jsii.JsiiObjectRef objRef)Role(software.constructs.Construct scope, String id)Role(software.constructs.Construct scope, String id, RoleProps props)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallow(List<String> verbs, @NotNull IApiResource... resources)Add permission to perform a list of HTTP verbs on a collection of resources.voidallowCreate(@NotNull IApiResource... resources)Add "create" permission for the resources.voidallowDelete(@NotNull IApiResource... resources)Add "delete" permission for the resources.voidallowDeleteCollection(@NotNull IApiResource... resources)Add "deletecollection" permission for the resources.voidallowGet(@NotNull IApiResource... resources)Add "get" permission for the resources.voidallowList(@NotNull IApiResource... resources)Add "list" permission for the resources.voidallowPatch(@NotNull IApiResource... resources)Add "patch" permission for the resources.voidallowRead(@NotNull IApiResource... resources)Add "get", "list", and "watch" permissions for the resources.voidallowReadWrite(@NotNull IApiResource... resources)Add "get", "list", "watch", "create", "update", "patch", "delete", and "deletecollection" permissions for the resources.voidallowUpdate(@NotNull IApiResource... resources)Add "update" permission for the resources.voidallowWatch(@NotNull IApiResource... resources)Add "watch" permission for the resources.RoleBindingbind(@NotNull ISubject... subjects)Create a RoleBinding that binds the permissions in this Role to a list of subjects, that will only apply this role's namespace.static IRolefromRoleName(String name)Imports a role from the cluster as a reference.protected org.cdk8s.ApiObjectgetApiObject()The underlying cdk8s API object.StringgetResourceType()The name of a resource type as it appears in the relevant API endpoint.List<RolePolicyRule>getRules()Rules associaated with this Role.-
Methods inherited from class org.cdk8s.plus20.Resource
asApiResource, asNonApiResource, getApiGroup, getApiVersion, getKind, getMetadata, getName, getResourceName
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cdk8s.plus20.IResource
getApiGroup, getApiVersion, getKind, getName
-
-
-
-
Constructor Detail
-
Role
protected Role(software.amazon.jsii.JsiiObjectRef objRef)
-
Role
protected Role(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
Role
@Stability(Stable) public Role(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable RoleProps props)- Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
Role
@Stability(Stable) public Role(@NotNull software.constructs.Construct scope, @NotNull String id)- Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Detail
-
fromRoleName
@Stability(Stable) @NotNull public static IRole fromRoleName(@NotNull String name)
Imports a role from the cluster as a reference.- Parameters:
name- The name of the role resource. This parameter is required.
-
allow
@Stability(Stable) public void allow(@NotNull List<String> verbs, @NotNull @NotNull IApiResource... resources)Add permission to perform a list of HTTP verbs on a collection of resources.- Parameters:
verbs- This parameter is required.resources- The resource(s) to apply to. This parameter is required.
-
allowCreate
@Stability(Stable) public void allowCreate(@NotNull @NotNull IApiResource... resources)Add "create" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowDelete
@Stability(Stable) public void allowDelete(@NotNull @NotNull IApiResource... resources)Add "delete" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowDeleteCollection
@Stability(Stable) public void allowDeleteCollection(@NotNull @NotNull IApiResource... resources)Add "deletecollection" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowGet
@Stability(Stable) public void allowGet(@NotNull @NotNull IApiResource... resources)Add "get" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowList
@Stability(Stable) public void allowList(@NotNull @NotNull IApiResource... resources)Add "list" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowPatch
@Stability(Stable) public void allowPatch(@NotNull @NotNull IApiResource... resources)Add "patch" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowRead
@Stability(Stable) public void allowRead(@NotNull @NotNull IApiResource... resources)Add "get", "list", and "watch" permissions for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowReadWrite
@Stability(Stable) public void allowReadWrite(@NotNull @NotNull IApiResource... resources)Add "get", "list", "watch", "create", "update", "patch", "delete", and "deletecollection" permissions for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowUpdate
@Stability(Stable) public void allowUpdate(@NotNull @NotNull IApiResource... resources)Add "update" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
allowWatch
@Stability(Stable) public void allowWatch(@NotNull @NotNull IApiResource... resources)Add "watch" permission for the resources.- Parameters:
resources- The resource(s) to apply to. This parameter is required.
-
bind
@Stability(Stable) @NotNull public RoleBinding bind(@NotNull @NotNull ISubject... subjects)
Create a RoleBinding that binds the permissions in this Role to a list of subjects, that will only apply this role's namespace.- Parameters:
subjects- a list of subjects to bind to. This parameter is required.
-
getApiObject
@Stability(Stable) @NotNull protected org.cdk8s.ApiObject getApiObject()
The underlying cdk8s API object.- Specified by:
getApiObjectin classResource- See Also:
base.Resource.apiObject
-
getResourceType
@Stability(Stable) @NotNull public String getResourceType()
The name of a resource type as it appears in the relevant API endpoint.- Specified by:
getResourceTypein interfaceIApiResource- Specified by:
getResourceTypein classResource
-
getRules
@Stability(Stable) @NotNull public List<RolePolicyRule> getRules()
Rules associaated with this Role.Returns a copy, use
allowto add rules.
-
-