Skip to content

feat(cloudwatch-logs): add ListTagsForResource, TagResource, and UntagResource#172

Merged
hectorvent merged 1 commit intofloci-io:mainfrom
tmchow:feat/77-cloudwatch-list-tags-for-resource
Apr 3, 2026
Merged

feat(cloudwatch-logs): add ListTagsForResource, TagResource, and UntagResource#172
hectorvent merged 1 commit intofloci-io:mainfrom
tmchow:feat/77-cloudwatch-list-tags-for-resource

Conversation

@tmchow
Copy link
Copy Markdown
Contributor

@tmchow tmchow commented Apr 2, 2026

Summary

Added the resource-based tag operations (ListTagsForResource, TagResource, UntagResource) to the CloudWatch Logs handler. These are the newer AWS API operations that use ARN-based resource identification, replacing the older ListTagsLogGroup/TagLogGroup/UntagLogGroup operations.

Changes

Updated CloudWatchLogsHandler.java:

  • Added three new case handlers in the action switch: ListTagsForResource, TagResource, UntagResource
  • Added extractLogGroupNameFromArn() helper to parse log group names from resource ARNs (format: arn:aws:logs:region:account:log-group:name)
  • Each new handler delegates to the existing service methods (listTagsLogGroup, tagLogGroup, untagLogGroup) after extracting the group name from the ARN

The response format for ListTagsForResource matches the AWS API specification (flat tags object), which is the same format the existing ListTagsLogGroup handler uses.

Context

This fixes the UnsupportedOperation: Operation ListTagsForResource is not supported error that occurs when creating CloudWatch log groups via Terraform, since Terraform uses the newer resource-based API.

Fixes #77

This contribution was developed with AI assistance (Claude Code).

…gResource support

Add the newer resource-based tag operations (ListTagsForResource,
TagResource, UntagResource) to the CloudWatch Logs handler. These
operations use ARN-based resource identification instead of the older
log group name-based operations (ListTagsLogGroup, TagLogGroup,
UntagLogGroup).

The implementation extracts the log group name from the resource ARN
and delegates to the existing tag service methods.

Fixes floci-io#77
@hectorvent
Copy link
Copy Markdown
Collaborator

Thanks @tmchow!

This is a great addition to Floci.

@hectorvent hectorvent merged commit 835f8c6 into floci-io:main Apr 3, 2026
@tmchow
Copy link
Copy Markdown
Contributor Author

tmchow commented Apr 3, 2026

Thanks for the quick turnaround on the review!

hectorvent pushed a commit that referenced this pull request Apr 4, 2026
# [1.2.0](1.1.0...1.2.0) (2026-04-04)

### Bug Fixes

* adding aws-cli in its own floci image hectorvent/floci:x.y.z-aws ([#151](#151)) ([aba9593](aba9593))
* **cognito:** auto-generate sub, fix JWT sub claim, add AdminUserGlobalSignOut ([#68](#68)) ([#183](#183)) ([9d6181c](9d6181c))
* **cognito:** enrich User Pool responses and implement MfaConfig stub ([#198](#198)) ([441d9f1](441d9f1))
* **Cognito:** OAuth/OIDC parity for RS256/JWKS, /oauth2/token, and OAuth app-client settings ([#97](#97)) ([a4af506](a4af506))
* **core:** globally inject aws request-id headers for sdk compatibility ([#146](#146)) ([35e129d](35e129d)), closes [#145](#145)
* defer startup hooks until HTTP server is ready ([#157](#157)) ([#159](#159)) ([59c24c5](59c24c5))
* **dynamodb:** fix FilterExpression for BOOL types, List/Set contains, and nested attribute paths ([#137](#137)) ([453555a](453555a)), closes [#126](#126)
* **lambda:** copy function code to /var/runtime for provided runtimes ([#114](#114)) ([a5ad6cf](a5ad6cf))
* merge branch 'main' into release/1.x ([0105e36](0105e36))
* polish HealthController ([#188](#188)) ([084237d](084237d))
* remove private modifier on injected field ([#186](#186)) ([ebc0661](ebc0661))
* resolve CloudFormation Lambda Code.S3Key base64 decode error ([#62](#62)) ([78be523](78be523))
* resolve numeric ExpressionAttributeNames in DynamoDB expressions ([#192](#192)) ([d93296a](d93296a))
* return stable cursor tokens in GetLogEvents to fix SDK pagination loop ([#90](#90)) ([#184](#184)) ([7354663](7354663))
* **s3:** Evaluate S3 CORS against incoming HTTP Requests ([#131](#131)) ([e78c833](e78c833))
* **s3:** list part for multipart upload ([#164](#164)) ([7253559](7253559))
* **s3:** persist Content-Encoding header on S3 objects ([#57](#57)) ([ff2f68d](ff2f68d))
* **s3:** prevent S3VirtualHostFilter from hijacking non-S3 requests ([#199](#199)) ([59cdc3f](59cdc3f))
* **s3:** resolve file/folder name collision on persistent filesystem ([#134](#134)) ([020a546](020a546))
* **s3:** return CommonPrefixes in ListObjects when delimiter is specified ([#133](#133)) ([845ac85](845ac85))
* **secretsmanager:** return KmsKeyId in DescribeSecret and improve ListSecrets ([#195](#195)) ([1e44f39](1e44f39))
* **sns:** enforce FilterPolicy on message delivery ([#53](#53)) ([2f875d4](2f875d4)), closes [#49](#49)
* **sns:** honor RawMessageDelivery attribute for SQS subscriptions ([#54](#54)) ([b762bec](b762bec))
* **sns:** pass messageDeduplicationId from FIFO topics to SQS FIFO queues ([#171](#171)) ([4529823](4529823))
* **sqs:** route queue URL path requests to SQS handler ([#153](#153)) ([6bbc9d9](6bbc9d9)), closes [#99](#99) [#17](#17)
* **sqs:** support binary message attributes and fix MD5OfMessageAttributes ([#168](#168)) ([5440ae8](5440ae8))
* **sqs:** translate Query-protocol error codes to JSON __type equivalents ([#59](#59)) ([7d6cf61](7d6cf61))
* support DynamoDB Query BETWEEN and ScanIndexForward=false ([#160](#160)) ([cf2c705](cf2c705))
* wrong method call in test ([665af53](665af53))

### Features

* add support of Cloudformation mapping and Fn::FindInMap function ([#101](#101)) ([eef6698](eef6698))
* **cloudwatch-logs:** add ListTagsForResource, TagResource, and UntagResource support ([#172](#172)) ([835f8c6](835f8c6)), closes [#77](#77)
* **cognito:** add group management support ([#149](#149)) ([75bf3c3](75bf3c3))
* health endpoint ([#139](#139)) ([fb42087](fb42087))
* implement UploadPartCopy for S3 multipart uploads ([#98](#98)) ([d1b9a9c](d1b9a9c))
* **lambda:** implement ListVersionsByFunction API ([#182](#182)) ([#193](#193)) ([ecf25d4](ecf25d4))
* officially support Docker named volumes for Native images ([#155](#155)) ([4fc9398](4fc9398))
* **s3:** support Filter rules in PutBucketNotificationConfiguration ([#178](#178)) ([ef06fc3](ef06fc3))
* support GenerateSecretString and Description for AWS::SecretsManager::Secret in CloudFormation ([#176](#176)) ([f994b95](f994b95))
* support GSI and LSI in CloudFormation DynamoDB table provisioning ([#125](#125)) ([48bee44](48bee44))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] CloudWatch Logs: ListTagsForResource

2 participants