Skip to content

Conversation

@silv-io
Copy link
Member

@silv-io silv-io commented Sep 16, 2025

Motivation

In our ongoing effort to improve IaC usability, we want to improve the accuracy and precision of our error messages.
One key part that is currently missing in our implementation is knowing which resources are actually publicly available on AWS itself.

To make this available we need to consider the following:

  1. We can't be sure that there is one region that represents a superset of all resources, so we need to check all regions that are available to us
  2. There are two options for gathering the data: (a) the schema documentation (b) the list_types API. A comparison showed that the list_types API delivers more results (albeit only 1 resource more)

Changes

  • Add a script to gather from the CloudFormation API, which resources are available across all (available) regions of AWS and make it available as a generated python file inside of the localstack-core package.
  • Add a workflow to automatically run this script to update the generated file.

Testing

TODO

What's left to do:

  • Discuss if we actually need to track in which regions resources are available /cc @simonrw
  • Discuss the cadence of the updates

@silv-io silv-io added semver: patch Non-breaking changes which can be included in patch releases aws:cloudformation AWS CloudFormation docs: skip Pull request does not require documentation changes labels Sep 16, 2025
@github-actions
Copy link

github-actions bot commented Sep 16, 2025

Test Results - Preflight, Unit

22 172 tests  ±0   20 434 ✅ ±0   15m 26s ⏱️ -31s
     1 suites ±0    1 738 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit ea0a1de. ± Comparison against base commit 4012f01.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 16, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 20s ⏱️ -6s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit ea0a1de. ± Comparison against base commit 4012f01.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 16, 2025

Test Results - Alternative Providers

572 tests   330 ✅  25m 49s ⏱️
  1 suites  242 💤
  1 files      0 ❌

Results for commit ea0a1de.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 16, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 37m 0s ⏱️
5 037 tests 4 556 ✅ 481 💤 0 ❌
5 043 runs  4 556 ✅ 487 💤 0 ❌

Results for commit ea0a1de.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 16, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 56m 57s ⏱️ - 1m 0s
4 663 tests ±0  4 342 ✅ ±0  321 💤 ±0  0 ❌ ±0 
4 665 runs  ±0  4 342 ✅ ±0  323 💤 ±0  0 ❌ ±0 

Results for commit ea0a1de. ± Comparison against base commit 4012f01.

♻️ This comment has been updated with latest results.

@silv-io silv-io force-pushed the iac/generate-cfn-resource-list branch 2 times, most recently from f4af4f0 to f357667 Compare September 17, 2025 13:52
@silv-io silv-io marked this pull request as ready for review September 17, 2025 14:03
Copy link
Member

@pinzon pinzon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this restriction may inconvenience users, I believe the greater challenge would come from conflicts with AWS itself—particularly when resources referenced in templates are unavailable in specific regions.

I'll leave the approval to @simonrw

Comment on lines 49 to 57
- name: Detect changes
id: diff
run: |
git diff --stat
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think this step is not necessary because peter-evans/create-pull-request action would not create a PR if there are no changes


for summary in response.get("TypeSummaries", []):
type_name = summary.get("TypeName")
if type_name and type_name.startswith("AWS::"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment: I am wondering if the assumption that we need to store only resources starting with AWS::`` prefix is correct. It seems that some CloudFormation resources provided by AWS do not start with AWS::prefix, for exampleAlexa::ASK::Skill`.

The list_types operation supports the Filters parameter which allows filtering by resource category type. Specifically, you can use it to list only resources available from Amazon by setting Category=AWS_TYPES. Maybe we can use this type of filtering instead of filtering by resource type prefix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed it now

Copy link
Contributor

@k-a-il k-a-il left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, implementation looks good 🚀 I have a question about filtering CloudFormation resources, but it's mainly about the strategy behind choosing which resources to store, not the implementation itself

@silv-io silv-io force-pushed the iac/generate-cfn-resource-list branch from f357667 to 3a574c1 Compare September 18, 2025 14:00
Copy link
Contributor

@simonrw simonrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no issues with the implementation here, but I wanted to raise å couple of questions:

In the description you say

We can't be sure that there is one region that represents a superset of all resources, so we need to check all regions that are available to us

Is this level of parity really important here? What is the approximate breakdown of resources supported per region that we support in LocalStack?

Also: I have concerns about how this information will be used by LocalStack. We don't yet support the CFn extension registry where users can build their own types. But if we did then we would have to make sure we ignore any custom types they have registered when performing any validation.

@silv-io
Copy link
Member Author

silv-io commented Sep 23, 2025

Is this level of parity really important here? What is the approximate breakdown of resources supported per region that we support in LocalStack?

Also: I have concerns about how this information will be used by LocalStack. We don't yet support the CFn extension registry where users can build their own types. But if we did then we would have to make sure we ignore any custom types they have registered when performing any validation.

@simonrw I think having this information is not immediately necessary, but it's easy to get and can be used for an easy usability win.
I don't think blocking deployments based on not knowing certain resources is something we're planning to do. However, giving out warnings that can indicate to users that some resources might be unsupported by AWS itself can help in their debugging journey.

@k-a-il k-a-il self-requested a review September 23, 2025 14:58
Copy link
Contributor

@k-a-il k-a-il left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@silv-io silv-io merged commit de505e8 into main Sep 23, 2025
42 checks passed
@silv-io silv-io deleted the iac/generate-cfn-resource-list branch September 23, 2025 15:12
@alexrashed alexrashed added the notes: skip Pull request does not have to be mentioned in the release notes label Sep 24, 2025
@alexrashed alexrashed added this to the 4.9 milestone Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws:cloudformation AWS CloudFormation docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants