Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChangeSet creation failure with {{IntrinsicFunction:(stack_name)//Fn::ImportValue}} is not allowed. #152

Open
mrlikl opened this issue Dec 29, 2023 · 1 comment

Comments

@mrlikl
Copy link

mrlikl commented Dec 29, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about the bug

What goes wrong? Please describe the issue in as much detail as possible.

When a nested stack is referencing a parameter that is passed from the root/parent stack as intrinsic functions, a similar error
Usage of {{IntrinsicFunction:stack_name//Fn::ImportValue}} is not allowed.
Usage of {{IntrinsicFunction:stack_name/logical_idFn::GetAtt}} is not allowed.
is occurring

Expected behavior

Change set to be successfully create

Observed behavior

Change set failure with the error

Test cases

Please include a minimal CloudFormation template here that reproduces the issue

Create a stack with simple S3 bucket

root.yml

AWSTemplateFormatVersion: "2010-09-09"
Resources:
  RootS3Bucket:
    Type: AWS::S3::Bucket

Create change set with a nested stack like below -

root.yml

AWSTemplateFormatVersion: "2010-09-09"
Resources:
  TestRule:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: nested.yml
      Parameters:
        TagValue: !GetAtt RootS3Bucket.Arn
  RootS3Bucket:
    Type: AWS::S3::Bucket

nested.yml

AWSTemplateFormatVersion: 2010-09-09
Transform: 'AWS::LanguageExtensions'

Parameters:
  TagValue:
    Type: String

Resources:
  'Fn::ForEach::Buckets':
    - Names
    - - Store1
      - Store2
    - '${Names}Bucket':
        Type: 'AWS::S3::Bucket'
        Properties:
          Tags:
            - Key: parameters
              Value: !Ref TagValue

Additional context

Anything else we should know?

@nsmedira
Copy link

nsmedira commented Jan 2, 2024

I am also seeing this behavior. I believe that the use of Transform: 'AWS::LanguageExtensions' is correlated with the error.

Like you, I have a nested stack whose input parameters are the result of intrinsic functions in the parent stack. I am also using Transform: 'AWS::LanguageExtensions' in order to add Fn::ForEach to a previously-working nested template. Merely adding Transform: 'AWS::LanguageExtensions' to this previously-working nested template causes the illegal usage error described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants