feat(kinesisfirehose): support HTTP endpoint destination#35969
feat(kinesisfirehose): support HTTP endpoint destination#35969
Conversation
packages/@aws-cdk-testing/framework-integ/test/aws-kinesisfirehose/test/integ.http-endpoint.ts
Show resolved
Hide resolved
|
|
||||||||||||||
|
|
||||||||||||||
badmintoncryer
left a comment
There was a problem hiding this comment.
Thank you for your contribution. I've added some minor comments.
| abstract bind(scope: Construct): HttpEndpointAuthenticationOptions; | ||
| } | ||
|
|
||
| class HttpEndpointAccesKeyAuthentication extends HttpEndpointAuthentication { |
There was a problem hiding this comment.
nit: typo
| class HttpEndpointAccesKeyAuthentication extends HttpEndpointAuthentication { | |
| class HttpEndpointAccessKeyAuthentication extends HttpEndpointAuthentication { |
| * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding | ||
| */ | ||
| export enum ContentEncoding { | ||
| /** No content-encoing */ |
There was a problem hiding this comment.
nit: typo
| /** No content-encoing */ | |
| /** No content-encoding */ |
| }) ?? {}; | ||
|
|
||
| if (this.props.retryDuration && !this.props.retryDuration.isUnresolved() && this.props.retryDuration.toSeconds() > 7200) { | ||
| throw new cdk.ValidationError(`Retry duration must be less than or equal to 7200 seconds, got ${this.props.retryDuration.toSeconds()}.`, scope); |
There was a problem hiding this comment.
nit: It may be slightly better to show a unit.
| throw new cdk.ValidationError(`Retry duration must be less than or equal to 7200 seconds, got ${this.props.retryDuration.toSeconds()}.`, scope); | |
| throw new cdk.ValidationError(`Retry duration must be less than or equal to 7200 seconds, got ${this.props.retryDuration.toSeconds()} seconds.`, scope); |
| /** | ||
| * The URL of the HTTP endpoint selected as the destination. | ||
| */ | ||
| readonly url: string; |
There was a problem hiding this comment.
Could you please add a validation to check the url prop begins with https://?
https://docs.aws.amazon.com/firehose/latest/dev/create-destination.html#create-destination-http
|
|
||
| bind(scope: Construct): HttpEndpointAuthenticationOptions { | ||
| if (!cdk.Token.isUnresolved(this.accessKey) && Buffer.from(this.accessKey).byteLength > 4096) { | ||
| throw new cdk.ValidationError('The maximum length of the access key is 4096 bytes.', scope); |
There was a problem hiding this comment.
Error class now needs a error code.
| postCliContext: { | ||
| '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false, | ||
| }, |
There was a problem hiding this comment.
Is this feature flag condition needed?
| * | ||
| * @default - true if `secret` is specified, false otherwise | ||
| */ | ||
| readonly enabled?: boolean; |
There was a problem hiding this comment.
Do we actually need this parameter? One alternative worth considering would be to make secret a required field, and derive the enabled state from it, treating a provided secret as enabled = true. If there are any concrete use cases where explicitly setting enabled = false is necessary, it would be helpful to understand what those look like.
| * | ||
| * @default - the destination specific role will be used | ||
| */ | ||
| readonly role?: iam.IRole; |
There was a problem hiding this comment.
Could you please confirm to use the reference interface instead of L2 interface?
This applies equally to all other arguments that accept an Interface.
| readonly role?: iam.IRole; | |
| readonly role?: iam.IRoleRef; |
Issue # (if applicable)
Closes #15502.
Closes #33585.
Reason for this change
Amazon Data Firehose delivery stream can deliver records to a custom HTTP endpoint destination.
Some destinations, e.g. Colalogix, Datadog, New Relic, etc., are based on HTTP endpoint destination.
See also:
Description of changes
Added the
HttpEndpointdestination class.Usage:
Describe any new or updated permissions being added
The HTTP endpoint destination will grant following accesses to the destination role:
secret.grantRead()bucket.grantReadWrite()logGroup.grantWrite()Description of how you validated changes
Added unit tests and an Integ test.
The integ test also asserts the http endpoint (with access key) is invoked correctly.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license