Skip to content

Conversation

@lriostavira
Copy link

Motivation

Problem: Terraform AWS provider automatically calls ListTagsForResource after creating resources. When deploying Step Functions with activities, Terraform fails because LocalStack returns ResourceNotFound for activity ARNs, even though the activities were successfully created.

Root Cause: The list_tags_for_resource() function only checked the state_machines store and ignored activities entirely.

Solution: Add tag support for activities following the same pattern used for state machines.

Changes

  • Extracted TagManager to a shared module for reuse between activities and state machines
  • Added tag_manager field to Activity class with proper initialization
  • Updated tag_resource(), untag_resource(), and list_tags_for_resource() to handle both activity and state machine ARNs
  • Updated create_activity() to accept and store tags

This implements the TODO comments at lines 1392, 1404, and 1416 in provider.py.

Tests

Added 3 new test methods in test_sfn_api_tagging.py:
✅ test_tag_activity() - Tests tagging activities with various tag lists (empty, single, multiple)
✅ test_untag_activity() - Tests removing tags from activities
✅ test_create_activity_with_tags() - Tests creating activities with initial tags

# Create activity with tags
aws stepfunctions create-activity --name test --tags '[{"key":"env","value":"dev"}]'

# List tags (previously returned ResourceNotFound, now works)
aws stepfunctions list-tags-for-resource --resource-arn <activity-arn>

# Terraform now completes successfully without errors

Related

Closes #13430

Copy link
Contributor

@localstack-bot localstack-bot left a comment

Choose a reason for hiding this comment

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

Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.

@localstack-bot
Copy link
Contributor

localstack-bot commented Nov 27, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@lriostavira
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

localstack-bot added a commit that referenced this pull request Nov 27, 2025
@lriostavira
Copy link
Author

Hey team, @dominikschubert , i'm not able to add labels to this PR, is there write access that i can be granted in order to add labels?

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

Successfully merging this pull request may close these issues.

feature request: Add tag support for Step Functions activities

2 participants