-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
@@ -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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thanks for this! 🙇🏻♂️ |
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