Class AwsDirectDeployer

java.lang.Object
com.cloudforgeci.api.deploy.aws.AwsDirectDeployer
All Implemented Interfaces:
AutoCloseable

public final class AwsDirectDeployer extends Object implements AutoCloseable
Creates and incrementally updates CloudFormation stacks on real AWS via change sets.

Backs CloudForgeDeployment's AWS case — the direct-deploy counterpart to LocalStackDeployer/MiniStackDeployer, minus everything specific to emulating AWS locally (no LocalStack Cognito/RDS-secret reconciliation, no ECS-restart-after-secret-sync — real AWS Cognito/RDS integrate through CDK's own Secrets Manager wiring and need none of that).

Targets real AWS by default, but transparently redirects to a local emulator when *Manager itself* is running inside one — same LOCALSTACK_ENDPOINT/ AWS_ENDPOINT_URL env-var detection LocalStackDeployer.resolveEndpoint() already uses, deliberately mirrored here rather than left real-AWS-only — without an endpoint override, a deploy:create click from a Manager instance hosted on LocalStack would try to reach cloudformation.us-east-1.amazonaws.com instead of the local emulator it's actually running against.

Every stack this deployer creates or updates is tagged with the same cloudforge:managed/cloudforge:application/cloudforge:runtime convention ApplicationFargateStack/ApplicationEc2Stack apply via Tags.of(this).add(...) at synthesis time — required both for Manager's own AWS inventory (see StackListingPolicy) and for the aws:RequestTag/ aws:ResourceTag IAM conditions ManagerOperatorIamSupport.deployStatements scopes CreateStack/UpdateStack to. Those conditions evaluate the stack-level Tags parameter on the CloudFormation API call itself, not any resource-level tags already baked into the template by the CDK Tags aspect — the two are separate CloudFormation tagging mechanisms, and only the former is what this class controls.

Not exercised against real AWS in this repo's test suite — no AWS credentials are available in CI/dev sandboxes for that. AwsDirectDeployerTest instead points this class at a real LocalStack instance via the injectable-client constructor (LocalStack is CloudFormation-API-compatible), which exercises every code path except real AWS's actual network/auth surface. Treat a real AWS deploy as the first true end-to-end validation of this class specifically — the underlying changeset create/execute/wait sequence is otherwise a close copy of LocalStackDeployer's, which has been exercised that way for a while.