cloudtools / stacker

An AWS CloudFormation Stack orchestrator/manager.
http://stacker.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
711 stars 167 forks source link

Xref Credential Profile Issue #743

Open josjaf opened 4 years ago

josjaf commented 4 years ago

Using the following stack definition, I'm having issues with an xref, Stacker is reading the wrong credential profile - I would assume here that it would read the credential profile that is defined with the stack, not from the boto3 sdk order. This xref should be available from the default profile, but I'm getting an error:

Couldn't resolve lookup in variable `SGMain`, lookup: ${Lookup<Literal<'xref'> Literal<'normandy-aws2-nat-vpc::ManagedSecurityGroup'>>}: (<class 'stacker.exceptions.StackDoesNotExist'>) Stack: "normandy-aws2-nat-vpc" does not exist in outputs or the lookup is not available in this stacker run)

When I export AWS_PROFILE=nondefaultprofile, the error goes away.

  - name: test
    template_path: templates/deploy.yml
    enabled: true
    profile: ${default_profile}
    variables:
      namespace: ${namespace}
      ECRArn: ${ecr_arn}
      KeyPairName: user
      ImageId: ${ami} # amazon linux2 us-east-1
      SubnetId: ${subnet} #${subnet} # public subnet
      VpcId: ${vpcid}
      VpcCidr: ${vpccidr}
      SGMain: ${sg}