Package org.cdk8s.plus24
Class Role
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.plus24.Resource
-
- org.cdk8s.plus24.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-25T20:54:33.756Z") @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 class
Role.Builder
A 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.plus24.IApiEndpoint
IApiEndpoint.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.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.plus24.IResource
IResource.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.IRole
IRole.Jsii$Default, IRole.Jsii$Proxy
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Role(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected
Role(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 void
allow(List<String> verbs, @NotNull IApiResource... resources)
Add permission to perform a list of HTTP verbs on a collection of resources.void
allowCreate(@NotNull IApiResource... resources)
Add "create" permission for the resources.void
allowDelete(@NotNull IApiResource... resources)
Add "delete" permission for the resources.void
allowDeleteCollection(@NotNull IApiResource... resources)
Add "deletecollection" permission for the resources.void
allowGet(@NotNull IApiResource... resources)
Add "get" permission for the resources.void
allowList(@NotNull IApiResource... resources)
Add "list" permission for the resources.void
allowPatch(@NotNull IApiResource... resources)
Add "patch" permission for the resources.void
allowRead(@NotNull IApiResource... resources)
Add "get", "list", and "watch" permissions for the resources.void
allowReadWrite(@NotNull IApiResource... resources)
Add "get", "list", "watch", "create", "update", "patch", "delete", and "deletecollection" permissions for the resources.void
allowUpdate(@NotNull IApiResource... resources)
Add "update" permission for the resources.void
allowWatch(@NotNull IApiResource... resources)
Add "watch" permission for the resources.RoleBinding
bind(@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 IRole
fromRoleName(software.constructs.Construct scope, String id, String name)
Imports a role from the cluster as a reference.protected org.cdk8s.ApiObject
getApiObject()
The underlying cdk8s API object.String
getResourceType()
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.plus24.Resource
asApiResource, asNonApiResource, getApiGroup, getApiVersion, getKind, getMetadata, getName, getPermissions, 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.plus24.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 software.constructs.Construct scope, @NotNull String id, @NotNull String name)
Imports a role from the cluster as a reference.- Parameters:
scope
- This parameter is required.id
- This parameter is required.name
- 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:
getApiObject
in 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:
getResourceType
in interfaceIApiResource
- Specified by:
getResourceType
in classResource
-
getRules
@Stability(Stable) @NotNull public List<RolePolicyRule> getRules()
Rules associaated with this Role.Returns a copy, use
allow
to add rules.
-
-