cdk-docker-image-deployment 0.0.68 → 0.0.70
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 +3 -3
- package/lib/destination.js +1 -1
- package/lib/docker-image-deployment.js +1 -1
- package/lib/source.js +1 -1
- package/node_modules/aws-sdk/CHANGELOG.md +15 -1
- package/node_modules/aws-sdk/README.md +1 -1
- package/node_modules/aws-sdk/apis/ecs-2014-11-13.examples.json +123 -0
- package/node_modules/aws-sdk/apis/ecs-2014-11-13.min.json +76 -3
- package/node_modules/aws-sdk/apis/es-2015-01-01.min.json +457 -137
- package/node_modules/aws-sdk/apis/iot-2015-05-28.min.json +365 -317
- package/node_modules/aws-sdk/apis/license-manager-2018-08-01.min.json +93 -40
- package/node_modules/aws-sdk/apis/marketplace-catalog-2018-09-17.min.json +88 -0
- package/node_modules/aws-sdk/apis/metadata.json +3 -0
- package/node_modules/aws-sdk/apis/rekognition-2016-06-27.min.json +192 -63
- package/node_modules/aws-sdk/apis/scheduler-2021-06-30.examples.json +5 -0
- package/node_modules/aws-sdk/apis/scheduler-2021-06-30.min.json +701 -0
- package/node_modules/aws-sdk/apis/scheduler-2021-06-30.paginators.json +16 -0
- package/node_modules/aws-sdk/apis/ssm-incidents-2018-05-10.min.json +39 -15
- package/node_modules/aws-sdk/clients/all.d.ts +1 -0
- package/node_modules/aws-sdk/clients/all.js +2 -1
- package/node_modules/aws-sdk/clients/autoscaling.d.ts +8 -8
- package/node_modules/aws-sdk/clients/ec2.d.ts +5 -5
- package/node_modules/aws-sdk/clients/ecs.d.ts +79 -0
- package/node_modules/aws-sdk/clients/es.d.ts +301 -0
- package/node_modules/aws-sdk/clients/glue.d.ts +8 -8
- package/node_modules/aws-sdk/clients/iot.d.ts +60 -3
- package/node_modules/aws-sdk/clients/licensemanager.d.ts +73 -5
- package/node_modules/aws-sdk/clients/marketplacecatalog.d.ts +89 -2
- package/node_modules/aws-sdk/clients/rekognition.d.ts +171 -11
- package/node_modules/aws-sdk/clients/resourceexplorer2.d.ts +2 -2
- package/node_modules/aws-sdk/clients/scheduler.d.ts +829 -0
- package/node_modules/aws-sdk/clients/scheduler.js +18 -0
- package/node_modules/aws-sdk/clients/securityhub.d.ts +3 -3
- package/node_modules/aws-sdk/clients/ssmincidents.d.ts +32 -0
- package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +2 -2
- package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +48 -11
- package/node_modules/aws-sdk/dist/aws-sdk.js +727 -386
- package/node_modules/aws-sdk/dist/aws-sdk.min.js +58 -58
- package/node_modules/aws-sdk/lib/config_service_placeholders.d.ts +2 -0
- package/node_modules/aws-sdk/lib/core.js +1 -1
- package/node_modules/aws-sdk/lib/credentials/sso_credentials.js +114 -49
- package/node_modules/aws-sdk/package.json +1 -1
- package/package.json +4 -4
|
@@ -320,6 +320,7 @@ export abstract class ConfigurationServicePlaceholders {
|
|
|
320
320
|
migrationhuborchestrator?: AWS.MigrationHubOrchestrator.Types.ClientConfiguration;
|
|
321
321
|
connectcases?: AWS.ConnectCases.Types.ClientConfiguration;
|
|
322
322
|
resourceexplorer2?: AWS.ResourceExplorer2.Types.ClientConfiguration;
|
|
323
|
+
scheduler?: AWS.Scheduler.Types.ClientConfiguration;
|
|
323
324
|
}
|
|
324
325
|
export interface ConfigurationServiceApiVersions {
|
|
325
326
|
acm?: AWS.ACM.Types.apiVersion;
|
|
@@ -642,4 +643,5 @@ export interface ConfigurationServiceApiVersions {
|
|
|
642
643
|
migrationhuborchestrator?: AWS.MigrationHubOrchestrator.Types.apiVersion;
|
|
643
644
|
connectcases?: AWS.ConnectCases.Types.apiVersion;
|
|
644
645
|
resourceexplorer2?: AWS.ResourceExplorer2.Types.apiVersion;
|
|
646
|
+
scheduler?: AWS.Scheduler.Types.apiVersion;
|
|
645
647
|
}
|
|
@@ -11,11 +11,22 @@ var iniLoader = AWS.util.iniLoader;
|
|
|
11
11
|
*
|
|
12
12
|
* The credentials file must specify the information below to use sso:
|
|
13
13
|
*
|
|
14
|
-
* [
|
|
14
|
+
* [profile sso-profile]
|
|
15
15
|
* sso_account_id = 012345678901
|
|
16
|
-
* sso_region =
|
|
16
|
+
* sso_region = **-****-*
|
|
17
17
|
* sso_role_name = SampleRole
|
|
18
|
-
* sso_start_url = https://d
|
|
18
|
+
* sso_start_url = https://d-******.awsapps.com/start
|
|
19
|
+
*
|
|
20
|
+
* or using the session format:
|
|
21
|
+
*
|
|
22
|
+
* [profile sso-token]
|
|
23
|
+
* sso_session = prod
|
|
24
|
+
* sso_account_id = 012345678901
|
|
25
|
+
* sso_role_name = SampleRole
|
|
26
|
+
*
|
|
27
|
+
* [sso-session prod]
|
|
28
|
+
* sso_region = **-****-*
|
|
29
|
+
* sso_start_url = https://d-******.awsapps.com/start
|
|
19
30
|
*
|
|
20
31
|
* This information will be automatically added to your shared credentials file by running
|
|
21
32
|
* `aws configure sso`.
|
|
@@ -68,14 +79,8 @@ AWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, {
|
|
|
68
79
|
* @api private
|
|
69
80
|
*/
|
|
70
81
|
load: function load(callback) {
|
|
71
|
-
/**
|
|
72
|
-
* The time window (15 mins) that SDK will treat the SSO token expires in before the defined expiration date in token.
|
|
73
|
-
* This is needed because server side may have invalidated the token before the defined expiration date.
|
|
74
|
-
*
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
var EXPIRE_WINDOW_MS = 15 * 60 * 1000;
|
|
78
82
|
var self = this;
|
|
83
|
+
|
|
79
84
|
try {
|
|
80
85
|
var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);
|
|
81
86
|
var profile = profiles[this.profile] || {};
|
|
@@ -87,17 +92,107 @@ AWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, {
|
|
|
87
92
|
);
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
if (profile.sso_session) {
|
|
96
|
+
if (!profile.sso_account_id || !profile.sso_role_name) {
|
|
97
|
+
throw AWS.util.error(
|
|
98
|
+
new Error('Profile ' + this.profile + ' with session ' + profile.sso_session +
|
|
99
|
+
' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_session", ' +
|
|
100
|
+
'"sso_role_name". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),
|
|
101
|
+
{ code: self.errorCode }
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
if (!profile.sso_start_url || !profile.sso_account_id || !profile.sso_region || !profile.sso_role_name) {
|
|
106
|
+
throw AWS.util.error(
|
|
107
|
+
new Error('Profile ' + this.profile + ' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", ' +
|
|
108
|
+
'"sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),
|
|
109
|
+
{ code: self.errorCode }
|
|
110
|
+
);
|
|
111
|
+
}
|
|
96
112
|
}
|
|
97
113
|
|
|
114
|
+
this.getToken(this.profile, profile, function (err, token) {
|
|
115
|
+
if (err) {
|
|
116
|
+
return callback(err);
|
|
117
|
+
}
|
|
118
|
+
var request = {
|
|
119
|
+
accessToken: token,
|
|
120
|
+
accountId: profile.sso_account_id,
|
|
121
|
+
roleName: profile.sso_role_name,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
if (!self.service || self.service.config.region !== profile.sso_region) {
|
|
125
|
+
self.service = new AWS.SSO({
|
|
126
|
+
region: profile.sso_region,
|
|
127
|
+
httpOptions: self.httpOptions,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
self.service.getRoleCredentials(request, function(err, data) {
|
|
132
|
+
if (err || !data || !data.roleCredentials) {
|
|
133
|
+
callback(AWS.util.error(
|
|
134
|
+
err || new Error('Please log in using "aws sso login"'),
|
|
135
|
+
{ code: self.errorCode }
|
|
136
|
+
), null);
|
|
137
|
+
} else if (!data.roleCredentials.accessKeyId || !data.roleCredentials.secretAccessKey || !data.roleCredentials.sessionToken || !data.roleCredentials.expiration) {
|
|
138
|
+
throw AWS.util.error(new Error(
|
|
139
|
+
'SSO returns an invalid temporary credential.'
|
|
140
|
+
));
|
|
141
|
+
} else {
|
|
142
|
+
self.expired = false;
|
|
143
|
+
self.accessKeyId = data.roleCredentials.accessKeyId;
|
|
144
|
+
self.secretAccessKey = data.roleCredentials.secretAccessKey;
|
|
145
|
+
self.sessionToken = data.roleCredentials.sessionToken;
|
|
146
|
+
self.expireTime = new Date(data.roleCredentials.expiration);
|
|
147
|
+
callback(null);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
} catch (err) {
|
|
152
|
+
callback(err);
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @private
|
|
158
|
+
* Uses legacy file system retrieval or if sso-session is set,
|
|
159
|
+
* use the SSOTokenProvider.
|
|
160
|
+
*
|
|
161
|
+
* @param {string} profileName - name of the profile.
|
|
162
|
+
* @param {object} profile - profile data containing sso_session or sso_start_url etc.
|
|
163
|
+
* @param {function} callback - called with (err, (string) token).
|
|
164
|
+
*
|
|
165
|
+
* @returns {void}
|
|
166
|
+
*/
|
|
167
|
+
getToken: function getToken(profileName, profile, callback) {
|
|
168
|
+
var self = this;
|
|
169
|
+
|
|
170
|
+
if (profile.sso_session) {
|
|
171
|
+
var _iniLoader = AWS.util.iniLoader;
|
|
172
|
+
var ssoSessions = _iniLoader.loadSsoSessionsFrom();
|
|
173
|
+
var ssoSession = ssoSessions[profile.sso_session];
|
|
174
|
+
Object.assign(profile, ssoSession);
|
|
175
|
+
|
|
176
|
+
var ssoTokenProvider = new AWS.SSOTokenProvider({
|
|
177
|
+
profile: profileName,
|
|
178
|
+
});
|
|
179
|
+
ssoTokenProvider.load(function (err) {
|
|
180
|
+
if (err) {
|
|
181
|
+
return callback(err);
|
|
182
|
+
}
|
|
183
|
+
return callback(null, ssoTokenProvider.token);
|
|
184
|
+
});
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
try {
|
|
189
|
+
/**
|
|
190
|
+
* The time window (15 mins) that SDK will treat the SSO token expires in before the defined expiration date in token.
|
|
191
|
+
* This is needed because server side may have invalidated the token before the defined expiration date.
|
|
192
|
+
*/
|
|
193
|
+
var EXPIRE_WINDOW_MS = 15 * 60 * 1000;
|
|
98
194
|
var hasher = crypto.createHash('sha1');
|
|
99
195
|
var fileName = hasher.update(profile.sso_start_url).digest('hex') + '.json';
|
|
100
|
-
|
|
101
196
|
var cachePath = path.join(
|
|
102
197
|
iniLoader.getHomeDir(),
|
|
103
198
|
'.aws',
|
|
@@ -110,7 +205,6 @@ AWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, {
|
|
|
110
205
|
if (cacheFile) {
|
|
111
206
|
cacheContent = JSON.parse(cacheFile);
|
|
112
207
|
}
|
|
113
|
-
|
|
114
208
|
if (!cacheContent) {
|
|
115
209
|
throw AWS.util.error(
|
|
116
210
|
new Error('Cached credentials not found under ' + this.profile + ' profile. Please make sure you log in with aws sso login first'),
|
|
@@ -130,38 +224,9 @@ AWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, {
|
|
|
130
224
|
));
|
|
131
225
|
}
|
|
132
226
|
|
|
133
|
-
|
|
134
|
-
self.service = new AWS.SSO({
|
|
135
|
-
region: profile.sso_region,
|
|
136
|
-
httpOptions: this.httpOptions,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
var request = {
|
|
140
|
-
accessToken: cacheContent.accessToken,
|
|
141
|
-
accountId: profile.sso_account_id,
|
|
142
|
-
roleName: profile.sso_role_name,
|
|
143
|
-
};
|
|
144
|
-
self.service.getRoleCredentials(request, function(err, data) {
|
|
145
|
-
if (err || !data || !data.roleCredentials) {
|
|
146
|
-
callback(AWS.util.error(
|
|
147
|
-
err || new Error('Please log in using "aws sso login"'),
|
|
148
|
-
{ code: self.errorCode }
|
|
149
|
-
), null);
|
|
150
|
-
} else if (!data.roleCredentials.accessKeyId || !data.roleCredentials.secretAccessKey || !data.roleCredentials.sessionToken || !data.roleCredentials.expiration) {
|
|
151
|
-
throw AWS.util.error(new Error(
|
|
152
|
-
'SSO returns an invalid temporary credential.'
|
|
153
|
-
));
|
|
154
|
-
} else {
|
|
155
|
-
self.expired = false;
|
|
156
|
-
self.accessKeyId = data.roleCredentials.accessKeyId;
|
|
157
|
-
self.secretAccessKey = data.roleCredentials.secretAccessKey;
|
|
158
|
-
self.sessionToken = data.roleCredentials.sessionToken;
|
|
159
|
-
self.expireTime = new Date(data.roleCredentials.expiration);
|
|
160
|
-
callback(null);
|
|
161
|
-
}
|
|
162
|
-
});
|
|
227
|
+
return callback(null, cacheContent.accessToken);
|
|
163
228
|
} catch (err) {
|
|
164
|
-
callback(err);
|
|
229
|
+
return callback(err, null);
|
|
165
230
|
}
|
|
166
231
|
},
|
|
167
232
|
|
package/package.json
CHANGED
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"jest-junit": "^13",
|
|
54
54
|
"jsii": "^1.71.0",
|
|
55
55
|
"jsii-diff": "^1.71.0",
|
|
56
|
-
"jsii-docgen": "^7.0.
|
|
56
|
+
"jsii-docgen": "^7.0.145",
|
|
57
57
|
"jsii-pacmak": "^1.71.0",
|
|
58
58
|
"json-schema": "^0.4.0",
|
|
59
59
|
"npm-check-updates": "^16",
|
|
60
|
-
"projen": "^0.65.
|
|
60
|
+
"projen": "^0.65.19",
|
|
61
61
|
"standard-version": "^9",
|
|
62
62
|
"ts-jest": "^27",
|
|
63
63
|
"typescript": "^4.8.4"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@types/aws-lambda": "^8.10.108",
|
|
71
|
-
"aws-sdk": "^2.
|
|
71
|
+
"aws-sdk": "^2.1253.0"
|
|
72
72
|
},
|
|
73
73
|
"bundledDependencies": [
|
|
74
74
|
"@types/aws-lambda",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"main": "lib/index.js",
|
|
81
81
|
"license": "Apache-2.0",
|
|
82
82
|
"homepage": "https://github.com/cdklabs/cdk-docker-image-deployment#readme",
|
|
83
|
-
"version": "0.0.
|
|
83
|
+
"version": "0.0.70",
|
|
84
84
|
"jest": {
|
|
85
85
|
"testMatch": [
|
|
86
86
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|