Skip to content

feat(ecs-patterns) expose ALB idleTimeout property#21221

Closed
michaeldrey wants to merge 8 commits intoaws:mainfrom
michaeldrey:specify_idle_timeout
Closed

feat(ecs-patterns) expose ALB idleTimeout property#21221
michaeldrey wants to merge 8 commits intoaws:mainfrom
michaeldrey:specify_idle_timeout

Conversation

@michaeldrey
Copy link
Copy Markdown
Contributor

@michaeldrey michaeldrey commented Jul 19, 2022

This PR exposes the idleTime property for both EC2 and Fargate, and the MultiTargetGroup ALB services. Per the CFN specs, I have set the idleTimeout to default to 60 seconds, and it cannot exceed 4000 seconds.

If no value is provided we set the value to undefined. We do this because:

  1. The default value is set for the user via the CFN. The behavior for the property is to either add a value or leave it undefined and let CFN set the default. See here
  2. Setting a default causes snapshot tests to fail for dependent services as we're adding a new attribute to the cloudformation.

In addition to this, I've updated all the Integ tests to a working state (would not build otherwise) and added working tests for all cases listed above.

Lastly I've added two examples to the README.

closes #12913

All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Jul 19, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team July 19, 2022 03:11
@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Jul 19, 2022
@michaeldrey michaeldrey changed the title feat(ecs-patterns) expose idleTimeout property feat(ecs-patterns) expose ALB idleTimeout property Jul 19, 2022
@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 4485598
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Copy Markdown
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. This looks like really excellent work (and includes everything I ever ask for in terms of tests and documentation updates). 120 files, however, makes it hard to provide a meaningful and thorough review. Could you please split this up into multiple PRs so that we can review them more effectively? For instance, I see that some test changes are just a correction of a typo. Great catch, but those could be their own PR to reduce the noise.

Also to cut down the number of files, I noticed that some files just include spacing changes. I don't think most of those are necessary, but the ones that are could go in the same PR as the typo fixes. I think I would generally split this into three:

  1. The typo/formatting fixes.
  2. The change to application-load-balanced-service-base.ts and corresponding tests.
  3. The change to application-multiple-target-groups-service-base.ts and corresponding tests.

@michaeldrey
Copy link
Copy Markdown
Contributor Author

@TheRealAmazonKendra Thanks for the quick response!

You have a great point, this has kind of snowballed a bit. I will begin splitting this out into the PR's you've suggested

@TheRealAmazonKendra
Copy link
Copy Markdown
Contributor

@TheRealAmazonKendra Thanks for the quick response!

You have a great point, this has kind of snowballed a bit. I will begin splitting this out into the PR's you've suggested

Thank you! I know it can be kind of a pain in the ass to split up a PR once you've got it all prepared. I appreciate your efforts here.

mergify bot pushed a commit that referenced this pull request Jul 19, 2022
…nstruct (#21237)

Currently when you run `yarn build+test+extract`, integration tests all fail with `No stack found for test x`.

This PR updates all the integration tests to the new standard using `integ-runner` + `integ-tests` libraries.

Integration tests tend to generate a lot of files for the snapshot, hence the 111 files in the PR.

This PR is breaking up my previous PR, #21221

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot pushed a commit that referenced this pull request Jul 21, 2022
A few integration tests slipped under the radar and were not updated with the new integ-tests library. 

Also corrected typos.

Relates to:
#21237 
#21221 

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
comcalvi pushed a commit to comcalvi/aws-cdk that referenced this pull request Jul 25, 2022
…nstruct (aws#21237)

Currently when you run `yarn build+test+extract`, integration tests all fail with `No stack found for test x`.

This PR updates all the integration tests to the new standard using `integ-runner` + `integ-tests` libraries.

Integration tests tend to generate a lot of files for the snapshot, hence the 111 files in the PR.

This PR is breaking up my previous PR, aws#21221

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
comcalvi pushed a commit to comcalvi/aws-cdk that referenced this pull request Jul 25, 2022
A few integration tests slipped under the radar and were not updated with the new integ-tests library. 

Also corrected typos.

Relates to:
aws#21237 
aws#21221 

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@TheRealAmazonKendra
Copy link
Copy Markdown
Contributor

@michaeldrey Do you plan to make any updates to this PR or just the other two that came out of this? If the latter, let's close this one so we don't have extra PRs open that we're not going to review.

@michaeldrey
Copy link
Copy Markdown
Contributor Author

@TheRealAmazonKendra I'll close this one as the other two capture all the features in this PR.

mergify bot pushed a commit that referenced this pull request Jul 30, 2022
…21261)

This PR exposes the idleTime property for both EC2 and Fargate ALB services. [Per the CFN specs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-loadbalancer-loadbalancerattributes.html), I have set the idleTimeout to default to 60 seconds, and it cannot exceed 4000 seconds.

If no value is provided we set the value to undefined. We do this because:

1. The default value is set for the user via the CFN. The behavior for the property is to either add a value or leave it undefined and let CFN set the default.[ See here](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts#L102)

2. Setting a default causes snapshot tests to fail for dependent services as we're adding a new attribute to the cloudformation.

A README entry has been created for this property.

Relates to
#21221
#21266

closes #12913
----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot pushed a commit that referenced this pull request Aug 1, 2022
…ices (#21266)

This PR exposes the idleTime property for both EC2 and Fargate **multi** ALB services. [Per the CFN specs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-loadbalancer-loadbalancerattributes.html), I have set the idleTimeout to default to 60 seconds, and it cannot exceed 4000 seconds.

If no value is provided we set the value to undefined. We do this because:

1. The default value is set for the user via the CFN. The behavior for the property is to either add a value or leave it undefined and let CFN set the default.[ See here](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts#L102)

2. Setting a default causes snapshot tests to fail for dependent services as we're adding a new attribute to the cloudformation.

A README entry has been created for this property.

Relates to
#21221
#21261

closes #12913
----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ApplicationLoadBalancedFargateService CDK construct: currently there is no way to specify idleTimeout for the load balancer

3 participants