Skip to content

Commit 25c405f

Browse files
committed
Stack config retrieval test
1 parent 7b402e7 commit 25c405f

File tree

1 file changed

+7
-0
lines changed
  • workshops/serverless-testing-workshop/demo-app

1 file changed

+7
-0
lines changed

workshops/serverless-testing-workshop/demo-app/urs-ui.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ def update_unicorn_reserve_list():
225225
key="api_endpoint_url",
226226
on_change=update_api_endpoint
227227
)
228+
if st.button("Retrieve API Endpoint"):
229+
cfn_client = boto3.client('cloudformation')
230+
response = cfn_client.describe_stacks(StackName=os.environ.get('BACKEND_STACK_NAME','urs-backend'))
231+
for output in response['Stacks'][0]['Outputs']:
232+
if output['OutputKey'] == 'ApiEndpoint':
233+
st.session_state['api_endpoint_url'] = output['OutputValue']
234+
228235

229236
# File picker for uploading to the unicorn inventory
230237
uploaded_file = st.file_uploader("Choose a CSV file for the Unicorn Inventory.", type=["csv"])

0 commit comments

Comments
 (0)