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

feat(autoscaling): allow setting autoscaling group name #8853

Merged
merged 4 commits into from
Jul 7, 2020

Conversation

NetaNir
Copy link
Contributor

@NetaNir NetaNir commented Jul 2, 2020

Allow setting autoscaling group name.
And also shimgrate (shim migration) autoscaling module to jest - thanks @rix0rrr <3

closes #5593


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

@NetaNir NetaNir requested a review from rix0rrr July 2, 2020 05:50
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jul 2, 2020
@NetaNir NetaNir requested a review from a team July 2, 2020 05:51
@NetaNir NetaNir self-assigned this Jul 2, 2020
@NetaNir NetaNir requested a review from eladb July 3, 2020 18:53
@@ -596,7 +607,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements

this.autoScalingGroup = new CfnAutoScalingGroup(this, 'ASG', asgProps);
this.osType = imageConfig.osType;
this.autoScalingGroupName = this.autoScalingGroup.ref;
this.autoScalingGroupName = Token.isUnresolved(this.physicalName) ? this.autoScalingGroup.ref : this.physicalName;
Copy link
Contributor

Choose a reason for hiding this comment

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

#We usually always return the ref in this case because when it’s used in the template it also encodes the implicit dependency. If we just return the concrete string, there won’t be an implicit dependency

Copy link
Contributor Author

@NetaNir NetaNir Jul 5, 2020

Choose a reason for hiding this comment

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

What about the cross region referencing case? is this only true for resources who's id is the resource name?

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to use this.getResourceName and getResourceArn to obtain a polymorphic token for the name.

See other examples like s3 buckets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Looks good

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@NetaNir NetaNir merged commit 38d8414 into master Jul 7, 2020
@NetaNir NetaNir deleted the neta/add-asg-name branch July 7, 2020 06:15
@bobmoff
Copy link

bobmoff commented Jul 7, 2020

Thanks for this! 🙇🏻‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoScalingGroup construct doesn't allow to set autoScalingGroupName
4 participants