Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ecs): rename service logical id (under feature flag) #6348

Closed
wants to merge 2 commits into from

Conversation

piradeepk
Copy link
Contributor

@piradeepk piradeepk commented Feb 18, 2020

Using the feature flag, update the logical id created by the baseService to append Resource rather than Service.

BREAKING CHANGE: ECS services (irrespective of whether they're ec2 or fargate services) created using the BaseService construct (and extensions) will have their logical ids removing the suffix Service. If the aws-cdk/aws-ecs:enableCfnServiceResourceRename flag is enabled, a customer who created a stack prior to this change will be forced to recreate their entire service.

Fixes: #3763


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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: cfdf1fa
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 5215f2a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 618e510
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@piradeepk piradeepk added the pr/do-not-merge This PR should not be merged at this time. label Feb 18, 2020
@piradeepk
Copy link
Contributor Author

Looks like the tests are passing irrespective of the content within it. Added the label until I can figure out why.

@piradeepk
Copy link
Contributor Author

Test updated.

@piradeepk piradeepk removed the pr/do-not-merge This PR should not be merged at this time. label Feb 18, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 2762406
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

* If this is set, any newly created ECS service will have the logical name end
* with `Resource` rather than `Service`.
*/
export const ENABLE_CFN_SERVICE_RESOURCE_RENAME = 'aws-cdk/aws-ecs:enableCfnServiceResourceRename';
Copy link
Contributor

Choose a reason for hiding this comment

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

Would prefer to call this something snappier and more to the point, like shortLogicalId.

Copy link
Contributor

Choose a reason for hiding this comment

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

Add _CONTEXT to the variable name to mirror the ENABLE_DIFF example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed it to ENABLE_SHORTEN_SRVC_LOGICAL_ID_CONTEXT any objection?

Resources: {
Fargate001516A4: {
Type: "AWS::ECS::Service",
Properties: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we only care about the name, is it okay if you leave Properties out or empty? Don't want to accidentally assert things that aren't relevant to this particular test.

Might be that our current assertion doesn't allow it, but I'd like to try.

import { Test } from 'nodeunit';
import * as ecs from '../../lib';
import { LaunchType } from '../../lib/base/base-service';

export = {
"When creating a Fargate Service": {
"with service id renamed to resource (with feature flag enabled)"(test: Test) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you also have a test to test the old case? (With the long name?)

@rix0rrr
Copy link
Contributor

rix0rrr commented Feb 19, 2020

Also, please name the PR with the customer in mind.

The customer will read the following bullet in our CHANGELOG:

FIXES:

  • ecs: rename cfnservice id to resource (under feature flag)

Will they know what that means for them?

@eladb
Copy link
Contributor

eladb commented Mar 1, 2020

Please follow the guidelines on how to author the BREAKING CHANGE section for features under flags

@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 2, 2020

Please follow the guidelines on how to author the BREAKING CHANGE section for features under flags

Because of the flag this won't be a breaking change though, right?

@eladb
Copy link
Contributor

eladb commented Mar 2, 2020

No, it won’t, but are utilizing this section to announce the feature flag: https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md

@eladb
Copy link
Contributor

eladb commented Mar 2, 2020

@eladb eladb removed their request for review March 9, 2020 11:01
@piradeepk piradeepk changed the title fix(ecs): rename cfnservice id to resource (under feature flag) fix(ecs): rename service logical id (under feature flag) Mar 24, 2020
@mergify
Copy link
Contributor

mergify bot commented Mar 25, 2020

Once all the requested changes have been addressed, and the PR is ready for another review, remember to dismiss the review.

@piradeepk
Copy link
Contributor Author

Closing for the time being

@piradeepk piradeepk closed this Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-ecs: Service resource named "Service" instead of "Resource"
4 participants