This message was deleted.
# general
s
This message was deleted.
b
it sure does, just use string interpolation in your language of choice
you may have to do some manipulation (ie use an apply) if you're using an output in the string
d
Thanks @billowy-army-68599! I should be able to get the region from
pulumi.Config()
, but I’m not sure how to grab the CloudFormation StackName from an AutoScalingGroup b/c it needs to be interpolated in
userData
, which gets passed to the AutoScalingGroup constructor.
Copy code
const userData = 
`#!/bin/bash
/usr/local/bin/cfn-signal --stack ${output of autoScalingGroup.stack.name...}`

const autoScalingGroup = new awsx.autoscaling.AutoScalingGroup("name", { userData });
This feels like a circular reference and I’m not sure how to accomplish it.
b
one sec
this is how I've done it previously
Copy code
let userData = Buffer.from(`#!/bin/bash
STACK_NAME=$(aws ec2 describe-instances --instance-id $(curl -s <http://169.254.169.254/latest/dynamic/instance-identity/document> | jq .instanceId -r) --region eu-west-1 --query 'Reservations[*].Instances[*].Tags[?Key==\`aws:cloudformation:stack-name\`].Value' --output text)
REGION=$(curl -s <http://169.254.169.254/latest/dynamic/instance-identity/document> | jq .region -r)
ASG_NAME=$(aws ec2 describe-instances --instance-id $(curl -s <http://169.254.169.254/latest/dynamic/instance-identity/document> | jq .instanceId -r) --region eu-west-1 --query 'Reservations[*].Instances[*].Tags[?Key==\`aws:autoscaling:groupName\`].Value' --output text)
echo "sending cfn-signal"
/opt/aws/bin/cfn-signal --resource \${ASG_NAME} --stack \${STACK_NAME} --region \${REGION}`).toString('base64');
i just grabbed the cloudformation stack name from the ec2 metadata, seemed easier
d
Cool, thanks. what’s the IP address in this example?
b
d
oh gotcha, thanks again, really appreciate it