Commit Graph
13 Commits
Author SHA1 Message Date
Michal SchreiberandMichal Schreiber ac4b865a34 feat(ec2): support managed prefix lists (#2105)
* feat(ec2): support managed prefix lists

Implement CreateManagedPrefixList, DescribeManagedPrefixLists,
GetManagedPrefixListEntries, ModifyManagedPrefixList and
DeleteManagedPrefixList.

Entries are versioned: a list starts at version 1 and every modification that
changes entries stores a new version, so GetManagedPrefixListEntries can serve
an earlier TargetVersion. Renaming or raising MaxEntries does not create a
version, CurrentVersion makes a modification conditional, and removals apply
before additions so one call can replace an entry's description.

The AWS-managed gateway-endpoint lists are now built once and served by both
DescribeManagedPrefixLists and the existing DescribePrefixLists, so the two
surfaces cannot report different CIDRs for the same list. They are read-only.

Closes #2100

* fix(ec2): validate prefix list input and keep tag copies in sync

Three defects in the managed prefix list surface:

ModifyManagedPrefixList only checked the resulting entry count against
MaxEntries, so a zero or negative MaxEntries on an empty list passed the check
and persisted an impossible capacity.

CreateTags and DeleteTags update the generic tag store and then mirror the
result onto the resource, but updateResourceTags had no arm for prefix lists,
leaving the copy on the model stale for describe responses and tag filters.

MaxEntries and TargetVersion were converted with Integer/Long.valueOf, so
malformed input escaped as an unchecked NumberFormatException and became a 500
rather than a structured EC2 client error.

* fix(ec2): reject a missing PrefixListId and infer the prefix-list tag type

A null PrefixListId reached List.of() inside describeManagedPrefixLists and
threw NullPointerException, so DeleteManagedPrefixList,
GetManagedPrefixListEntries and ModifyManagedPrefixList answered a request that
never named a list with a 500 rather than a client error. Guard the lookup and
raise MissingParameter.

inferResourceType had no pl- arm, so tags on a prefix list were stored but
reported as resourceType "unknown" and were invisible to a DescribeTags filter
on resource-type. The existing test only covered describe and tag: filters,
which is why this went unnoticed.

Also cover the accepting branch of the address-family check, which until now was
only reached by the rejecting case.

* fix(ec2): treat a blank numeric parameter as malformed rather than absent

intOrNull and longOrNull returned null for a present but blank value, which the
callers read as "parameter not supplied". For CurrentVersion that silently
downgraded a conditional ModifyManagedPrefixList to an unconditional one, so a
request that asked to be gated on a version was applied anyway. Only an absent
parameter is null now; a blank one reaches the parse and surfaces as
InvalidParameterValue.

* fix(ec2): report PrefixListVersionMismatch for a stale CurrentVersion

A conditional ModifyManagedPrefixList that loses the version check returns
PrefixListVersionMismatch on AWS, not IncorrectState; verified against a live
account, which also supplies the message. The Terraform provider keys its retry
handling on that code, so the previous one would have left a caller unable to
recognise a losing conditional update.

---------

Co-authored-by: Michal Schreiber <michal.p.schreiber@gmail.com>
2026-08-10 19:03:26 -05:00
soreavis d943e09a73 feat(ec2): add ReplaceRoute (#2178)
Terraform calls ReplaceRoute whenever an existing route changes target, so
route tables could be created but never updated; the only workaround was
to destroy and recreate the table.

The action replaces the target of the route matching DestinationCidrBlock.
AWS takes exactly one target per call, so the target a request does not name
is cleared rather than carried over; a merge would leave a route holding two
targets at once, which AWS cannot produce.

Only GatewayId and NatGatewayId are modelled by Route, plus LocalTarget,
which needs no new field because `local` is the gateway id a route table's
built-in route already carries. The other ten AWS targets keep the
UnsupportedOperation they returned before this action existed rather than
being accepted and silently clearing the route they were meant to repoint.

Errors follow the EC2 reference: InvalidRoute.NotFound when no route matches
the destination, MissingParameter when DestinationCidrBlock is absent (an
IPv6 or prefix-list request), and InvalidParameterCombination for two
targets or none.

Closes #2087
2026-08-08 22:47:28 -04:00
TiM 321394fea0 docs: fill supported action descriptions (#1819)
* docs: fill supported action descriptions

* docs(elb): describe listener default rule as non-deletable, not immutable

The CreateListener row called the default rule "immutable", which contradicts
the ModifyListener row (updates default actions) and the file's own note that
the rule can be changed via ModifyListener. The rule cannot be deleted or
reprioritized, but its action is mutable, so "non-deletable" is accurate.
2026-07-10 17:45:51 -05:00
Hector Ventura a27971c7d5 feat(ec2): publish security-group TCP ingress ports on the host (#1680)
* feat(ec2): publish security-group TCP ingress ports on the host

For each TCP port opened to a CIDR source by an instance's security
groups, start an alpine/socat sidecar that binds an allocated host port
(default 30000-30999) and forwards to the instance container's IP, so
the app is reachable from localhost. Forwards reconcile at launch, on
authorize/revoke-security-group-ingress, and on ModifyInstanceAttribute
group reassignment (previously ignored). Mappings persist and are
restored across restarts. SSH is never re-forwarded; wide rules and
per-instance totals are capped; disable with
publish-security-group-ports=false.

* fix(ec2): drop stale port mapping when sidecar recreation fails

On restore, a failed socat recreation released the host port but left
the appPort->hostPort entry in publishedPorts, so later reconciles saw
the port as already published and never re-published it, and a later
unpublish could double-release the host port. Remove the entry and
persist on failure. Also null-guard portForwardManager.restore() for
consistency with the setPersister guard. Adds a regression test.

* fix(ec2): skip port-forward reconcile on non-running instances

A reconcile queued by authorize-security-group-ingress could run after
a concurrent stop/terminate had already cleared publishedPorts and
removed the container; it then republished via the stale bridge IP,
leaking an orphaned socat sidecar and a host port that nothing would
release. Stop/terminate flip the instance state before their async
unpublishAll, so guarding reconcileNow on the running state under the
instance lock closes every window. Adds regression tests.
2026-07-01 23:00:27 -05:00
TiM 398100100a docs: add supported action description columns (#1639) 2026-06-29 19:29:43 -05:00
Jason van Zyl ad785f95f6 feat(ec2): add Java-built Ubuntu AMI guest image (#1542) 2026-06-25 00:33:15 -05:00
seyi idowu 7efb280dbc fix(ec2): VPC endpoint compatibility for AWS SDK/Terraform (#1476)
- emit routeTableIdSet/subnetIdSet items as plain text (AWS SDK for Go could not
  deserialize the wrapped form)
- add DescribePrefixLists returning managed S3/DynamoDB prefix lists
- honor private_dns_enabled (default true for interface endpoints)

Adds Ec2IntegrationTest coverage and documents the new actions.
2026-06-23 21:57:37 -05:00
seyi idowu 2301db53c7 feat(ec2): add Network ACL support (#1473)
Implements CreateNetworkAcl, DescribeNetworkAcls (with vpc-id / default /
association.subnet-id filters), CreateNetworkAclEntry, ReplaceNetworkAclEntry,
DeleteNetworkAclEntry, ReplaceNetworkAclAssociation, and DeleteNetworkAcl.
Every VPC is provisioned with a default NACL and each subnet is associated with
it, so aws_network_acl and aws_default_network_acl work via Terraform.

Adds Ec2IntegrationTest coverage and documents the new actions.
2026-06-22 22:57:57 -05:00
Jason van ZylandHector Ventura 56706217d3 feat(autoscaling): support group reconciliation and refresh (#1393)
* feat(autoscaling): support group reconciliation and refresh

* fix(ec2): align instance runtime parity

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-06-18 18:14:19 -05:00
Jason van Zyl f9c305b7c6 Add EC2 provisioning primitives (#1252)
* feat(ec2): load AMI catalog metadata

* feat(ec2): add Ubuntu 24.04 AMI metadata

* feat(ec2): add launch template APIs

* feat(ec2): add launch template version APIs

* feat(ec2): add VPC endpoint CRUD

* feat(ec2): add NAT gateways and instance offerings

* fix(ec2): add t4g.medium instance offering

* fix(ec2): preserve launch template version data

* fix(ec2): align subnet helper references

* fix(ec2): keep VPC endpoint services empty
2026-06-11 01:32:17 -05:00
Hector Ventura 832cdf94db feat(ec2): real Docker container execution with SSH, UserData, and IMDS (#658)
* feat(ec2): real Docker container execution with SSH, UserData, and IMDS
* fix: test for ec2
2026-04-30 18:28:17 -05:00
TiM a32b7f1f3b docs: comprehensive audit sweep + CHANGELOG backfill (1.1.0-1.5.2) (#326)
CHANGELOG.md was empty for the 1.1.0-1.5.2 release cycle and service docs
had drifted from code behaviour. This sweep reconciles docs against the
current codebase on upstream/main.

- Backfill CHANGELOG.md for 1.1.0 through 1.5.2 from git history
- Correct exact operation counts in docs/services/index.md: S3 (~30 -> 58),
  Lambda (~25 -> 30), API Gateway v1 (~24 -> 62). Counts now come from the
  actual dispatch handlers rather than @Path annotation counts.
- Rewrite README "Supported Services" table to drop per-service op counts
  (they drift too fast); point readers at docs/services/index.md
- Update 24 service docs for accuracy, add "Not Implemented" sections
  where relevant (s3.md, lambda.md, api-gateway.md)
- Refresh configuration and getting-started docs
- Add EventBridge Scheduler and AppConfig to mkdocs nav
- Add AppConfig / AppConfigData rows to README and services index
  following the 1.5.2 upstream release
2026-04-10 10:52:34 -05:00
Hector Ventura 2859d257b5 feat(ec2): add EC2 service with 61 operations, integration tests, and docs (#213)
* feat(ec2): adding ec2 service
* feat(ec2): add EC2 service with 61 operations, integration tests, and docs
2026-04-06 00:22:53 -05:00