feat(ec2): implement EC2 service with basic instance operations#205
Merged
feat(ec2): implement EC2 service with basic instance operations#205
Conversation
Implement EC2 service with support for: - RunInstances, TerminateInstances, DescribeInstances - StartInstances, StopInstances - CreateSecurityGroup, DeleteSecurityGroup - AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress - CreateKeyPair, DeleteKeyPair, DescribeKeyPairs Also update QueryProtocolService interface to support action-based routing, allowing multiple Query protocol services (EC2, SNS) to coexist on the same endpoint. Closes #13
- Add EC2 tagliatelle exclusion in golangci.yaml for PascalCase JSON tags - Add package comment to handlers.go - Rename IpPermission to IPPermission (var-naming) - Rename EC2Error to Error (exported stutter) - Fix staticcheck S1016: use type conversion for XMLGroupIdentifier - Fix wsl: add blank line before range statement - Split DescribeKeyPairs into helper functions to fix funlen
EC2 SDK sends Action parameter in POST body (form-urlencoded), not in URL query string. The QueryProtocolDispatcher parses the body and sets X-Amz-Target header with the action name. Update DispatchAction to read the action from this header first, with URL query fallback.
- Convert form values to proper JSON types (int, bool) for unmarshaling - Use GroupDescription field name to match AWS SDK parameter name
EC2 Query protocol sends array parameters like InstanceId.1, InstanceId.2. Convert these to JSON arrays with plural name (InstanceId -> InstanceIds).
Contributor
📊 Integration Test Coverage ReportTotal Coverage: 64.6% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Implements EC2 service with 12 basic operations for instance management, security groups, and key pairs.
Changes
EC2 Service Implementation
Query Protocol Enhancement
Actions()method toQueryProtocolServiceinterfaceQueryProtocolDispatcherFiles Changed
internal/service/ec2/: New EC2 service implementationtypes.go: Request/response types and XML structuresstorage.go: In-memory storage with RSA key pair generationhandlers.go: Operation handlers for all 12 APIsservice.go: Service registration with QueryProtocolServiceinternal/server/awsquery.go: Action-based routing for Query protocolinternal/server/server.go: Register actions during service registrationinternal/service/interface.go: Add Actions() to QueryProtocolServiceinternal/service/sns/service.go: Implement Actions() methodtest/integration/ec2_test.go: Integration tests with AWS SDK v2Testing
Checklist
Closes #13