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

@aws-cdk_aws-apprunner-alpha.Service: (serviceName property returns apprunner ARN instead of apprunner service name) #23351

Closed
ayrawat17 opened this issue Dec 15, 2022 · 4 comments
Assignees
Labels
@aws-cdk/aws-apprunner Related to the apprunner package bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@ayrawat17
Copy link

Describe the issue

When using the class Service [1] in cdk to create Apprunner Service and further using serviceName property [2] it returns apprunner ARN instead of apprunner service name.

The serviceName property translates to !Ref on the logical id of the Apprunner Service resource in CFN template. On checking the "AWS::AppRunner::Service" return value in CFN doc, we can see: [3] , !Ref returns the following: i.e ARN of the App Runner service.
++++++++++++++++++++
Ref
When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the ARN of the App Runner service.
++++++++++++++++++++

Links

[1] https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html
[2] https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html#servicenamespan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan-1
[3] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apprunner-service.html#aws-resource-apprunner-service-return-values

@ayrawat17 ayrawat17 added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Dec 15, 2022
@github-actions github-actions bot added the @aws-cdk/aws-apprunner Related to the apprunner package label Dec 15, 2022
@peterwoodworth
Copy link
Contributor

peterwoodworth commented Dec 23, 2022

Thanks for reporting this, it does look like this returns the service arn. CloudFormation doesn't seem to directly offer the name of the service either, which makes this a bit tricky to fix. We could potentially use intrinsic methods to split the arn such that we only return the name of the service, otherwise I'm not sure what we could do here other than removing the property while we wait for CloudFormation support.

I believe splitting the arn would look like the code block below, however I'm not confident that this pattern follows for every service arn. I'm basing this off of the following arn I get when creating a new service in my account arn:aws:apprunner:us-east-1:123456789012:service/MyService/6841b388d651313597f390163192ec94

fn.select(1, fn.split('/', serviceArn))

edit: this pattern should be consistent

@peterwoodworth peterwoodworth added bug This issue is a bug. p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. documentation This is a problem with documentation. labels Dec 23, 2022
@stephenhouser
Copy link

It appears the AppRunner Service ignores the serviceName property on creation.

@peterwoodworth
Copy link
Contributor

fixed in #26015

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-apprunner Related to the apprunner package bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

No branches or pull requests

4 participants