@aws-cdk/aws-elasticache-alpha 2.218.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +8808 -0
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +217 -0
- package/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +421 -0
- package/lib/common.d.ts +13 -0
- package/lib/common.js +18 -0
- package/lib/iam-user.d.ts +79 -0
- package/lib/iam-user.js +106 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +25 -0
- package/lib/no-password-user.d.ts +64 -0
- package/lib/no-password-user.js +78 -0
- package/lib/password-user.d.ts +70 -0
- package/lib/password-user.js +79 -0
- package/lib/serverless-cache-base.d.ts +247 -0
- package/lib/serverless-cache-base.js +183 -0
- package/lib/serverless-cache.d.ts +341 -0
- package/lib/serverless-cache.js +429 -0
- package/lib/user-base.d.ts +148 -0
- package/lib/user-base.js +114 -0
- package/lib/user-group.d.ts +199 -0
- package/lib/user-group.js +239 -0
- package/package.json +117 -0
- package/rosetta/_generated.ts-fixture +6 -0
- package/rosetta/default.ts-fixture +16 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { UserEngine } from './common';
|
|
3
|
+
import { IResource, Resource } from 'aws-cdk-lib/core';
|
|
4
|
+
/**
|
|
5
|
+
* Access control configuration for ElastiCache users.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class AccessControl {
|
|
8
|
+
/**
|
|
9
|
+
* Create access control from an access string.
|
|
10
|
+
*
|
|
11
|
+
* @param accessString The access string defining user permissions.
|
|
12
|
+
*/
|
|
13
|
+
static fromAccessString(accessString: string): AccessControl;
|
|
14
|
+
/**
|
|
15
|
+
* The access string that defines user's permissions.
|
|
16
|
+
*/
|
|
17
|
+
abstract readonly accessString: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Properties for defining an ElastiCache base user.
|
|
21
|
+
*/
|
|
22
|
+
export interface UserBaseProps {
|
|
23
|
+
/**
|
|
24
|
+
* The engine type for the user.
|
|
25
|
+
* Enum options: UserEngine.VALKEY, UserEngine.REDIS.
|
|
26
|
+
*
|
|
27
|
+
* @default UserEngine.VALKEY.
|
|
28
|
+
*/
|
|
29
|
+
readonly engine?: UserEngine;
|
|
30
|
+
/**
|
|
31
|
+
* The ID of the user.
|
|
32
|
+
*/
|
|
33
|
+
readonly userId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Access control configuration for the user.
|
|
36
|
+
*/
|
|
37
|
+
readonly accessControl: AccessControl;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Represents an ElastiCache base user.
|
|
41
|
+
*/
|
|
42
|
+
export interface IUser extends IResource {
|
|
43
|
+
/**
|
|
44
|
+
* The user's ID.
|
|
45
|
+
*
|
|
46
|
+
* @attribute
|
|
47
|
+
*/
|
|
48
|
+
readonly userId: string;
|
|
49
|
+
/**
|
|
50
|
+
* The engine for the user.
|
|
51
|
+
*/
|
|
52
|
+
readonly engine?: UserEngine;
|
|
53
|
+
/**
|
|
54
|
+
* The user's name.
|
|
55
|
+
*
|
|
56
|
+
* @attribute
|
|
57
|
+
*/
|
|
58
|
+
readonly userName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The user's ARN.
|
|
61
|
+
*
|
|
62
|
+
* @attribute
|
|
63
|
+
*/
|
|
64
|
+
readonly userArn: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Attributes for importing an existing ElastiCache user.
|
|
68
|
+
*/
|
|
69
|
+
export interface UserBaseAttributes {
|
|
70
|
+
/**
|
|
71
|
+
* The ID of the user.
|
|
72
|
+
* One of `userId` or `userArn` is required.
|
|
73
|
+
*
|
|
74
|
+
* @default - derived from userArn.
|
|
75
|
+
*/
|
|
76
|
+
readonly userId?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The engine type for the user.
|
|
79
|
+
*
|
|
80
|
+
* @default - engine type is unknown.
|
|
81
|
+
*/
|
|
82
|
+
readonly engine?: UserEngine;
|
|
83
|
+
/**
|
|
84
|
+
* The user's name.
|
|
85
|
+
*
|
|
86
|
+
* @default - name is unknown.
|
|
87
|
+
*/
|
|
88
|
+
readonly userName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The ARN of the user.
|
|
91
|
+
*
|
|
92
|
+
* One of `userId` or `userArn` is required.
|
|
93
|
+
*
|
|
94
|
+
* @default - derived from userId.
|
|
95
|
+
*/
|
|
96
|
+
readonly userArn?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Base class for ElastiCache users.
|
|
100
|
+
*/
|
|
101
|
+
export declare abstract class UserBase extends Resource implements IUser {
|
|
102
|
+
/**
|
|
103
|
+
* Import an existing user by ID.
|
|
104
|
+
*
|
|
105
|
+
* @param scope The parent creating construct (usually `this`).
|
|
106
|
+
* @param id The construct's name.
|
|
107
|
+
* @param userId The ID of the existing user.
|
|
108
|
+
*/
|
|
109
|
+
static fromUserId(scope: Construct, id: string, userId: string): IUser;
|
|
110
|
+
/**
|
|
111
|
+
* Import an existing user by ARN.
|
|
112
|
+
*
|
|
113
|
+
* @param scope The parent creating construct (usually `this`).
|
|
114
|
+
* @param id The construct's name.
|
|
115
|
+
* @param userArn The ARN of the existing user.
|
|
116
|
+
*/
|
|
117
|
+
static fromUserArn(scope: Construct, id: string, userArn: string): IUser;
|
|
118
|
+
/**
|
|
119
|
+
* Import an existing user using attributes.
|
|
120
|
+
*
|
|
121
|
+
* @param scope The parent creating construct (usually `this`).
|
|
122
|
+
* @param id The construct's name.
|
|
123
|
+
* @param attrs A `UserBaseAttributes` object.
|
|
124
|
+
*/
|
|
125
|
+
static fromUserAttributes(scope: Construct, id: string, attrs: UserBaseAttributes): IUser;
|
|
126
|
+
/**
|
|
127
|
+
* The user's ID.
|
|
128
|
+
*
|
|
129
|
+
* @attribute
|
|
130
|
+
*/
|
|
131
|
+
abstract readonly userId: string;
|
|
132
|
+
/**
|
|
133
|
+
* The engine for the user.
|
|
134
|
+
*/
|
|
135
|
+
abstract readonly engine?: UserEngine;
|
|
136
|
+
/**
|
|
137
|
+
* The user's name.
|
|
138
|
+
*
|
|
139
|
+
* @attribute
|
|
140
|
+
*/
|
|
141
|
+
abstract readonly userName?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The user's ARN.
|
|
144
|
+
*
|
|
145
|
+
* @attribute
|
|
146
|
+
*/
|
|
147
|
+
abstract readonly userArn: string;
|
|
148
|
+
}
|
package/lib/user-base.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a, _b;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.UserBase = exports.AccessControl = void 0;
|
|
5
|
+
const jsiiDeprecationWarnings = require("../.warnings.jsii.js");
|
|
6
|
+
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
7
|
+
const core_1 = require("aws-cdk-lib/core");
|
|
8
|
+
/**
|
|
9
|
+
* Access control configuration for ElastiCache users.
|
|
10
|
+
*/
|
|
11
|
+
class AccessControl {
|
|
12
|
+
/**
|
|
13
|
+
* Create access control from an access string.
|
|
14
|
+
*
|
|
15
|
+
* @param accessString The access string defining user permissions.
|
|
16
|
+
*/
|
|
17
|
+
static fromAccessString(accessString) {
|
|
18
|
+
return new AccessControlString(accessString);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.AccessControl = AccessControl;
|
|
22
|
+
_a = JSII_RTTI_SYMBOL_1;
|
|
23
|
+
AccessControl[_a] = { fqn: "@aws-cdk/aws-elasticache-alpha.AccessControl", version: "2.218.0-alpha.0" };
|
|
24
|
+
/**
|
|
25
|
+
* Access control implementation using a raw access string.
|
|
26
|
+
*/
|
|
27
|
+
class AccessControlString extends AccessControl {
|
|
28
|
+
constructor(accessString) {
|
|
29
|
+
super();
|
|
30
|
+
this.accessString = accessString;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Base class for ElastiCache users.
|
|
35
|
+
*/
|
|
36
|
+
class UserBase extends core_1.Resource {
|
|
37
|
+
/**
|
|
38
|
+
* Import an existing user by ID.
|
|
39
|
+
*
|
|
40
|
+
* @param scope The parent creating construct (usually `this`).
|
|
41
|
+
* @param id The construct's name.
|
|
42
|
+
* @param userId The ID of the existing user.
|
|
43
|
+
*/
|
|
44
|
+
static fromUserId(scope, id, userId) {
|
|
45
|
+
return UserBase.fromUserAttributes(scope, id, { userId });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Import an existing user by ARN.
|
|
49
|
+
*
|
|
50
|
+
* @param scope The parent creating construct (usually `this`).
|
|
51
|
+
* @param id The construct's name.
|
|
52
|
+
* @param userArn The ARN of the existing user.
|
|
53
|
+
*/
|
|
54
|
+
static fromUserArn(scope, id, userArn) {
|
|
55
|
+
return UserBase.fromUserAttributes(scope, id, { userArn });
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Import an existing user using attributes.
|
|
59
|
+
*
|
|
60
|
+
* @param scope The parent creating construct (usually `this`).
|
|
61
|
+
* @param id The construct's name.
|
|
62
|
+
* @param attrs A `UserBaseAttributes` object.
|
|
63
|
+
*/
|
|
64
|
+
static fromUserAttributes(scope, id, attrs) {
|
|
65
|
+
try {
|
|
66
|
+
jsiiDeprecationWarnings._aws_cdk_aws_elasticache_alpha_UserBaseAttributes(attrs);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
|
|
70
|
+
Error.captureStackTrace(error, this.fromUserAttributes);
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
let userId;
|
|
75
|
+
let userArn;
|
|
76
|
+
const stack = core_1.Stack.of(scope);
|
|
77
|
+
if (attrs.userArn && attrs.userId) {
|
|
78
|
+
throw new core_1.ValidationError('Only one of userArn or userId can be provided.', scope);
|
|
79
|
+
}
|
|
80
|
+
if (attrs.userArn) {
|
|
81
|
+
userArn = attrs.userArn;
|
|
82
|
+
const extractedUserId = stack.splitArn(attrs.userArn, core_1.ArnFormat.SLASH_RESOURCE_NAME).resourceName;
|
|
83
|
+
if (!extractedUserId) {
|
|
84
|
+
throw new core_1.ValidationError('Unable to extract user id from ARN.', scope);
|
|
85
|
+
}
|
|
86
|
+
userId = extractedUserId;
|
|
87
|
+
}
|
|
88
|
+
else if (attrs.userId) {
|
|
89
|
+
userId = attrs.userId;
|
|
90
|
+
userArn = stack.formatArn({
|
|
91
|
+
service: 'elasticache',
|
|
92
|
+
resource: 'user',
|
|
93
|
+
resourceName: attrs.userId,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
throw new core_1.ValidationError('One of userId or userArn is required.', scope);
|
|
98
|
+
}
|
|
99
|
+
class Import extends core_1.Resource {
|
|
100
|
+
constructor(_userArn, _userId) {
|
|
101
|
+
super(scope, id);
|
|
102
|
+
this.userArn = _userArn;
|
|
103
|
+
this.userId = _userId;
|
|
104
|
+
this.engine = attrs.engine;
|
|
105
|
+
this.userName = attrs.userName;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return new Import(userArn, userId);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.UserBase = UserBase;
|
|
112
|
+
_b = JSII_RTTI_SYMBOL_1;
|
|
113
|
+
UserBase[_b] = { fqn: "@aws-cdk/aws-elasticache-alpha.UserBase", version: "2.218.0-alpha.0" };
|
|
114
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1iYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidXNlci1iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUVBLDJDQUEwRjtBQUUxRjs7R0FFRztBQUNILE1BQXNCLGFBQWE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mFtZT86IHN0cmluZztcbiAgLyoqXG4gICAqIFRoZSB1c2VyJ3MgQVJOLlxuICAgKlxuICAgKiBAYXR0cmlidXRlXG4gICAqL1xuICBwdWJsaWMgYWJzdHJhY3QgcmVhZG9ubHkgdXNlckFybjogc3RyaW5nO1xufVxuIl19
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { UserEngine } from './common';
|
|
3
|
+
import { IUser } from './user-base';
|
|
4
|
+
import { IResource, Resource } from 'aws-cdk-lib/core';
|
|
5
|
+
/**
|
|
6
|
+
* Properties for defining an ElastiCache UserGroup
|
|
7
|
+
*/
|
|
8
|
+
export interface UserGroupProps {
|
|
9
|
+
/**
|
|
10
|
+
* Enforces a particular physical user group name.
|
|
11
|
+
* @default <generated>
|
|
12
|
+
*/
|
|
13
|
+
readonly userGroupName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The engine type for the user group
|
|
16
|
+
* Enum options: UserEngine.VALKEY, UserEngine.REDIS
|
|
17
|
+
*
|
|
18
|
+
* @default UserEngine.VALKEY
|
|
19
|
+
*/
|
|
20
|
+
readonly engine?: UserEngine;
|
|
21
|
+
/**
|
|
22
|
+
* List of users inside the user group
|
|
23
|
+
*
|
|
24
|
+
* @default - no users
|
|
25
|
+
*/
|
|
26
|
+
readonly users?: IUser[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Represents an ElastiCache UserGroup
|
|
30
|
+
*/
|
|
31
|
+
export interface IUserGroup extends IResource {
|
|
32
|
+
/**
|
|
33
|
+
* The name of the user group
|
|
34
|
+
*
|
|
35
|
+
* @attribute
|
|
36
|
+
*/
|
|
37
|
+
readonly userGroupName: string;
|
|
38
|
+
/**
|
|
39
|
+
* The engine type for the user group
|
|
40
|
+
*/
|
|
41
|
+
readonly engine?: UserEngine;
|
|
42
|
+
/**
|
|
43
|
+
* List of users in the user group
|
|
44
|
+
*/
|
|
45
|
+
readonly users?: IUser[];
|
|
46
|
+
/**
|
|
47
|
+
* The ARN of the user group
|
|
48
|
+
*
|
|
49
|
+
* @attribute
|
|
50
|
+
*/
|
|
51
|
+
readonly userGroupArn: string;
|
|
52
|
+
/**
|
|
53
|
+
* Add a user to this user group
|
|
54
|
+
*
|
|
55
|
+
* @param user The user to add
|
|
56
|
+
*/
|
|
57
|
+
addUser(user: IUser): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Base class for UserGroup constructs
|
|
61
|
+
*/
|
|
62
|
+
export declare abstract class UserGroupBase extends Resource implements IUserGroup {
|
|
63
|
+
/**
|
|
64
|
+
* The name of the user group
|
|
65
|
+
*
|
|
66
|
+
* @attribute
|
|
67
|
+
*/
|
|
68
|
+
abstract readonly userGroupName: string;
|
|
69
|
+
/**
|
|
70
|
+
* The engine type for the user group
|
|
71
|
+
*/
|
|
72
|
+
abstract readonly engine?: UserEngine;
|
|
73
|
+
/**
|
|
74
|
+
* List of users in the user group
|
|
75
|
+
*/
|
|
76
|
+
abstract readonly users?: IUser[];
|
|
77
|
+
/**
|
|
78
|
+
* The ARN of the user group
|
|
79
|
+
* @attribute
|
|
80
|
+
*/
|
|
81
|
+
abstract readonly userGroupArn: string;
|
|
82
|
+
/**
|
|
83
|
+
* Add a user to this user group
|
|
84
|
+
*
|
|
85
|
+
* @param _user The user to add
|
|
86
|
+
*/
|
|
87
|
+
addUser(_user: IUser): void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Attributes that can be specified when importing a UserGroup
|
|
91
|
+
*/
|
|
92
|
+
export interface UserGroupAttributes {
|
|
93
|
+
/**
|
|
94
|
+
* The name of the user group
|
|
95
|
+
*
|
|
96
|
+
* One of `userGroupName` or `userGroupArn` is required.
|
|
97
|
+
*
|
|
98
|
+
* @default - derived from userGroupArn
|
|
99
|
+
*/
|
|
100
|
+
readonly userGroupName?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The engine type for the user group
|
|
103
|
+
*
|
|
104
|
+
* @default - engine type is unknown
|
|
105
|
+
*/
|
|
106
|
+
readonly engine?: UserEngine;
|
|
107
|
+
/**
|
|
108
|
+
* List of users in the user group
|
|
109
|
+
*
|
|
110
|
+
* @default - users are unknown
|
|
111
|
+
*/
|
|
112
|
+
readonly users?: IUser[];
|
|
113
|
+
/**
|
|
114
|
+
* The ARN of the user group
|
|
115
|
+
*
|
|
116
|
+
* One of `userGroupName` or `userGroupArn` is required.
|
|
117
|
+
*
|
|
118
|
+
* @default - derived from userGroupName
|
|
119
|
+
*/
|
|
120
|
+
readonly userGroupArn?: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* An ElastiCache UserGroup
|
|
124
|
+
*
|
|
125
|
+
* @resource AWS::ElastiCache::UserGroup
|
|
126
|
+
*/
|
|
127
|
+
export declare class UserGroup extends UserGroupBase {
|
|
128
|
+
/**
|
|
129
|
+
* Uniquely identifies this class
|
|
130
|
+
*/
|
|
131
|
+
static readonly PROPERTY_INJECTION_ID: string;
|
|
132
|
+
/**
|
|
133
|
+
* Return whether the given object is a `UserGroup`
|
|
134
|
+
*/
|
|
135
|
+
static isUserGroup(x: any): x is UserGroup;
|
|
136
|
+
/**
|
|
137
|
+
* Import an existing user group by name
|
|
138
|
+
*
|
|
139
|
+
* @param scope The parent creating construct (usually `this`)
|
|
140
|
+
* @param id The construct's name
|
|
141
|
+
* @param userGroupName The name of the existing user group
|
|
142
|
+
*/
|
|
143
|
+
static fromUserGroupName(scope: Construct, id: string, userGroupName: string): IUserGroup;
|
|
144
|
+
/**
|
|
145
|
+
* Import an existing user group by ARN
|
|
146
|
+
*
|
|
147
|
+
* @param scope The parent creating construct (usually `this`)
|
|
148
|
+
* @param id The construct's name
|
|
149
|
+
* @param userGroupArn The ARN of the existing user group
|
|
150
|
+
*/
|
|
151
|
+
static fromUserGroupArn(scope: Construct, id: string, userGroupArn: string): IUserGroup;
|
|
152
|
+
/**
|
|
153
|
+
* Import an existing user group using attributes
|
|
154
|
+
*
|
|
155
|
+
* @param scope The parent creating construct (usually `this`)
|
|
156
|
+
* @param id The construct's name
|
|
157
|
+
* @param attrs A `UserGroupAttributes` object
|
|
158
|
+
*/
|
|
159
|
+
static fromUserGroupAttributes(scope: Construct, id: string, attrs: UserGroupAttributes): IUserGroup;
|
|
160
|
+
readonly engine?: UserEngine;
|
|
161
|
+
readonly userGroupName: string;
|
|
162
|
+
private readonly _users;
|
|
163
|
+
/**
|
|
164
|
+
* The ARN of the user group
|
|
165
|
+
*
|
|
166
|
+
* @attribute
|
|
167
|
+
*/
|
|
168
|
+
readonly userGroupArn: string;
|
|
169
|
+
/**
|
|
170
|
+
* The status of the user group
|
|
171
|
+
* Can be 'creating', 'active', 'modifying', 'deleting'
|
|
172
|
+
*
|
|
173
|
+
* @attribute
|
|
174
|
+
*/
|
|
175
|
+
readonly userGroupStatus: string;
|
|
176
|
+
private readonly resource;
|
|
177
|
+
constructor(scope: Construct, id: string, props?: UserGroupProps);
|
|
178
|
+
/**
|
|
179
|
+
* Add a CloudFormation dependency on the user resource to ensure proper creation order.
|
|
180
|
+
*/
|
|
181
|
+
private addUserDependency;
|
|
182
|
+
/**
|
|
183
|
+
* Array of users in the user group
|
|
184
|
+
*
|
|
185
|
+
* Do not push directly to this array.
|
|
186
|
+
* Use addUser() instead to ensure proper validation and dependency management.
|
|
187
|
+
*/
|
|
188
|
+
get users(): IUser[] | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* Validates users in the user group for duplicate usernames and Redis-specific requirements.
|
|
191
|
+
*/
|
|
192
|
+
private validateUsers;
|
|
193
|
+
/**
|
|
194
|
+
* Add a user to this user group
|
|
195
|
+
*
|
|
196
|
+
* @param user The user to add to the group
|
|
197
|
+
*/
|
|
198
|
+
addUser(user: IUser): void;
|
|
199
|
+
}
|