Closed Spareo closed 6 years ago
Hey @Spareo - if you want to use it inside the template, you can always use the ${AWS::StackName}
pseudo parameter. Sub
can make that super easy to use in a templated way:
Let me know if that helps, thanks!
Is there a way to force that to resolve into the actual string that is the stack name? I need to pass into a cloud watch event that takes a json string object so Im calling json.dumps
on an array of inputs that I want to pass into the event.
If I just use Ref("AWS::StackName")
won't that ust put the name of the type into my array?
There's a few way to do this - just to verify: you want the stackname in parts of a JSON document that you want to submit in a cloudformation template? Can you share the Cloudformation resource itself that you're dealing with to give me a better idea?
I was able to back into it like this from within the blueprint:
def get_stack_name(self):
stacks = self.context.get_stacks()
for stack in stacks:
if (stack.blueprint.name == self.name):
return stack.fqn
Closing the issue since I have a working solution
I am trying to figure out how to access get the name of the stack as it's shown in CloudFormation from within the blueprint during deployment? I have a script that builds the config.yml file and sets the
stack_name
property of the stack in the config file. Stacker build then deploys the stack with the namespace prepended to it in CloudFormation.Is there a way to get that final stack as it's shown in CloudFormation from within the blueprint?