diff --git a/moto/sns/models.py b/moto/sns/models.py index 23c36915b648..cfa406cad786 100644 --- a/moto/sns/models.py +++ b/moto/sns/models.py @@ -1272,6 +1272,7 @@ def get_config_resource(self, resource_id: str) -> dict[str, Any] | None: "arn": topic.arn, "awsRegion": self.region_name, "availabilityZone": "Not Applicable", + "tags": dict(topic._tags), "configuration": { "topicArn": topic.arn, "displayName": topic.display_name, @@ -1284,7 +1285,7 @@ def get_config_resource(self, resource_id: str) -> dict[str, Any] | None: }, "supplementaryConfiguration": { "Tags": json.dumps( - [{"Key": k, "Value": v} for k, v in topic._tags.items()] + [{"key": k, "value": v} for k, v in topic._tags.items()] ) }, "configurationItemMD5Hash": "", diff --git a/tests/test_sns/test_topics.py b/tests/test_sns/test_topics.py index 46fa524adee5..846af82cd4db 100644 --- a/tests/test_sns/test_topics.py +++ b/tests/test_sns/test_topics.py @@ -711,7 +711,12 @@ def test_get_config_resource(): assert configuration["fifoTopic"] is True assert configuration["contentBasedDeduplication"] is True tags = json.loads(config_item["supplementaryConfiguration"]["Tags"]) - assert tags == [{"Key": "Environment", "Value": "Test"}] + assert tags == [{"key": "Environment", "value": "Test"}] + + history = config_client.get_resource_config_history( + resourceType="AWS::SNS::Topic", resourceId=topic_arn + ) + assert history["configurationItems"][0]["tags"] == {"Environment": "Test"} response = config_client.batch_get_resource_config( resourceKeys=[