@aws-cdk/aws-bedrock-agentcore-alpha 2.253.1-alpha.0 → 2.255.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 +16960 -11718
- package/.jsii.tabl.json.gz +0 -0
- package/README.md +57 -2910
- package/lib/evaluation/custom-evaluator.d.ts +9 -0
- package/lib/evaluation/custom-evaluator.js +8 -2
- package/lib/evaluation/data-source.js +1 -1
- package/lib/evaluation/evaluator-base.js +1 -1
- package/lib/evaluation/evaluator-config.js +2 -2
- package/lib/evaluation/evaluator.js +1 -1
- package/lib/evaluation/online-evaluation-base.js +1 -1
- package/lib/evaluation/online-evaluation.d.ts +9 -0
- package/lib/evaluation/online-evaluation.js +8 -2
- package/lib/evaluation/types.js +5 -5
- package/lib/evaluation/validation-helpers.d.ts +8 -0
- package/lib/evaluation/validation-helpers.js +62 -1
- package/lib/gateway/gateway-base.js +1 -1
- package/lib/gateway/gateway.d.ts +3 -2
- package/lib/gateway/gateway.js +3 -3
- package/lib/gateway/inbound-auth/authorizer.js +4 -4
- package/lib/gateway/inbound-auth/custom-claim.js +1 -1
- package/lib/gateway/interceptor.js +1 -1
- package/lib/gateway/outbound-auth/api-key.d.ts +13 -4
- package/lib/gateway/outbound-auth/api-key.js +63 -21
- package/lib/gateway/outbound-auth/credential-provider.d.ts +48 -4
- package/lib/gateway/outbound-auth/credential-provider.js +49 -2
- package/lib/gateway/outbound-auth/iam-role.d.ts +4 -3
- package/lib/gateway/outbound-auth/iam-role.js +3 -5
- package/lib/gateway/outbound-auth/oauth.d.ts +11 -3
- package/lib/gateway/outbound-auth/oauth.js +70 -20
- package/lib/gateway/perms.d.ts +15 -3
- package/lib/gateway/perms.js +24 -9
- package/lib/gateway/protocol.js +2 -2
- package/lib/gateway/targets/schema/api-schema.js +4 -4
- package/lib/gateway/targets/schema/tool-schema.js +4 -4
- package/lib/gateway/targets/target-base.js +1 -1
- package/lib/gateway/targets/target-configuration.js +6 -6
- package/lib/gateway/targets/target.js +3 -3
- package/lib/identity/api-key-credential-provider.d.ts +217 -0
- package/lib/identity/api-key-credential-provider.js +249 -0
- package/lib/identity/grant-helpers.d.ts +74 -0
- package/lib/identity/grant-helpers.js +132 -0
- package/lib/identity/oauth2-credential-provider.d.ts +679 -0
- package/lib/identity/oauth2-credential-provider.js +863 -0
- package/lib/identity/perms.d.ts +119 -0
- package/lib/identity/perms.js +178 -0
- package/lib/identity/validation-helpers.d.ts +61 -0
- package/lib/identity/validation-helpers.js +156 -0
- package/lib/identity/workload-identity.d.ts +186 -0
- package/lib/identity/workload-identity.js +212 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +8 -1
- package/lib/memory/memory-strategy.js +1 -1
- package/lib/memory/memory.js +2 -2
- package/lib/memory/strategies/managed-strategy.js +1 -1
- package/lib/memory/strategies/self-managed-strategy.js +1 -1
- package/lib/memory/validation-helpers.js +2 -2
- package/lib/network/network-configuration.js +4 -4
- package/lib/policy/perms.d.ts +0 -6
- package/lib/policy/perms.js +1 -7
- package/lib/policy/policy-base.js +1 -1
- package/lib/policy/policy-engine-base.js +1 -1
- package/lib/policy/policy-engine.js +1 -1
- package/lib/policy/policy-statement.d.ts +2 -1
- package/lib/policy/policy-statement.js +14 -12
- package/lib/policy/policy-types.js +1 -1
- package/lib/policy/policy.js +1 -1
- package/lib/runtime/inbound-auth/custom-claim.js +1 -1
- package/lib/runtime/inbound-auth/runtime-authorizer-configuration.js +1 -1
- package/lib/runtime/observability.js +2 -2
- package/lib/runtime/runtime-artifact.d.ts +11 -3
- package/lib/runtime/runtime-artifact.js +12 -4
- package/lib/runtime/runtime-base.js +1 -1
- package/lib/runtime/runtime-endpoint-base.js +1 -1
- package/lib/runtime/runtime-endpoint.js +1 -1
- package/lib/runtime/runtime.js +1 -1
- package/lib/runtime/types.d.ts +7 -1
- package/lib/runtime/types.js +7 -1
- package/lib/tools/browser.js +2 -2
- package/lib/tools/code-interpreter.js +2 -2
- package/package.json +18 -10
- package/rosetta/policy.ts-fixture +11 -0
|
@@ -0,0 +1,679 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
import type { IResource, ResourceProps, SecretValue } from 'aws-cdk-lib';
|
|
14
|
+
import { Resource } from 'aws-cdk-lib';
|
|
15
|
+
import type { IOAuth2CredentialProviderRef, OAuth2CredentialProviderReference } from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
16
|
+
import { CfnOAuth2CredentialProvider } from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
17
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
18
|
+
import type { Construct } from 'constructs';
|
|
19
|
+
/******************************************************************************
|
|
20
|
+
* Enums
|
|
21
|
+
*****************************************************************************/
|
|
22
|
+
/**
|
|
23
|
+
* Built-in OAuth2 vendors supported by `AWS::BedrockAgentCore::OAuth2CredentialProvider`.
|
|
24
|
+
*
|
|
25
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrockagentcore-oauth2credentialprovider.html
|
|
26
|
+
*/
|
|
27
|
+
export declare enum OAuth2CredentialProviderVendor {
|
|
28
|
+
/** Google OAuth2. */
|
|
29
|
+
GOOGLE = "GoogleOauth2",
|
|
30
|
+
/** GitHub OAuth2. */
|
|
31
|
+
GITHUB = "GithubOauth2",
|
|
32
|
+
/** Slack OAuth2. */
|
|
33
|
+
SLACK = "SlackOauth2",
|
|
34
|
+
/** Salesforce OAuth2. */
|
|
35
|
+
SALESFORCE = "SalesforceOauth2",
|
|
36
|
+
/** Microsoft OAuth2. */
|
|
37
|
+
MICROSOFT = "MicrosoftOauth2",
|
|
38
|
+
/** Custom OAuth2. */
|
|
39
|
+
CUSTOM = "CustomOauth2",
|
|
40
|
+
/** Atlassian OAuth2. */
|
|
41
|
+
ATLASSIAN = "AtlassianOauth2",
|
|
42
|
+
/** LinkedIn OAuth2. */
|
|
43
|
+
LINKEDIN = "LinkedinOauth2",
|
|
44
|
+
/** X (Twitter) OAuth2. */
|
|
45
|
+
X = "XOauth2",
|
|
46
|
+
/** Okta OAuth2. */
|
|
47
|
+
OKTA = "OktaOauth2",
|
|
48
|
+
/** OneLogin OAuth2. */
|
|
49
|
+
ONE_LOGIN = "OneLoginOauth2",
|
|
50
|
+
/** PingOne OAuth2. */
|
|
51
|
+
PING_ONE = "PingOneOauth2",
|
|
52
|
+
/** Facebook OAuth2. */
|
|
53
|
+
FACEBOOK = "FacebookOauth2",
|
|
54
|
+
/** Yandex OAuth2. */
|
|
55
|
+
YANDEX = "YandexOauth2",
|
|
56
|
+
/** Reddit OAuth2. */
|
|
57
|
+
REDDIT = "RedditOauth2",
|
|
58
|
+
/** Zoom OAuth2. */
|
|
59
|
+
ZOOM = "ZoomOauth2",
|
|
60
|
+
/** Twitch OAuth2. */
|
|
61
|
+
TWITCH = "TwitchOauth2",
|
|
62
|
+
/** Spotify OAuth2. */
|
|
63
|
+
SPOTIFY = "SpotifyOauth2",
|
|
64
|
+
/** Dropbox OAuth2. */
|
|
65
|
+
DROPBOX = "DropboxOauth2",
|
|
66
|
+
/** Notion OAuth2. */
|
|
67
|
+
NOTION = "NotionOauth2",
|
|
68
|
+
/** HubSpot OAuth2. */
|
|
69
|
+
HUBSPOT = "HubspotOauth2",
|
|
70
|
+
/** CyberArk OAuth2. */
|
|
71
|
+
CYBER_ARK = "CyberArkOauth2",
|
|
72
|
+
/** FusionAuth OAuth2. */
|
|
73
|
+
FUSION_AUTH = "FusionAuthOauth2",
|
|
74
|
+
/** Auth0 OAuth2. */
|
|
75
|
+
AUTH0 = "Auth0Oauth2",
|
|
76
|
+
/** Amazon Cognito OAuth2. */
|
|
77
|
+
COGNITO = "CognitoOauth2"
|
|
78
|
+
}
|
|
79
|
+
/******************************************************************************
|
|
80
|
+
* Interface
|
|
81
|
+
*****************************************************************************/
|
|
82
|
+
/**
|
|
83
|
+
* An OAuth2 credential provider registered in AgentCore Token Vault.
|
|
84
|
+
*/
|
|
85
|
+
export interface IOAuth2CredentialProvider extends IResource, iam.IGrantable, IOAuth2CredentialProviderRef {
|
|
86
|
+
/**
|
|
87
|
+
* The ARN of this credential provider.
|
|
88
|
+
* @attribute
|
|
89
|
+
*/
|
|
90
|
+
readonly credentialProviderArn: string;
|
|
91
|
+
/**
|
|
92
|
+
* OAuth2 vendor string passed to CloudFormation.
|
|
93
|
+
*/
|
|
94
|
+
readonly credentialProviderVendor: string;
|
|
95
|
+
/**
|
|
96
|
+
* Callback URL for the OAuth2 authorization flow.
|
|
97
|
+
* @attribute
|
|
98
|
+
*/
|
|
99
|
+
readonly callbackUrl?: string;
|
|
100
|
+
/**
|
|
101
|
+
* The ARN of the Secrets Manager secret for the OAuth2 client credentials.
|
|
102
|
+
*
|
|
103
|
+
* May be undefined for resources imported without this attribute.
|
|
104
|
+
*
|
|
105
|
+
* @attribute
|
|
106
|
+
*/
|
|
107
|
+
readonly clientSecretArn?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Timestamp when the credential provider was created.
|
|
110
|
+
* @attribute
|
|
111
|
+
*/
|
|
112
|
+
readonly createdTime?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Timestamp when the credential provider was last updated.
|
|
115
|
+
* @attribute
|
|
116
|
+
*/
|
|
117
|
+
readonly lastUpdatedTime?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Grants IAM actions to the IAM principal.
|
|
120
|
+
*/
|
|
121
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
122
|
+
/**
|
|
123
|
+
* Grant `GetOauth2CredentialProvider` and `ListOauth2CredentialProviders`, scoped to this
|
|
124
|
+
* provider and parent resources required by the Bedrock AgentCore authorization model.
|
|
125
|
+
*/
|
|
126
|
+
grantRead(grantee: iam.IGrantable): iam.Grant;
|
|
127
|
+
/**
|
|
128
|
+
* Grant control plane permissions to manage this provider.
|
|
129
|
+
*/
|
|
130
|
+
grantAdmin(grantee: iam.IGrantable): iam.Grant;
|
|
131
|
+
/**
|
|
132
|
+
* Grant permission to retrieve OAuth tokens (`GetResourceOauth2Token`, `CompleteResourceTokenAuth`).
|
|
133
|
+
*/
|
|
134
|
+
grantUse(grantee: iam.IGrantable): iam.Grant;
|
|
135
|
+
/**
|
|
136
|
+
* Grant read, admin, and token retrieval permissions.
|
|
137
|
+
*/
|
|
138
|
+
grantFullAccess(grantee: iam.IGrantable): iam.Grant;
|
|
139
|
+
/**
|
|
140
|
+
* ARNs and OAuth scopes for gateway targets (`GatewayCredentialProvider.fromOauthIdentity` or `fromOauthIdentityArn`).
|
|
141
|
+
*/
|
|
142
|
+
bindForGatewayOAuthTarget(scopes: string[], customParameters?: {
|
|
143
|
+
[key: string]: string;
|
|
144
|
+
}): GatewayOAuth2IdentityBinding;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Provider ARN, secret ARN, and OAuth scopes for wiring a Token Vault OAuth2 identity into a gateway target.
|
|
148
|
+
*/
|
|
149
|
+
export interface GatewayOAuth2IdentityBinding {
|
|
150
|
+
/**
|
|
151
|
+
* OAuth2 credential provider ARN.
|
|
152
|
+
*/
|
|
153
|
+
readonly providerArn: string;
|
|
154
|
+
/**
|
|
155
|
+
* Secrets Manager secret ARN for OAuth2 client credentials.
|
|
156
|
+
*/
|
|
157
|
+
readonly secretArn: string;
|
|
158
|
+
/**
|
|
159
|
+
* OAuth scopes to request when invoking through the gateway.
|
|
160
|
+
*/
|
|
161
|
+
readonly scopes: string[];
|
|
162
|
+
/**
|
|
163
|
+
* Optional custom parameters for the OAuth flow.
|
|
164
|
+
*
|
|
165
|
+
* @default - no custom parameters
|
|
166
|
+
*/
|
|
167
|
+
readonly customParameters?: {
|
|
168
|
+
[key: string]: string;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Shared properties for OAuth2 credential providers created via {@link OAuth2CredentialProvider} factory methods.
|
|
173
|
+
*/
|
|
174
|
+
export interface OAuth2CredentialProviderBaseProps {
|
|
175
|
+
/**
|
|
176
|
+
* Name of the credential provider.
|
|
177
|
+
*
|
|
178
|
+
* @default a name generated by CDK
|
|
179
|
+
*/
|
|
180
|
+
readonly oAuth2CredentialProviderName?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Tags for this credential provider.
|
|
183
|
+
*
|
|
184
|
+
* @default - no tags
|
|
185
|
+
*/
|
|
186
|
+
readonly tags?: {
|
|
187
|
+
[key: string]: string;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* OAuth2 client identifier and secret registered with the identity provider (all vendors).
|
|
192
|
+
*/
|
|
193
|
+
export interface OAuth2ClientCredentials {
|
|
194
|
+
/** OAuth2 client identifier. */
|
|
195
|
+
readonly clientId: string;
|
|
196
|
+
/**
|
|
197
|
+
* OAuth2 client secret.
|
|
198
|
+
*
|
|
199
|
+
* **NOTE:** The client secret will be included in the CloudFormation template as part of synthesis.
|
|
200
|
+
* The service stores the secret in Secrets Manager after creation, but the value is visible
|
|
201
|
+
* in the template and deployment history. Use `SecretValue.unsafePlainText()` to explicitly
|
|
202
|
+
* acknowledge plaintext, or pass a reference from another construct to avoid embedding the
|
|
203
|
+
* literal value.
|
|
204
|
+
*/
|
|
205
|
+
readonly clientSecret: SecretValue;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Naming, tags, and client credentials shared by every {@link OAuth2CredentialProvider} factory.
|
|
209
|
+
*/
|
|
210
|
+
export interface OAuth2CredentialProviderFactoryBaseProps extends OAuth2CredentialProviderBaseProps, OAuth2ClientCredentials {
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Props for {@link OAuth2CredentialProvider.usingSlack}.
|
|
214
|
+
*/
|
|
215
|
+
export interface SlackOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Props for {@link OAuth2CredentialProvider.usingGithub}.
|
|
219
|
+
*/
|
|
220
|
+
export interface GithubOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Props for {@link OAuth2CredentialProvider.usingGoogle}.
|
|
224
|
+
*/
|
|
225
|
+
export interface GoogleOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Props for {@link OAuth2CredentialProvider.usingSalesforce}.
|
|
229
|
+
*/
|
|
230
|
+
export interface SalesforceOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Props for {@link OAuth2CredentialProvider.usingMicrosoft}.
|
|
234
|
+
*/
|
|
235
|
+
export interface MicrosoftOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
236
|
+
/**
|
|
237
|
+
* Microsoft Entra ID tenant ID.
|
|
238
|
+
*
|
|
239
|
+
* @default - service default tenant resolution
|
|
240
|
+
*/
|
|
241
|
+
readonly tenantId?: string;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Props for {@link OAuth2CredentialProvider.usingAtlassian}.
|
|
245
|
+
*/
|
|
246
|
+
export interface AtlassianOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Props for {@link OAuth2CredentialProvider.usingLinkedin}.
|
|
250
|
+
*/
|
|
251
|
+
export interface LinkedinOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Props for {@link OAuth2CredentialProvider.usingFacebook}.
|
|
255
|
+
*
|
|
256
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-facebook.html
|
|
257
|
+
*/
|
|
258
|
+
export interface FacebookOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Props for {@link OAuth2CredentialProvider.usingX}.
|
|
262
|
+
*
|
|
263
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-x.html
|
|
264
|
+
*/
|
|
265
|
+
export interface XOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Props for {@link OAuth2CredentialProvider.usingYandex}.
|
|
269
|
+
*
|
|
270
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-yandex.html
|
|
271
|
+
*/
|
|
272
|
+
export interface YandexOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Props for {@link OAuth2CredentialProvider.usingReddit}.
|
|
276
|
+
*
|
|
277
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-reddit.html
|
|
278
|
+
*/
|
|
279
|
+
export interface RedditOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Props for {@link OAuth2CredentialProvider.usingZoom}.
|
|
283
|
+
*
|
|
284
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-zoom.html
|
|
285
|
+
*/
|
|
286
|
+
export interface ZoomOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Props for {@link OAuth2CredentialProvider.usingTwitch}.
|
|
290
|
+
*
|
|
291
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-twitch.html
|
|
292
|
+
*/
|
|
293
|
+
export interface TwitchOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Props for {@link OAuth2CredentialProvider.usingSpotify}.
|
|
297
|
+
*
|
|
298
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-spotify.html
|
|
299
|
+
*/
|
|
300
|
+
export interface SpotifyOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Props for {@link OAuth2CredentialProvider.usingDropbox}.
|
|
304
|
+
*
|
|
305
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-dropbox.html
|
|
306
|
+
*/
|
|
307
|
+
export interface DropboxOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Props for {@link OAuth2CredentialProvider.usingNotion}.
|
|
311
|
+
*
|
|
312
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-notion.html
|
|
313
|
+
*/
|
|
314
|
+
export interface NotionOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Props for {@link OAuth2CredentialProvider.usingHubspot}.
|
|
318
|
+
*
|
|
319
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-hubspot.html
|
|
320
|
+
*/
|
|
321
|
+
export interface HubspotOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Optional tenant OAuth endpoints for IdPs that use CloudFormation `IncludedOauth2ProviderConfig`
|
|
325
|
+
* with issuer and/or endpoints per the IdP’s outbound documentation.
|
|
326
|
+
*/
|
|
327
|
+
export interface IncludedOauth2TenantEndpoints {
|
|
328
|
+
/**
|
|
329
|
+
* OAuth2 authorization endpoint for your tenant.
|
|
330
|
+
*
|
|
331
|
+
* @default - not specified; use when your IdP requires an explicit endpoint
|
|
332
|
+
*/
|
|
333
|
+
readonly authorizationEndpoint?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Token issuer URL for your tenant (often the IdP base or issuer URI).
|
|
336
|
+
*
|
|
337
|
+
* @default - not specified; use when your IdP requires an explicit issuer
|
|
338
|
+
*/
|
|
339
|
+
readonly issuer?: string;
|
|
340
|
+
/**
|
|
341
|
+
* OAuth2 token endpoint for your tenant.
|
|
342
|
+
*
|
|
343
|
+
* @default - not specified; use when your IdP requires an explicit endpoint
|
|
344
|
+
*/
|
|
345
|
+
readonly tokenEndpoint?: string;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Props for `IncludedOauth2ProviderConfig` IdPs whose [outbound documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idps.html)
|
|
349
|
+
* requires `issuer`, `authorizationEndpoint`, and/or `tokenEndpoint` (for example Okta, Auth0, Amazon Cognito, OneLogin,
|
|
350
|
+
* PingOne, CyberArk, FusionAuth).
|
|
351
|
+
*/
|
|
352
|
+
export interface IncludedOauth2TenantCredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps, IncludedOauth2TenantEndpoints {
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Static OAuth2 authorization server metadata for custom credential providers.
|
|
356
|
+
*
|
|
357
|
+
* @see https://www.rfc-editor.org/rfc/rfc8414
|
|
358
|
+
*/
|
|
359
|
+
export interface OAuth2AuthorizationServerMetadata {
|
|
360
|
+
/**
|
|
361
|
+
* The authorization endpoint URL.
|
|
362
|
+
*/
|
|
363
|
+
readonly authorizationEndpoint: string;
|
|
364
|
+
/**
|
|
365
|
+
* The issuer URL for the OAuth2 authorization server.
|
|
366
|
+
*/
|
|
367
|
+
readonly issuer: string;
|
|
368
|
+
/**
|
|
369
|
+
* The token endpoint URL.
|
|
370
|
+
*/
|
|
371
|
+
readonly tokenEndpoint: string;
|
|
372
|
+
/**
|
|
373
|
+
* The supported response types.
|
|
374
|
+
*
|
|
375
|
+
* @default - not specified
|
|
376
|
+
*/
|
|
377
|
+
readonly responseTypes?: string[];
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Props for {@link OAuth2CredentialProvider.usingCustom}.
|
|
381
|
+
*
|
|
382
|
+
* Set exactly one of {@link discoveryUrl} (OIDC discovery document) or {@link authorizationServerMetadata}
|
|
383
|
+
* (static OAuth2 server metadata). Do not pass both.
|
|
384
|
+
*/
|
|
385
|
+
export interface CustomOAuth2CredentialProviderProps extends OAuth2CredentialProviderFactoryBaseProps {
|
|
386
|
+
/**
|
|
387
|
+
* OIDC/OAuth2 discovery document URL for dynamic integration with the identity provider.
|
|
388
|
+
*
|
|
389
|
+
* @default - not used when {@link authorizationServerMetadata} is set
|
|
390
|
+
*/
|
|
391
|
+
readonly discoveryUrl?: string;
|
|
392
|
+
/**
|
|
393
|
+
* Authorization server metadata (issuer, authorization and token endpoints) when not using a discovery URL.
|
|
394
|
+
*
|
|
395
|
+
* @default - not used when {@link discoveryUrl} is set
|
|
396
|
+
*/
|
|
397
|
+
readonly authorizationServerMetadata?: OAuth2AuthorizationServerMetadata;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Low-level properties when you need full control (prefer {@link OAuth2CredentialProvider.usingSlack} and other factories).
|
|
401
|
+
*/
|
|
402
|
+
export interface OAuth2CredentialProviderProps {
|
|
403
|
+
/**
|
|
404
|
+
* Name of the credential provider.
|
|
405
|
+
*
|
|
406
|
+
* @default a name generated by CDK
|
|
407
|
+
*/
|
|
408
|
+
readonly oAuth2CredentialProviderName?: string;
|
|
409
|
+
/**
|
|
410
|
+
* OAuth2 vendor string for CloudFormation `CredentialProviderVendor`.
|
|
411
|
+
*/
|
|
412
|
+
readonly credentialProviderVendor: string;
|
|
413
|
+
/**
|
|
414
|
+
* OAuth2 provider configuration passed through to `Oauth2ProviderConfigInput`.
|
|
415
|
+
*/
|
|
416
|
+
readonly oauth2ProviderConfigInput: CfnOAuth2CredentialProvider.Oauth2ProviderConfigInputProperty;
|
|
417
|
+
/**
|
|
418
|
+
* Tags for this credential provider.
|
|
419
|
+
*
|
|
420
|
+
* @default - no tags
|
|
421
|
+
*/
|
|
422
|
+
readonly tags?: {
|
|
423
|
+
[key: string]: string;
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Attributes for importing an existing OAuth2 credential provider.
|
|
428
|
+
*/
|
|
429
|
+
export interface OAuth2CredentialProviderAttributes {
|
|
430
|
+
/**
|
|
431
|
+
* ARN of the credential provider.
|
|
432
|
+
*/
|
|
433
|
+
readonly credentialProviderArn: string;
|
|
434
|
+
/**
|
|
435
|
+
* Vendor string for this provider.
|
|
436
|
+
*/
|
|
437
|
+
readonly credentialProviderVendor: string;
|
|
438
|
+
/**
|
|
439
|
+
* ARN of the Secrets Manager secret for OAuth2 client credentials, if known.
|
|
440
|
+
*
|
|
441
|
+
* @default - not set; required for {@link OAuth2CredentialProvider.bindForGatewayOAuthTarget} on imported providers
|
|
442
|
+
*/
|
|
443
|
+
readonly clientSecretArn?: string;
|
|
444
|
+
/**
|
|
445
|
+
* Callback URL from the deployed provider, if known.
|
|
446
|
+
*
|
|
447
|
+
* @default - not set
|
|
448
|
+
*/
|
|
449
|
+
readonly callbackUrl?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Resource creation time.
|
|
452
|
+
*
|
|
453
|
+
* @default - not set
|
|
454
|
+
*/
|
|
455
|
+
readonly createdTime?: string;
|
|
456
|
+
/**
|
|
457
|
+
* Resource last-updated time.
|
|
458
|
+
*
|
|
459
|
+
* @default - not set
|
|
460
|
+
*/
|
|
461
|
+
readonly lastUpdatedTime?: string;
|
|
462
|
+
}
|
|
463
|
+
/******************************************************************************
|
|
464
|
+
* Abstract base
|
|
465
|
+
*****************************************************************************/
|
|
466
|
+
declare abstract class OAuth2CredentialProviderBase extends Resource implements IOAuth2CredentialProvider {
|
|
467
|
+
abstract readonly credentialProviderArn: string;
|
|
468
|
+
abstract readonly credentialProviderVendor: string;
|
|
469
|
+
abstract readonly callbackUrl?: string;
|
|
470
|
+
abstract readonly clientSecretArn?: string;
|
|
471
|
+
abstract readonly createdTime?: string;
|
|
472
|
+
abstract readonly lastUpdatedTime?: string;
|
|
473
|
+
readonly grantPrincipal: iam.IPrincipal;
|
|
474
|
+
get oAuth2CredentialProviderRef(): OAuth2CredentialProviderReference;
|
|
475
|
+
constructor(scope: Construct, id: string, props?: ResourceProps);
|
|
476
|
+
/**
|
|
477
|
+
* [disable-awslint:no-grants]
|
|
478
|
+
*/
|
|
479
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
480
|
+
/**
|
|
481
|
+
* [disable-awslint:no-grants]
|
|
482
|
+
*/
|
|
483
|
+
grantRead(grantee: iam.IGrantable): iam.Grant;
|
|
484
|
+
/**
|
|
485
|
+
* [disable-awslint:no-grants]
|
|
486
|
+
*/
|
|
487
|
+
grantAdmin(grantee: iam.IGrantable): iam.Grant;
|
|
488
|
+
/**
|
|
489
|
+
* [disable-awslint:no-grants]
|
|
490
|
+
*/
|
|
491
|
+
grantUse(grantee: iam.IGrantable): iam.Grant;
|
|
492
|
+
/**
|
|
493
|
+
* [disable-awslint:no-grants]
|
|
494
|
+
*/
|
|
495
|
+
grantFullAccess(grantee: iam.IGrantable): iam.Grant;
|
|
496
|
+
abstract bindForGatewayOAuthTarget(scopes: string[], customParameters?: {
|
|
497
|
+
[key: string]: string;
|
|
498
|
+
}): GatewayOAuth2IdentityBinding;
|
|
499
|
+
}
|
|
500
|
+
/******************************************************************************
|
|
501
|
+
* Class
|
|
502
|
+
*****************************************************************************/
|
|
503
|
+
/**
|
|
504
|
+
* L2 construct for `AWS::BedrockAgentCore::OAuth2CredentialProvider`.
|
|
505
|
+
*
|
|
506
|
+
* Prefer the static factories (for example {@link OAuth2CredentialProvider.usingSlack}) so you only pass
|
|
507
|
+
* the OAuth2 settings that apply to that vendor. To attach the identity to a gateway target, use
|
|
508
|
+
* {@link GatewayCredentialProvider.fromOauthIdentity} with this construct, or
|
|
509
|
+
* {@link OAuth2CredentialProvider.bindForGatewayOAuthTarget} with {@link GatewayCredentialProvider.fromOauthIdentityArn}.
|
|
510
|
+
*
|
|
511
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrockagentcore-oauth2credentialprovider.html
|
|
512
|
+
* @resource AWS::BedrockAgentCore::OAuth2CredentialProvider
|
|
513
|
+
*/
|
|
514
|
+
export declare class OAuth2CredentialProvider extends OAuth2CredentialProviderBase {
|
|
515
|
+
/** Uniquely identifies this class. */
|
|
516
|
+
static readonly PROPERTY_INJECTION_ID: string;
|
|
517
|
+
/**
|
|
518
|
+
* Create a credential provider for Slack OAuth2.
|
|
519
|
+
*/
|
|
520
|
+
static usingSlack(scope: Construct, id: string, props: SlackOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
521
|
+
/**
|
|
522
|
+
* Create a credential provider for GitHub OAuth2.
|
|
523
|
+
*/
|
|
524
|
+
static usingGithub(scope: Construct, id: string, props: GithubOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
525
|
+
/**
|
|
526
|
+
* Create a credential provider for Google OAuth2.
|
|
527
|
+
*/
|
|
528
|
+
static usingGoogle(scope: Construct, id: string, props: GoogleOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
529
|
+
/**
|
|
530
|
+
* Create a credential provider for Salesforce OAuth2.
|
|
531
|
+
*/
|
|
532
|
+
static usingSalesforce(scope: Construct, id: string, props: SalesforceOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
533
|
+
/**
|
|
534
|
+
* Create a credential provider for Microsoft (Entra ID) OAuth2.
|
|
535
|
+
*/
|
|
536
|
+
static usingMicrosoft(scope: Construct, id: string, props: MicrosoftOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
537
|
+
/**
|
|
538
|
+
* Create a credential provider for Atlassian OAuth2.
|
|
539
|
+
*/
|
|
540
|
+
static usingAtlassian(scope: Construct, id: string, props: AtlassianOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
541
|
+
/**
|
|
542
|
+
* Create a credential provider for LinkedIn OAuth2.
|
|
543
|
+
*/
|
|
544
|
+
static usingLinkedin(scope: Construct, id: string, props: LinkedinOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
545
|
+
/**
|
|
546
|
+
* Create a credential provider for Okta OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
547
|
+
*
|
|
548
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-okta.html
|
|
549
|
+
*/
|
|
550
|
+
static usingOkta(scope: Construct, id: string, props: IncludedOauth2TenantCredentialProviderProps): OAuth2CredentialProvider;
|
|
551
|
+
/**
|
|
552
|
+
* Create a credential provider for OneLogin OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
553
|
+
*
|
|
554
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-onelogin.html
|
|
555
|
+
*/
|
|
556
|
+
static usingOneLogin(scope: Construct, id: string, props: IncludedOauth2TenantCredentialProviderProps): OAuth2CredentialProvider;
|
|
557
|
+
/**
|
|
558
|
+
* Create a credential provider for PingOne OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
559
|
+
*
|
|
560
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-pingidentity.html
|
|
561
|
+
*/
|
|
562
|
+
static usingPingOne(scope: Construct, id: string, props: IncludedOauth2TenantCredentialProviderProps): OAuth2CredentialProvider;
|
|
563
|
+
/**
|
|
564
|
+
* Create a credential provider for X (Twitter) OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
565
|
+
*
|
|
566
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-x.html
|
|
567
|
+
*/
|
|
568
|
+
static usingX(scope: Construct, id: string, props: XOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
569
|
+
/**
|
|
570
|
+
* Create a credential provider for Facebook OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
571
|
+
*
|
|
572
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-facebook.html
|
|
573
|
+
*/
|
|
574
|
+
static usingFacebook(scope: Construct, id: string, props: FacebookOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
575
|
+
/**
|
|
576
|
+
* Create a credential provider for Yandex OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
577
|
+
*
|
|
578
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-yandex.html
|
|
579
|
+
*/
|
|
580
|
+
static usingYandex(scope: Construct, id: string, props: YandexOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
581
|
+
/**
|
|
582
|
+
* Create a credential provider for Reddit OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
583
|
+
*
|
|
584
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-reddit.html
|
|
585
|
+
*/
|
|
586
|
+
static usingReddit(scope: Construct, id: string, props: RedditOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
587
|
+
/**
|
|
588
|
+
* Create a credential provider for Zoom OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
589
|
+
*
|
|
590
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-zoom.html
|
|
591
|
+
*/
|
|
592
|
+
static usingZoom(scope: Construct, id: string, props: ZoomOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
593
|
+
/**
|
|
594
|
+
* Create a credential provider for Twitch OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
595
|
+
*
|
|
596
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-twitch.html
|
|
597
|
+
*/
|
|
598
|
+
static usingTwitch(scope: Construct, id: string, props: TwitchOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
599
|
+
/**
|
|
600
|
+
* Create a credential provider for Spotify OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
601
|
+
*
|
|
602
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-spotify.html
|
|
603
|
+
*/
|
|
604
|
+
static usingSpotify(scope: Construct, id: string, props: SpotifyOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
605
|
+
/**
|
|
606
|
+
* Create a credential provider for Dropbox OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
607
|
+
*
|
|
608
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-dropbox.html
|
|
609
|
+
*/
|
|
610
|
+
static usingDropbox(scope: Construct, id: string, props: DropboxOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
611
|
+
/**
|
|
612
|
+
* Create a credential provider for Notion OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
613
|
+
*
|
|
614
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-notion.html
|
|
615
|
+
*/
|
|
616
|
+
static usingNotion(scope: Construct, id: string, props: NotionOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
617
|
+
/**
|
|
618
|
+
* Create a credential provider for HubSpot OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
619
|
+
*
|
|
620
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-hubspot.html
|
|
621
|
+
*/
|
|
622
|
+
static usingHubspot(scope: Construct, id: string, props: HubspotOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
623
|
+
/**
|
|
624
|
+
* Create a credential provider for CyberArk OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
625
|
+
*
|
|
626
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-cyberark.html
|
|
627
|
+
*/
|
|
628
|
+
static usingCyberArk(scope: Construct, id: string, props: IncludedOauth2TenantCredentialProviderProps): OAuth2CredentialProvider;
|
|
629
|
+
/**
|
|
630
|
+
* Create a credential provider for FusionAuth OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
631
|
+
*
|
|
632
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-fusionauth.html
|
|
633
|
+
*/
|
|
634
|
+
static usingFusionAuth(scope: Construct, id: string, props: IncludedOauth2TenantCredentialProviderProps): OAuth2CredentialProvider;
|
|
635
|
+
/**
|
|
636
|
+
* Create a credential provider for Auth0 OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
637
|
+
*
|
|
638
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-auth0.html
|
|
639
|
+
*/
|
|
640
|
+
static usingAuth0(scope: Construct, id: string, props: IncludedOauth2TenantCredentialProviderProps): OAuth2CredentialProvider;
|
|
641
|
+
/**
|
|
642
|
+
* Create a credential provider for Amazon Cognito OAuth2 (`IncludedOauth2ProviderConfig`).
|
|
643
|
+
*
|
|
644
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-cognito.html
|
|
645
|
+
*/
|
|
646
|
+
static usingCognito(scope: Construct, id: string, props: IncludedOauth2TenantCredentialProviderProps): OAuth2CredentialProvider;
|
|
647
|
+
/**
|
|
648
|
+
* Create a credential provider for a custom OAuth2 authorization server (discovery document or metadata).
|
|
649
|
+
*/
|
|
650
|
+
static usingCustom(scope: Construct, id: string, props: CustomOAuth2CredentialProviderProps): OAuth2CredentialProvider;
|
|
651
|
+
/**
|
|
652
|
+
* Import an existing OAuth2 credential provider.
|
|
653
|
+
*/
|
|
654
|
+
static fromOAuth2CredentialProviderAttributes(scope: Construct, id: string, attrs: OAuth2CredentialProviderAttributes): IOAuth2CredentialProvider;
|
|
655
|
+
readonly credentialProviderArn: string;
|
|
656
|
+
readonly credentialProviderVendor: string;
|
|
657
|
+
/**
|
|
658
|
+
* The name of this OAuth2 credential provider.
|
|
659
|
+
* @attribute
|
|
660
|
+
*/
|
|
661
|
+
readonly oAuth2CredentialProviderName: string;
|
|
662
|
+
readonly callbackUrl?: string;
|
|
663
|
+
readonly createdTime?: string;
|
|
664
|
+
readonly lastUpdatedTime?: string;
|
|
665
|
+
private _clientSecretArn?;
|
|
666
|
+
private readonly __resource;
|
|
667
|
+
get clientSecretArn(): string | undefined;
|
|
668
|
+
constructor(scope: Construct, id: string, props: OAuth2CredentialProviderProps);
|
|
669
|
+
/**
|
|
670
|
+
* ARNs and OAuth scopes for {@link GatewayCredentialProvider.fromOauthIdentity} / {@link GatewayCredentialProvider.fromOauthIdentityArn}.
|
|
671
|
+
*
|
|
672
|
+
* @param scopes OAuth scopes the gateway target should request (see vendor documentation).
|
|
673
|
+
* @param customParameters Optional custom parameters for the OAuth flow.
|
|
674
|
+
*/
|
|
675
|
+
bindForGatewayOAuthTarget(scopes: string[], customParameters?: {
|
|
676
|
+
[key: string]: string;
|
|
677
|
+
}): GatewayOAuth2IdentityBinding;
|
|
678
|
+
}
|
|
679
|
+
export {};
|