Displaying the app URL in the workflow diagram
If your workflow deploys an application, you can configure Amazon CodeCatalyst to display the application's URL as a clickable link. This link appears in the CodeCatalyst console, inside the action that deployed it. The following workflow diagram shows the View App URL appearing at the bottom of an action.
By making this URL clickable in the CodeCatalyst console, you can quickly verify your application deployment.
Note
The app URL is not supported with the Deploy to Amazon ECS action.
To enable this feature, add an output variable to your action with a name that contains
appurl
, or endpointurl
. You can use a name with or without a joining
dash (-
), underscore (_
), or space (
). The string is
case-insensitive. Set the variable's value to the http
or https
URL of
your deployed application.
Note
If you're updating an existing output variable to include the app url
, or
endpoint url
string, update all references to this variable to use the new
variable name.
For detailed steps, see one of the following procedures:
When you've finished configuring the URL, verify that it appears as expected by following these instructions:
To display the app URL in the "AWS CDK deploy" action
-
If you're using the AWS CDK deploy action, add a
CfnOutput
construct (which is a key-value pair) in your AWS CDK application code:-
The key name must contain
appurl
, orendpointurl
, with or without a joining dash (-
), underscore (_
), or space ( -
The value must be the
http
orhttps
URL of your deployed application.
For example, your AWS CDK code might look like this:
import { Duration, Stack, StackProps, CfnOutput, RemovalPolicy} from 'aws-cdk-lib'; import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; import * as s3 from 'aws-cdk-lib/aws-s3'; import { Construct } from 'constructs'; import * as cdk from 'aws-cdk-lib'; export class HelloCdkStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const bucket = new s3.Bucket(this, 'amzn-s3-demo-bucket', { removalPolicy: RemovalPolicy.DESTROY, });
new CfnOutput(this, 'APP-URL', {
value: https://mycompany.myapp.com,
description: 'The URL of the deployed application', exportName: 'myApp', }); ... } }For more information about the
CfnOutput
construct, see interface CfnOutputProps in the AWS Cloud Development Kit (AWS CDK) API Reference. -
-
Save and commit your code.
-
Proceed to To verify that the application URL was added.
To display the app URL in the "Deploy AWS CloudFormation stack" action
-
If you're using the Deploy AWS CloudFormation stack action, add an output to the
Outputs
section in your CloudFormation template or AWS SAM template with these characteristics:-
The key (also called the logical ID) must contain
appurl
, orendpointurl
, with or without a joining dash (-
), underscore (_
), or space ( -
The value must be the
http
orhttps
URL of your deployed application.
For example, your CloudFormation template might look like this:
"Outputs" : {
"APP-URL" : {
"Description" : "The URL of the deployed app","Value" : "https://mycompany.myapp.com",
"Export" : { "Name" : "My App" } } }For more information about CloudFormation outputs, see Outputs in the AWS CloudFormation User Guide.
-
-
Save and commit your code.
-
Proceed to To verify that the application URL was added.
To display the app URL in all other actions
If you're using another action to deploy your application, such as the build action or GitHub Actions, do the following to have the app URL displayed.
-
Define an environment variable in the
Inputs
orSteps
section of the action in the workflow definition file. The variable must have these characteristics:-
The
name
must containappurl
, orendpointurl
, with or without a joining dash (-
), underscore (_
), or space ( -
The value must be the
http
orhttps
URL of your deployed application.
For example, a build action might look like this:
Build-action: Identifier: aws/build@v1 Inputs: Variables: -
Name: APP-URL
Value: https://mycompany.myapp.com
...or this:
Actions: Build: Identifier: aws/build@v1 Configuration: Steps: - Run:
APP-URL=https://mycompany.myapp.com
For more information about defining environment variables, see Defining a variable.
-
-
Export the variable.
For example, your build action might look like this:
Build-action: ... Outputs: Variables: -
APP-URL
For information about exporting variables, see Exporting a variable so that other actions can use it.
-
(Optional) Choose Validate to validate the workflow's YAML code before committing.
-
Choose Commit, enter a commit message, and choose Commit again.
-
Proceed to To verify that the application URL was added.
To verify that the application URL was added
-
Start a workflow run, if it hasn't started automatically. The new run should have the app URL displayed as a clickable link in its workflow diagram. For more information about starting runs, see Starting a workflow run manually.