aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

Using Fn::Import with ChangeSet that IncludeNestedStacks set to True gives error "TemplateURL must be a supported URL."

Open
#1,212 2 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

AWS::CloudFormation::Stack

### Resource Name

_No response_

### Issue Description

Using `Fn::Import` in template when creating a ChangeSet with `IncludeNestedStacks` set to `True` gives error "TemplateURL must be a supported URL."

See template below.

```
Parameters:
MyExportName:
Type: String

Resources:
Stack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Sub:
- https://${BucketName}.s3.${AWS::Region}.amazonaws.com/template.yaml
- BucketName:
Fn::ImportValue: !Sub ${SSMParameter}-Export
```

This also fails when trying to use `Fn::ImportValue` under `Fn::Join`.

I suspect that the `IncludeNestedStacks` feature when creating changesets does not work with `Fn::ImportValue`. Because if I specify `IncludeNestedStacks` to false, the error goes away.

Removing `Fn::ImportValue` also fixes this issue.

### Expected Behavior

It should not fail.

### Observed Behavior

It fails with the error `TemplateURL must be a supported URL.`

### Test Cases

Create a changeset with a template that has an `AWS::CloudFormation::Stack` resource, with TemplateURL using Fn::ImportValue, like the above example.

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by creating the reported ChangeSet with the supplied AWS::CloudFormation::Stack template, using Fn::ImportValue under Fn::Sub and IncludeNestedStacks set to true; compare it with IncludeNestedStacks set to false. Done means the change set accepts the imported TemplateURL without reporting “TemplateURL must be a supported URL.”

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.