acantril / learn-cantrill-io-labs

Standard and Advanced Demos for learn.cantrill.io courses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[AdvancedDemo] Architecture Evolution - STAGE2

MohamedAYACH opened this issue · comments

Hello,

The user data does not excecute.

thx in advance

you have probably missed one or more of the SSM parameter store values you should have added in the setup part of the demo. Have you added DBName, DBUser and the others ?

Hello,

thx for you quick response, I did when I put it manually form the launched EC2 it grabs the parameters stores...

When I Echo $DBPassword from the created instance I get nothing so I run the command manually:

DBPassword=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBPassword --with-decryption --query Parameters[0].Value)
DBPassword=`echo $DBPassword | sed -e 's/^"//' -e 's/"$//'`

and run ECHO $DBPassword again it shows.

2021-07-08 12_01_42-AWS Systems Manager - Parameter Store and 4 more pages - Work - Microsoft​ Edge

DBPassword=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBPassword --with-decryption --query Parameters[0].Value | tr -d \")
DBRootPassword=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBRootPassword --with-decryption --query Parameters[0].Value | tr -d \" | tr -d \")
DBUser=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBUser --query Parameters[0].Value | tr -d \")
DBName=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBName --query Parameters[0].Value | tr -d \")
DBEndpoint=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBEndpoint --query Parameters[0].Value | tr -d \")

updating the User Data variables section to look like that worked for me. I don't know why but removing the lines with the echo worked.

did you do any different config with the AWS cli ? change the output format or anything ?

the change you have made @ryanef look to handle a different structure output from the SSM CLI interaction

@acantril It's what I found in the post by "Update for Advanced Demo - Web App - Single Server to Elastic Evolution - STAGE 2" from earlier this year. I was stumped after double checking the parameters I put into Systems Manager so gave that a shot and it worked for some reason. When I was doing the manual WP installation for stage 1 and pasted in those commands, it didn't automatically get the DBRootPassword and I had to put it in myself.

That didn't really answer my question...i've just tested the demo and it worked fine as is. It means you did something 'different' and I'm trying to work out what it is :)

closing because no comments.